Commit 25ed900
feat(cli): add --json / --quiet for agent-shaped output (#44)
Status, search, and mined now emit JSON to stdout when --json/-j is
passed, mirroring the MCP tool response shapes so an agent can switch
between MCP and CLI without rewriting parsers. --quiet/-q suppresses
the decorative chrome (banners, divider lines, daemon-routing
announcement on stderr). Both flags work pre- and post-subcommand.
Auto-detect: when stdout is not a TTY, quiet mode is on by default so
piped output stays clean — explicit --quiet/--json still override.
Exit codes (per issue #44):
0 success
1 no results (search returned empty; mined found nothing)
2 palace unavailable (daemon unreachable, palace missing, etc.)
64 bad args (argparse default)
Tests: 30 new test cases in tests/test_cli_json.py covering each
command's JSON shape, exit codes, the TTY-default-to-quiet behavior,
and parser acceptance of --json/-j/--quiet/-q pre- and
post-subcommand.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 3a73aca commit 25ed900
2 files changed
Lines changed: 883 additions & 4 deletions
0 commit comments