CLI Reference
ifg is the command-line entry sharing the Host's codebase (tsx server/cli.ts, or pnpm ifg …). It has two modes:
- attached: connects to a running Host (reads the
host.jsonhandshake), reusing its open DBs; --standalone: opens the DBs itself, independent of the Host process.
Both modes are verified. In attached mode, restore-type operations prompt to "restart the Host to load".
Commands
| Command | Purpose |
|---|---|
ifg doctor [--strict] | Environment health: deps, data dir, native modules, code runtimes (a dedicated code line) |
ifg sessions | List sessions |
ifg profile ls | List profiles |
ifg kb ls | List KB collections |
ifg kb search "query" [--explain] | Search; --explain shows how the two legs divide work |
ifg kb add <path|dir|url> -c <collection> | Import documents (currently md/txt, no OCR) |
ifg kb sync | Inbox sync |
ifg kb reindex | Rebuild index (attached mode polls the background job's progress) |
ifg kb eval golden.jsonl | Run retrieval eval |
ifg eval sets / eval run / eval rm | Eval-set management |
ifg asr bench <audio dir> | ASR benchmark: real CER / terminology / latency (needs a DeepSeek key; same-named .txt as reference) |
ifg judge calibrate labels.jsonl | Judge calibration |
ifg verify <sessionId> / verify-file | Verify report hash + HMAC |
ifg export <sessionId> | Export a session / package a profile |
ifg import <file.tar.gz> [--force] | Restore from an export package (--force overwrites same-named data, keeps identity & PIN) |
ifg lineage gc [--days 30] | Clean orphan provenance records |
Reindex CLI behavior
In attached mode ifg kb reindex no longer blocks synchronously: it POSTs to start a background job, then polls GET /kb/reindex/status every second:
job = null→ throwsreindex job lost (server restarted?);status = failed→ throws;status = success→ prints{ chunks, collections }.
See Background Reindex.
Backup / restore loop
bash
ifg export <sessionId> # package app.db / lineage.db / inbox/ / identity & PIN check value
ifg import backup.tar.gz # verify schema version & integrity → atomic whole-directory replacement
ifg import backup.tar.gz --force # overwrite same-named data, but keep existing identity & PIN- Before import, the package's schema version and integrity are verified (newer than the program, or corrupt, is rejected outright), then an atomic whole-directory replacement — a mid-way failure never leaves a half-new/half-old profile.
- While the Host is running, CLI
--forceis forbidden; use the UI to restore. - The package intentionally excludes
keys/master.key, provider API keys, andshared.db/system.db— to avoid "backup equals credential leak". After moving machines, re-enter keys and unlock with the PIN.
Typical troubleshooting
bash
ifg doctor --strict # check the environment first
ifg kb search "AOF rewrite" --explain # see how the two retrieval legs divide work
ifg verify <sessionId> # report integrity
ifg lineage gc --days 30 # clean provenance