Skip to content

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.json handshake), 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 ​

CommandPurpose
ifg doctor [--strict]Environment health: deps, data dir, native modules, code runtimes (a dedicated code line)
ifg sessionsList sessions
ifg profile lsList profiles
ifg kb lsList 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 syncInbox sync
ifg kb reindexRebuild index (attached mode polls the background job's progress)
ifg kb eval golden.jsonlRun retrieval eval
ifg eval sets / eval run / eval rmEval-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.jsonlJudge calibration
ifg verify <sessionId> / verify-fileVerify 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 → throws reindex 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 --force is forbidden; use the UI to restore.
  • The package intentionally excludes keys/master.key, provider API keys, and shared.db / system.db — to avoid "backup equals credential leak". After moving machines, re-enter keys and unlock with the PIN.

See Operations & Data Layout.

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

Local-first · inference egresses on demand · fully traceable