Files
cleveragents-core/features/cli_output_formats.feature
T
freemo 48cff5cfe0
CI / build (push) Successful in 18s
CI / lint (push) Failing after 31s
CI / helm (push) Successful in 33s
CI / typecheck (push) Successful in 50s
CI / security (push) Failing after 51s
CI / coverage (push) Has been skipped
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Failing after 1m50s
CI / docker (push) Has been skipped
CI / quality (push) Successful in 3m43s
CI / integration_tests (push) Has been cancelled
CI / e2e_tests (push) Has been cancelled
CI / benchmark-publish (push) Has been cancelled
CI / status-check (push) Has been cancelled
refactor(cli): rename plan lifecycle-list and lifecycle-apply to match specification
Renames `plan lifecycle-list` to `plan list` and `plan lifecycle-apply` to `plan apply` to align with the specification's canonical command names. Removes legacy V2 plan commands that occupied those names.

- Renamed CLI command registrations from lifecycle-list/lifecycle-apply to list/apply
- Removed legacy V2 apply and list commands (~200 lines)
- Updated apply shortcut in main.py to delegate to v3 lifecycle
- Added defensive null check for plan existence in apply command
- Updated 63+ test, doc, and benchmark files for consistency

Closes #881

Co-authored-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
Co-committed-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
2026-04-02 19:09:04 +00:00

114 lines
4.6 KiB
Gherkin

Feature: CLI output formats parity
As a developer using the CleverAgents CLI
I want all action and plan commands to support --format json|yaml|plain|table|rich
So that I can integrate CLI output with external tooling
Background:
Given a CLI output format test runner
And a mocked lifecycle service for format tests
# Action list --format json
Scenario: Action list outputs valid JSON
Given there are actions for format testing
When I run action list with --format json
Then the output should be valid JSON
And the JSON should contain key "namespaced_name"
# Action show --format yaml
Scenario: Action show outputs valid YAML
Given there is a single action for format testing
When I run action show with --format yaml
Then the output should be valid YAML
And the YAML should contain key "namespaced_name"
# Plan list --format json
Scenario: Plan list outputs valid JSON
Given there are plans for format testing
When I run plan list with --format json
Then the output should be valid JSON
And the JSON should contain key "plan_id"
# Plan status --format json (single plan)
Scenario: Plan status single plan outputs valid JSON
Given there is a single plan for format testing
When I run plan status with plan id and --format json
Then the output should be valid JSON
And the JSON should contain key "processing_state"
# Plan status --format plain (single plan)
Scenario: Plan status single plan outputs plain text
Given there is a single plan for format testing
When I run plan status with plan id and --format plain
Then the format output should contain "plan_id:"
And the format output should contain "processing_state:"
# Action list --format table
Scenario: Action list outputs table format
Given there are actions for format testing
When I run action list with --format table
Then the format output should contain "namespaced_name"
# Action list --format plain
Scenario: Action list outputs plain format
Given there are actions for format testing
When I run action list with --format plain
Then the format output should contain "namespaced_name:"
# Action archive --format json
Scenario: Action archive outputs valid JSON
Given there is an archivable action for format testing
When I run action archive with --format json
Then the output should be valid JSON
And the JSON should contain key "archived"
# Plan status list all --format json
Scenario: Plan status no args outputs valid JSON for list
Given there are plans for format status listing
When I run plan status without id and --format json
Then the output should be valid JSON
And the JSON should contain key "plan_id"
# Plan use --format json
Scenario: Plan use outputs valid JSON
Given there is an action for plan use format test
When I run plan use with --format json
Then the output should be valid JSON
And the JSON should contain key "plan_id"
# Plan cancel --format json
Scenario: Plan cancel outputs valid JSON
Given there is a plan for cancel format test
When I run plan cancel with --format json
Then the output should be valid JSON
And the JSON should contain key "processing_state"
# Format consistency: same data, different renders
Scenario: JSON and YAML contain the same action keys
Given there is a single action for format testing
When I run action show with --format json
And I save the output keys as json_keys
And I run action show with --format yaml
And I save the output keys as yaml_keys
Then json_keys and yaml_keys should match
# Direct formatting module tests
Scenario: Format output handles all format types for dict
When I call format_output with a dict and format json
Then the format result should be valid JSON dict
When I call format_output with a dict and format yaml
Then the format result should be valid YAML dict
When I call format_output with a dict and format plain
Then the format result should contain plain key-value pairs
When I call format_output with a dict and format table
Then the format result should contain table output
When I call format_output with a dict and format rich
Then the format result should be valid JSON dict
Scenario: Format output handles list data
When I call format_output with a list and format plain
Then the format result should contain separator lines
Scenario: Serialize value handles enums and nested dicts
When I call serialize_value with enum and nested data
Then the serialized result should have string enum values