The CLI
Requirements, pairing, sync, troubleshooting and the command reference.
The CLI reads supported local coding-agent logs and syncs derived usage and Git metadata. See supported surfaces and what leaves your machine.
Commands
Use npx centrail@latest <command> without a global installation, or centrail
with a global npm or mise installation.
| Command | What it does |
|---|---|
connect [--no-browser] [--url <base>] | Pair this machine, review repository scope, then run agent setup. |
setup [--agent <name>] [--dry-run] [-y] | Plan and install agent integrations; -y accepts the plan. |
doctor [--json] [--fix] | Inspect integrations and updates; --fix repairs them. |
scope | Review which repositories and folders may sync. |
repos | List repositories and their capture status. |
exclude <repo> | Exclude that repository from future usage and Git metadata uploads. |
include <repo> | Undo an exclusion or include the repository in allow mode. |
status | Show which account this machine syncs to and whether its pairing still works. |
sync [--full] [--quiet|--verbose] | Sync new usage, or re-scan retained history. |
surfaces [<name> on|off] | Turn a log source (claude-code, codex, copilot-cli, gemini-cli, pi) on or off. |
import <ccusage.json> | Import a ccusage claude daily/session --json file of earlier Claude Code history. |
inspect --last | Print the last attempted usage batch locally; excludes earlier batches and attribution uploads and does not prove server acceptance. |
upgrade [-y] | Update this copy the way it was installed. |
uninstall [--agent <name>] [-y] | Remove Centrail's agent integrations and launcher. |
--version | Print this copy's version. |
Exclusions affect future uploads; they do not delete data already uploaded. Capture scope is separate from team sharing. Review private metadata before sharing inspection output. See getting started for setup and automation boundaries.
Pairing and sync
The CLI needs a Node.js version its package's engines.node allows. Keep
@latest in npx commands: npx caches packages and can run an old copy.
connect prints a link and a short code; confirm the code matches before
Authorize. The device token is saved to ~/.config/centrail/auth.json,
readable only by your user on macOS and Linux; on Windows it relies on your
profile's permissions.
sync sends what is new since each agent's last sync, so an agent a CLI
upgrade newly supports backfills its retained history on the next sync; run
setup to add its per-turn integration. sync --full re-scans all retained
history. The server de-duplicates events, so re-sending never double-counts.
- "This machine is no longer connected to Centrail": its pairing was
revoked or replaced; run
connectagain. - "Nothing in scope to sync": usage exists but your repository scope holds
it back; check
reposorscope.
Agent setup
Claude Code gets the plugin from the release channel with auto-update enabled;
without a Claude command, setup uses a Stop hook. Codex gets a Stop hook,
Gemini CLI an AfterAgent hook, Copilot CLI an agentStop hook, and Pi an extension.
Codex users must review and trust the stable launcher once in /hooks.
Cursor and OpenCode require explicit --agent cursor or --agent opencode;
they record repository identity only, with no usage collection. OpenCode v2
usage is unsupported.
setup-plugin, install-hooks, uninstall-hooks and doctor-hooks are
compatibility aliases; prefer setup, uninstall and doctor in new instructions. Upgrade then run setup to migrate old
hooks to the stable launcher. Run doctor if automation stops working.
The launcher uses the stable mise/global npm copy when available, then Centrail
on PATH, then npx; it never pins an npx cache path. It lives in
~/.config/centrail/bin (centrail-hook.cmd on Windows). Uninstall removes
integrations, not your package-manager installation or hosted account. Remove
an npm global package with npm uninstall -g centrail; manage a mise install
with mise. Revoke the device in Settings → Devices to stop its token syncing.
License and package
The CLI is proprietary: its use is governed by the Centrail CLI License Agreement
(LICENSE.md, shipped in the package). The package page on npm
carries its README, with installation and troubleshooting.