smart_ide/docs/repo/script-anythingllm-pull-sync.md
4NK 3f1894e21f Remove AnythingLLM VS Code extension; add Carbonyl service (upstream submodule)
- Delete extensions/anythingllm-workspaces; document migration to anythingllm-devtools
- Add services/carbonyl: shallow submodule fathyb/carbonyl, run-carbonyl.sh (Docker/native)
- Add scripts/open-carbonyl-preview-test.sh and smart_ide.preview_urls.test in example conf
- Docs: service-carbonyl, carbonyl-terminal-browser, architecture index updates
2026-04-03 22:13:34 +02:00

52 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# anythingllm-pull-sync (`scripts/anythingllm-pull-sync/`)
Sexécute après **`git pull`** via le hook Git **`post-merge`** : envoie les **fichiers modifiés** entre `ORIG_HEAD` et `HEAD` vers un workspace AnythingLLM (`POST /api/v1/document/upload`).
## Prérequis
- Processeur de documents AnythingLLM en ligne.
- Mêmes règles **`.4nkaiignore`** que lextension VS Code (racine du dépôt cible).
- Variables denvironnement ou fichier **`repo/.anythingllm.json`** (`workspaceSlug`).
## Variables
| Variable | Obligatoire | Description |
|----------|-------------|-------------|
| `ANYTHINGLLM_BASE_URL` | oui | Sans `/` final |
| `ANYTHINGLLM_API_KEY` | oui | Clé API développeur |
| `ANYTHINGLLM_WORKSPACE_SLUG` | non* | Slug du workspace |
| `ANYTHINGLLM_SYNC_MAX_FILES` | non | Défaut `200` |
| `ANYTHINGLLM_SYNC_MAX_FILE_BYTES` | non | Défaut `5242880` |
\* Si absent : lecture de **`repo/.anythingllm.json`**.
Fichier optionnel **`~/.config/4nk/anythingllm-sync.env`** sourcé par le hook généré.
## Installation du hook sur un clone
```bash
/path/vers/smart_ide/scripts/install-anythingllm-post-merge-hook.sh /path/vers/repo-cible
```
Une fois par machine, depuis ce dépôt :
```bash
cd scripts/anythingllm-pull-sync && npm install
```
## Comportement
- Uniquement les chemins de `git diff --name-only --diff-filter=ACMRT ORIG_HEAD HEAD`.
- Si `ORIG_HEAD` ou config manque → **exit 0** avec message (ne bloque pas le pull).
- Pas de suppression miroir des fichiers supprimés dans AnythingLLM dans cette version (upload seul).
## Désinstallation
```bash
rm -f /path/vers/repo/.git/hooks/post-merge
```
## Liens
[features/anythingllm-pull-sync-after-pull.md](../features/anythingllm-pull-sync-after-pull.md), [anythingllm-workspaces.md](../anythingllm-workspaces.md), [service-anythingllm-devtools.md](./service-anythingllm-devtools.md).