What
rafter agent status only prints formatted text. Add a --json flag for programmatic/agent consumption.
Why
Other commands like rafter agent audit --json and rafter agent scan --json already support structured output. AI agents and CI scripts need machine-readable status checks.
Files to change
node/src/commands/agent/status.ts — add --json option, output JSON to stdout
python/rafter_cli/commands/agent.py — add matching --json flag to the status subcommand
- Add tests in both
node/tests/ and python/tests/
- Update
shared-docs/CLI_SPEC.md with the JSON schema
Expected JSON output
{
"installed": true,
"version": "0.6.5",
"agents_detected": ["claude-code", "cursor"],
"hooks_installed": ["pre-commit"],
"gitleaks_available": true,
"config_path": "~/.rafter/config.json",
"audit_log_path": "~/.rafter/audit.jsonl"
}
Reference
See how rafter agent audit implements --json in node/src/commands/agent/audit.ts for the pattern.
What
rafter agent statusonly prints formatted text. Add a--jsonflag for programmatic/agent consumption.Why
Other commands like
rafter agent audit --jsonandrafter agent scan --jsonalready support structured output. AI agents and CI scripts need machine-readable status checks.Files to change
node/src/commands/agent/status.ts— add--jsonoption, output JSON to stdoutpython/rafter_cli/commands/agent.py— add matching--jsonflag to the status subcommandnode/tests/andpython/tests/shared-docs/CLI_SPEC.mdwith the JSON schemaExpected JSON output
{ "installed": true, "version": "0.6.5", "agents_detected": ["claude-code", "cursor"], "hooks_installed": ["pre-commit"], "gitleaks_available": true, "config_path": "~/.rafter/config.json", "audit_log_path": "~/.rafter/audit.jsonl" }Reference
See how
rafter agent auditimplements--jsoninnode/src/commands/agent/audit.tsfor the pattern.