feat(context): add JSON output format support to all agents context commands #7532

Open
opened 2026-04-10 21:37:12 +00:00 by HAL9000 · 1 comment
Owner

Background

Part of Epic #5168 (Context CLI Commands). All agents context subcommands (list, add, show, clear, inspect) need to support --format json output in addition to the default Rich table output. This enables scripting and programmatic consumption of context data.

Expected Behavior

All agents context commands accept a --format flag with values table (default) and json. When --format json is passed, output is valid JSON to stdout with no Rich formatting.

Acceptance Criteria

  • agents context list --format json outputs a JSON array of context configurations
  • agents context show --format json outputs a JSON object with assembled context
  • agents context inspect --format json outputs a JSON object with tier statistics
  • agents context add and agents context clear output a JSON status object when --format json is passed
  • JSON output is valid and parseable by jq
  • Default behavior (no --format flag) unchanged — Rich table output
  • Pyright strict mode passes
  • nox -s lint passes

Metadata

  • Branch: feat/v3.4.0/context-cli-json-output
  • Commit Message: feat(context): add --format json support to all agents context commands
  • Milestone: v3.4.0
  • Parent Epic: #5168

Subtasks

  • Add OutputFormat enum (table, json) to context CLI module
  • Add --format option to all 5 context subcommands
  • Implement JSON serialization for context list response
  • Implement JSON serialization for context show response
  • Implement JSON serialization for context inspect response
  • Implement JSON status response for context add and context clear
  • Write Behave scenarios for JSON output format
  • Update CLI reference documentation

Definition of Done

  • All subtasks completed
  • All Behave scenarios pass
  • nox passes with coverage >= 97%
  • JSON output validated against schema

Automated by CleverAgents Bot
Supervisor: Epic Planner | Agent: epic-planning-pool-supervisor

## Background Part of Epic #5168 (Context CLI Commands). All `agents context` subcommands (`list`, `add`, `show`, `clear`, `inspect`) need to support `--format json` output in addition to the default Rich table output. This enables scripting and programmatic consumption of context data. ## Expected Behavior All `agents context` commands accept a `--format` flag with values `table` (default) and `json`. When `--format json` is passed, output is valid JSON to stdout with no Rich formatting. ## Acceptance Criteria - [ ] `agents context list --format json` outputs a JSON array of context configurations - [ ] `agents context show --format json` outputs a JSON object with assembled context - [ ] `agents context inspect --format json` outputs a JSON object with tier statistics - [ ] `agents context add` and `agents context clear` output a JSON status object when `--format json` is passed - [ ] JSON output is valid and parseable by `jq` - [ ] Default behavior (no `--format` flag) unchanged — Rich table output - [ ] Pyright strict mode passes - [ ] `nox -s lint` passes ## Metadata - **Branch**: `feat/v3.4.0/context-cli-json-output` - **Commit Message**: `feat(context): add --format json support to all agents context commands` - **Milestone**: v3.4.0 - **Parent Epic**: #5168 ## Subtasks - [ ] Add `OutputFormat` enum (`table`, `json`) to context CLI module - [ ] Add `--format` option to all 5 context subcommands - [ ] Implement JSON serialization for `context list` response - [ ] Implement JSON serialization for `context show` response - [ ] Implement JSON serialization for `context inspect` response - [ ] Implement JSON status response for `context add` and `context clear` - [ ] Write Behave scenarios for JSON output format - [ ] Update CLI reference documentation ## Definition of Done - [ ] All subtasks completed - [ ] All Behave scenarios pass - [ ] `nox` passes with coverage >= 97% - [ ] JSON output validated against schema --- **Automated by CleverAgents Bot** Supervisor: Epic Planner | Agent: epic-planning-pool-supervisor
HAL9000 added this to the v3.4.0 milestone 2026-04-10 21:37:12 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — JSON output format for context commands. Part of Epic #5168. Improves scripting and automation.
  • Milestone: v3.4.0 (M5: ACMS v1) — Context CLI feature for ACMS v1
  • Story Points: 2 (S) — Output format addition, well-defined scope
  • MoSCoW: Should Have — Useful for automation but not blocking core functionality

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — JSON output format for context commands. Part of Epic #5168. Improves scripting and automation. - **Milestone**: v3.4.0 (M5: ACMS v1) — Context CLI feature for ACMS v1 - **Story Points**: 2 (S) — Output format addition, well-defined scope - **MoSCoW**: Should Have — Useful for automation but not blocking core functionality --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#7532
No description provided.