**Motivations:** - Seed AnythingLLM workspace from cloned repo using gitignore-style filters **Root causes:** - N/A **Correctifs:** - N/A **Evolutions:** - Template 4nkaiignore.default; server copies after clone; extension uploads via POST /api/v1/document/upload - New commands /workspace-sync; settings initialSync*; dependency ignore **Pages affectées:** - extensions/anythingllm-workspaces/* - services/repos-devtools-server/* - docs/features/initial-rag-sync-4nkaiignore.md
AnythingLLM Workspaces (VS Code / Cursor)
AnythingLLM developer API (workspaces, documents), optional repos-devtools-server, Dev tools webview, and initial RAG upload after clone/load using .4nkaiignore (same syntax as .gitignore).
Requirements
- AnythingLLM with API key (Settings → API Keys). Do not use the nginx Bearer for
/ollama/here. repos-devtools-serveron the host that owns clones (defaulthttp://127.0.0.1:37140).- For document upload, AnythingLLM’s document processor (collector) must be online; otherwise
POST /api/v1/document/uploadreturns an error.
Configuration
| Key | Description |
|---|---|
anythingllm.baseUrl |
AnythingLLM public URL (no trailing /). |
anythingllm.apiKey |
API key. User settings. |
anythingllm.reposApiBaseUrl |
repos-devtools-server URL. |
anythingllm.reposApiToken |
Same as REPOS_DEVTOOLS_TOKEN. |
anythingllm.initialSyncAfterClone |
Default on: after /repos-clone-sync, /repos-load-sync, and /workspace-sync, upload filtered files. Set to false to disable. |
anythingllm.initialSyncMaxFiles |
Max files per run (default 400). |
anythingllm.initialSyncMaxFileBytes |
Max bytes per file (default 5242880). |
Commands (palette)
- AnythingLLM: List workspaces —
GET /api/v1/workspaces, open one in the browser. - AnythingLLM: Open web UI
- AnythingLLM: Dev tools panel — webview for scripted commands.
.4nkaiignore
- Template (reference):
templates/4nkaiignore.defaultin this extension (and the same file underservices/repos-devtools-server/templates/for the clone server). - At repo root: the file must be named
.4nkaiignore. - After
git clonevia the server: if.4nkaiignoreis missing, the server copies the template into the new repo (fourNkAiIgnoreTemplateWrotein the JSON response). - Before upload: the extension creates
.4nkaiignorefrom the bundled template only if it is still missing (e.g. repo cloned outside the server).
Filtering uses the ignore package (gitignore semantics). The extension always applies baseline rules (e.g. .git/, node_modules/) in addition to .4nkaiignore.
Dev tools — command lines
| Line | Behaviour |
|---|---|
/repos-clone-sync <url> |
Clone (branch test) → ensure workspace → initial RAG upload (if enabled) → open folder → browser. |
/repos-load-sync <name> |
Open folder → ensure workspace → initial RAG upload → browser. |
/workspace-sync <name> |
Resolve repo under REPOS_DEVTOOLS_ROOT → ensure workspace → initial RAG upload (no folder open). |
/workspace-load <name> |
Ensure workspace → browser only (no file upload). |
| Other lines | See help in the panel. |
Upload uses POST /api/v1/document/upload with multipart field file and addToWorkspaces set to the workspace slug. Relative paths are flattened to a safe single-segment filename (dir__file.ts) to reduce name collisions.
JSON field workspaceCreatedByApi: true only if this run called POST /api/v1/workspace/new; false if the workspace already existed.
Ollama
Not used by this extension. Configure Cursor’s model URL for /ollama/v1 separately.
Build
cd extensions/anythingllm-workspaces
npm install
npm run compile
References
- AnythingLLM document API:
POST /v1/document/uploadunder/api(Mintplex-Labs anything-llmserver/endpoints/api/document/index.js). - Local server:
services/repos-devtools-server/README.md.
License
MIT