Skip to content

feat: add --json flag to rafter agent status #30

@Rome-1

Description

@Rome-1

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

  1. node/src/commands/agent/status.ts — add --json option, output JSON to stdout
  2. python/rafter_cli/commands/agent.py — add matching --json flag to the status subcommand
  3. Add tests in both node/tests/ and python/tests/
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions