Nicolas Cantu 088eab84b7 Platform docs, services, ia_dev submodule, smart_ide project config
- Add ia_dev submodule (projects/smart_ide on forge 4nk)
- Document APIs, orchestrator, gateway, local-office, rollout
- Add systemd/scripts layout; relocate setup scripts
- Remove obsolete nginx/enso-only docs from this repo scope
2026-04-03 16:07:58 +02:00

2.1 KiB

anythingllm-pull-sync

Runs after git pull (Git hook post-merge) to upload files changed between ORIG_HEAD and HEAD to an AnythingLLM workspace via POST /api/v1/document/upload.

Requirements

  • AnythingLLM collector / document processor online.
  • Same .4nkaiignore rules as the VS Code extension (repo root).
  • Environment (see below): base URL, API key, workspace slug (or .anythingllm.json).

Environment

Variable Required Description
ANYTHINGLLM_BASE_URL yes e.g. https://ia.enso.4nkweb.com/anythingllm (no trailing /)
ANYTHINGLLM_API_KEY yes Developer API key (Settings → API Keys)
ANYTHINGLLM_WORKSPACE_SLUG no* Workspace slug
ANYTHINGLLM_SYNC_MAX_FILES no Default 200 per run
ANYTHINGLLM_SYNC_MAX_FILE_BYTES no Default 5242880

* If unset, the script reads repo/.anythingllm.json: { "workspaceSlug": "my-slug" }.

Optional: create ~/.config/4nk/anythingllm-sync.env:

export ANYTHINGLLM_BASE_URL='https://ia.enso.4nkweb.com/anythingllm'
export ANYTHINGLLM_API_KEY='…'
# export ANYTHINGLLM_WORKSPACE_SLUG='algo'   # optional if .anythingllm.json exists

The generated hook sources this file when present.

Install the hook in a repository

From the machine that has smart_ide:

/home/ncantu/code/smart_ide/scripts/install-anythingllm-post-merge-hook.sh /home/ncantu/code/algo
/home/ncantu/code/smart_ide/scripts/install-anythingllm-post-merge-hook.sh /home/ncantu/code/builazoo

Then once per machine:

cd /home/ncantu/code/smart_ide/scripts/anythingllm-pull-sync && npm install

Behaviour

  • Only paths produced by git diff --name-only --diff-filter=ACMRT ORIG_HEAD HEAD (added/changed, not deletions).
  • If ORIG_HEAD is missing or env/slug is missing, the script exits 0 and prints a message (your pull is not blocked).
  • Deletions / renames are not mirrored as removals in AnythingLLM in this version (upload-only).

Uninstall

rm -f /path/to/repo/.git/hooks/post-merge