CLI Reference
ctxindex sync
Synchronize one Source or all enabled sync-capable Sources.
Sync materializes provider context transactionally and records a Sync Run. A failed run preserves the previous durable cursor.
Usage
ctxindex sync [--source <source>] [--mode <mode>] [--format <format>] [--json]Flags
| Flag | Purpose |
|---|---|
--source <source> | Select an exact Source label or ID. Omit it to sync all eligible Sources. |
--mode sync | Run baseline cursor-driven synchronization. |
--mode resync | Request a full resynchronization when the Adapter supports it. |
--mode diff | Validate a diff while rolling back materialized changes when supported. |
--format <format> | Select readable output format. |
--json | Print deterministic JSON. |
Only Sources whose Adapters declare sync capability can run. A global lock prevents overlapping sync runs.
JSON output
sync --json reports the requested mode, one result per Source, run counts and status, plus warnings. Diagnostics remain on stderr.
Stable exit codes
Exit codes are API: 0 success; 2 invalid usage; 10 needs_auth; 20 rate limited; 30 network/provider; 40 permission denied; 50 other sync failure; 130 cancelled by SIGINT. Cancellation leaves the prior durable cursor valid.