Enhancement Category
CLI commands/flags
Problem or Use Case
When using the conversation show subcommand, the output is currently formatted for human readability. However, users who want to:
- Post-process conversation data with other tools
- Export conversations to different formats
- Analyze conversation patterns programmatically
- Integrate CPE conversation history into other workflows
...cannot easily do so because there's no machine-readable output format.
Proposed Solution
Add a --json or -j flag to the conversation show subcommand that outputs the conversation in JSON format.
Example usage:
# Output conversation in JSON format
cpe conversation show <message_id> --json
# Pipe to jq for processing
cpe conversation show <message_id> --json | jq '.messages[] | select(.role == "assistant")'
# Save to file for external processing
cpe conversation show <message_id> --json > conversation.json
The JSON output should include:
- Message IDs
- Roles (user/assistant)
- Content (text and any tool calls/results)
- Timestamps
- Parent message references (for branching context)
- Model used (if available)
Alternatives Considered
- Manually parsing the current pretty-printed output (fragile, breaks on format changes)
- Directly querying the SQLite .cpeconvo database (requires knowledge of internal schema, not stable API)
Impact Scope
Everyone using CPE
Additional Context
This aligns with common CLI conventions where tools provide --json flags for machine-readable output (e.g., docker, gh, kubectl). It would make CPE more composable in scripted workflows and pipelines.
Enhancement Category
CLI commands/flags
Problem or Use Case
When using the
conversation showsubcommand, the output is currently formatted for human readability. However, users who want to:...cannot easily do so because there's no machine-readable output format.
Proposed Solution
Add a
--jsonor-jflag to theconversation showsubcommand that outputs the conversation in JSON format.Example usage:
The JSON output should include:
Alternatives Considered
Impact Scope
Everyone using CPE
Additional Context
This aligns with common CLI conventions where tools provide
--jsonflags for machine-readable output (e.g.,docker,gh,kubectl). It would make CPE more composable in scripted workflows and pipelines.