CLI

Prepare context from the terminal.

The CLI is the fastest path from a task prompt to a risk header, agent-ready handoff, inspectable packet, compact summary, report, and eval score.

Start with one command.

Use prepare before asking an AI coding agent to make a change. It prints a risk header and handoff in one step; the raw packet remains available for audit.

npm run setup -- --target cli
npm run prepare -- "Add refresh token rotation"
npm run drift

The full command set.

  • prepare builds context and prints an agent-ready handoff with Context ready · risk=....
  • setup checks first-run readiness for --target cli, --target mcp, --target vscode, or all local integrations.
  • packet builds the raw current task packet (add --report for a local HTML report, --dry-run to skip writes).
  • insights shows packet readiness, risk level, and recommended next steps.
  • compact prints a small preview for chat-first workflows.
  • controls --cleanup-stale removes manual pin/exclude paths that no longer exist.
  • handoff copies prompt-ready context — --format copilot | spec-kit | markdown | replay | json | compact.
  • eval scores packets against a labeled gold set; npm run eval:multi is the release-gated multi-shape suite.
  • diff compares the current packet with the previous one; drift checks whether current git changes moved outside the packet.
  • scan and snapshot inspect raw workspace signals and local change detection.
  • metrics prints local context-quality signals; summary writes manager-friendly Markdown and JSON.
  • report generates a standalone local HTML report for the latest packet.
  • init creates a config file; doctor checks scanner health, git availability, and exclusions.

Local, inspectable outputs.

Context Delta writes packet JSON, reports, history, metrics, and summaries under .contextdelta/. Metrics avoid raw code by default so teams can measure context quality without centralizing source.

$ npm run packet -- "Add refresh token rotation for admin users"

Context Packet Ready
Insight: Packet is ready for spec-driven AI coding.
Risk: low
Changed files: 3
Related tests: 2
Relevant specs: 1
Rules/instructions: 2
Excluded noisy files: 18
Estimated context reduction: 64%
Useful-context density: 58%
Budget pressure: low
Numbers above are an example run. Reduction is computed locally against a whole-repo baseline, so treat it as an upper bound rather than a guaranteed saving versus your agent's current context.

Prompt-ready handoff.

Use Copilot, Spec Kit, Markdown, replay, compact JSON, or full JSON formats depending on the agent and the depth of context needed.

The CLI also works without git by using local snapshots, so new users are not blocked by setup differences.