CLI Command Reference
Interacting with ghost and ghost-checkpoint binaries
Ghost ships two binaries: ghost (user-facing audit CLI) and ghost-checkpoint (lightweight hook runner called by agents).
ghost (Audit CLI)
Initializes ghost in the current repo. With --yes, creates configs and binaries automatically. --dry-run previews what would happen. --interactive starts a guided setup.
Installs hooks and session plugins into the current repo. With --global, applies to every repo on the machine.
Runs the attribution blamer across commit history. Computes AI-authored line percentage and enforces threshold policies. Add --json for machine-readable output. Exit code 1 if AI% exceeds threshold.
Prints a line-by-line attribution breakdown for a file, color-coded by human or agent source. Overlays ghost note data onto git blame output.
Checks hook integrity, missing ref configurations, and Git sync setup. With --fix, attempts to repair common issues automatically.
Reads and writes ghost.yml settings. Use ghost config to print the current config, ghost config set threshold 70 to change a value.
ghost-checkpoint (Hook Runner)
Called by agent pre/post tool hooks. Must stay fast — it runs on every agent edit.
Snapshot the working tree before agent edits. Saves the current diff to .git/ghost/working.log.
Compare current state against the pre-hook snapshot. Extracts changed line ranges and writes a session JSON to .git/ghost/sessions/.
Clear working log and session files. Useful after an aborted agent run.