feat(cli): add --output json flag to run command#31
feat(cli): add --output json flag to run command#31Jdubin1417 wants to merge 1 commit intojamjet-labs:mainfrom
Conversation
Adds a new --output option to the 'jamjet run' command that accepts either 'text' (default, human-readable) or 'json' (machine-readable). When --output json is specified: - Suppresses all Rich console output - Always follows execution to completion - Outputs a JSON object with: - execution_id: the execution identifier - final_state: the complete execution state at completion - steps_executed: count of nodes that started - total_duration_us: wall-clock duration in microseconds - events: full list of per-step events This enables easy integration into CI pipelines and scripting.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdded Changes
Sequence DiagramsequenceDiagram
participant User
participant CLI as CLI Handler
participant Executor as Execution Engine
participant EventAPI as Events API
participant Output as JSON Output
User->>CLI: jamjet run --output json
CLI->>CLI: Validate output format
CLI->>Executor: Start execution
Executor->>Executor: Run workflow steps
Note over Executor: Track wall-clock time
Executor-->>CLI: Execution completes
CLI->>EventAPI: get_events(exec_id)
EventAPI-->>CLI: Return event list
CLI->>CLI: Count node_started events
CLI->>CLI: Calculate total_duration_us
CLI->>Output: Format JSON object
Output->>User: Print structured JSON
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
Adds a
--output json/-o jsonflag to thejamjet runCLI command, enabling machine-readable output for scripting and CI pipelines.Fixes #7
Changes
--outputoption acceptingtext(default) orjsonexecution_id,final_state,steps_executed,total_duration_us,events--output jsonfor clean stdout--no-follow)Example
Output Schema
{ "execution_id": "exec_abc123", "final_state": { ... }, "steps_executed": 5, "total_duration_us": 1234567, "events": [ ... ] }Testing
--help--outputvalues rejected with clear errorDisclosure: This contribution was developed with AI assistance (Claude via OpenClaw).
Summary by CodeRabbit
--output(or-o) CLI option to select output format:textfor human-readable (default) orjsonfor machine-readable results