-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or requestpriority-criticalCritical priority - implement firstCritical priority - implement first
Description
Summary
Add machine-parseable JSON output mode for scripting and CI/CD integration.
Why It's Needed
- CI/CD Integration: Automated pipelines can parse results
- Scripting: Chain codetyper with other tools
- Log Parsing: Structured logs instead of colored text
- Programmatic Access: Build wrappers and integrations
Usage
codetyper --format json "fix the bug"
codetyper --format jsonl "refactor this" # JSON Lines for streaming
codetyper -p --format json "explain this code" # Print mode + JSONOutput Format
{
"session_id": "abc123",
"status": "success",
"exit_code": 0,
"provider": "copilot",
"model": "gpt-5-mini",
"messages": [
{
"role": "user",
"content": "fix the bug",
"timestamp": "2024-01-27T10:30:00Z"
},
{
"role": "assistant",
"content": "I'll fix the bug in src/app.ts...",
"tool_calls": [
{
"id": "call_123",
"tool": "edit",
"input": {
"path": "src/app.ts",
"old_string": "bug",
"new_string": "fix"
},
"output": {
"success": true,
"diff": "..."
},
"duration_ms": 150
}
],
"timestamp": "2024-01-27T10:30:05Z"
}
],
"files_modified": ["src/app.ts"],
"files_created": [],
"files_deleted": [],
"tokens": {
"input": 1500,
"output": 800,
"total": 2300
},
"duration_ms": 5000
}Exit Codes
const EXIT_CODES = {
SUCCESS: 0,
GENERAL_ERROR: 1,
INVALID_ARGS: 2,
PROVIDER_ERROR: 3,
PERMISSION_DENIED: 4,
TOOL_FAILED: 5,
TIMEOUT: 6,
INTERRUPTED: 130,
}Acceptance Criteria
-
--format jsonflag for full JSON output -
--format jsonlflag for streaming JSON Lines - Proper exit codes for different error types
- No color codes in JSON mode
- Include all tool calls and results
- Include token usage
- Include timing information
- Document exit codes
Effort Estimate
1 day
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpriority-criticalCritical priority - implement firstCritical priority - implement first