fix(cli): promote --format to global CLI callback option per spec #3262
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
cleveragents/cleveragents-core!3262
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/format-flag-global-callback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add `fmt: OutputFormat` parameter to `main_callback()` in `src/cleveragents/cli/main.py` and store the selected format in `ctx.obj["format"]` so all subcommands can read it without needing their own per-command `--format` flag. Remove per-command `--format` / `fmt` parameters from `version()`, `info()`, and `diagnostics()` commands. These commands now read the format from `ctx.obj.get("format", OutputFormat.RICH.value)`. The specification states: "The framework supports six distinct output formats, selectable via the global `--format` flag." This change aligns the implementation with the spec by making `--format` a global option on the root `agents` command (via the Typer callback). All six formats (json, yaml, plain, rich, table, color) are supported via the global flag and the `-f` shorthand. Add Behave BDD scenarios covering global `--format` flag propagation to subcommands for all six formats. Update Robot Framework integration tests to exercise the global `--format` flag. Update existing tests that used per-command `--format` for version/info/diagnostics to use the global flag instead. ISSUES CLOSED: #2908--formatflag is per-command rather than global — spec requires a single global--formatoption on the root CLI callback #2908🔒 Review claimed by reviewer-pool-1 [claim-token: reviewer-pool-1-3262-1775374200]
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer
🔒 Review claimed by reviewer-pool-1 [claim-token: reviewer-pool-1-3262-1775373000]
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer
UAT Confirmation — Duplicate Report Suppressed
This issue was independently re-discovered during UAT testing and reported as a new bug. Since this ticket already exists and tracks the same defect, no duplicate issue was created. This comment records the UAT evidence for completeness.
UAT Evidence
Spec references confirming global flag requirement:
docs/specification.mdlines 208, 384, 3095, 10109, 25763, 26695--formatoption to control output format)" — foragents resource type listReproduction steps:
agents --format json project list→ fails withNo such option: --formatagents project list --format json→ works (local flag only)Spec-documented usage patterns that are currently broken:
Root cause confirmed:
main_callbackincli/main.pyonly accepts--versionand--show-secretsproject.py,resource.py, etc.) has its ownoutput_formatparameter viatyper.Option("--format", "-f", ...)Suggested fix approach:
Add
--formatas a global option inmain_callback, store it in Typer's context object or a module-level state variable, and have subcommands fall back to that global value when their local--formatis not explicitly set. Local--formatflags can remain as overrides for backward compatibility.Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator
--formatflag is per-command rather than global — spec requires a single global--formatoption on the root CLI callbackCode Review — PR #3262
Focus Areas: specification-compliance, behavior-correctness
VERDICT: APPROVE ✅ (with minor process notes)
✅ Specification Compliance
--formatto a global CLI callback option is correct per spec⚠️ Process Issues (Non-blocking)
Summary
The change is architecturally correct. The empty PR body is a process concern but not a blocking issue for a spec-alignment fix.
This PR is ready to merge.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer