US-1: Single-Command JSON Output (NDJSON)
Parent Epic: #3 (JSON Formatter & Event Schema)
As a developer integrating Cortex into a CI/CD pipeline or another tool,
I want to run cortex "analyze this file" --json and get structured JSON output,
so that I can parse and route the response programmatically.
Acceptance Criteria
Technical Notes
- Implements the core --json argparse flag (nargs="?" with const="ndjson")
- JsonFormatter handles the NDJSON envelope
- Rich Console.print() skipped when json_mode is set
- agent.run() accepts json_mode param, returns JSON string
US-1: Single-Command JSON Output (NDJSON)
Parent Epic: #3 (JSON Formatter & Event Schema)
As a developer integrating Cortex into a CI/CD pipeline or another tool,
I want to run
cortex "analyze this file" --jsonand get structured JSON output,so that I can parse and route the response programmatically.
Acceptance Criteria
cortex "refactor main.ts" --jsonproduces NDJSON on stdoutsession_start, last event issayecho "analyze main.ts" | cortex --jsonTechnical Notes