Skip to content

feat(cli): wire 'why' command - #20

Closed
quarnel-dev wants to merge 1 commit into
vericontext:mainfrom
quarnel-dev:feat/why-cli-command
Closed

quarnel-dev wants to merge 1 commit into
vericontext:mainfrom
quarnel-dev:feat/why-cli-command

Conversation

@quarnel-dev

Copy link
Copy Markdown

Closes #1.

Wires the existing handleWhy handler (src/tools/why.ts) as a CLI command
in src/index.ts. Mirrors the signals pattern: load config -> store ->
handler -> print.

  • contextix why "<event>" — causal chain
  • contextix why "<event>" --depth N — depth limit (default 3)
  • contextix why "<event>" --json — JSON output
  • contextix why --help — usage

Tradeoffs: none. Reuses traceCausalChain as-is, no changes to query layer.

Tested locally:

  • node dist/index.js why --help — usage printed
  • node dist/index.js why "record-demo" — chain returned
  • node dist/index.js why "record-demo" --depth 2 — depth honored
  • node dist/index.js why "record-demo" --json — MCP-shaped JSON

Note: local regex graph after ingest markdown . has no multi-hop causal
chains, so chainLength is 1 for all events tested. CLI wiring works.

npm run typecheck and npm run build pass.

@quarnel-dev
quarnel-dev marked this pull request as ready for review September 14, 2026 14:13
@quarnel-dev quarnel-dev closed this by deleting the head repository Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire contextix why as a CLI command

1 participant