forked from cleveragents/cleveragents-core
48cff5cfe0
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>
55 lines
2.9 KiB
Gherkin
55 lines
2.9 KiB
Gherkin
Feature: CLI main shortcuts and exit handling coverage
|
|
As a developer
|
|
I want to ensure CLI shortcuts delegate correctly and main handles Typer results
|
|
So that uncovered branches in cleveragents.cli.main are exercised
|
|
|
|
Scenario: Shortcut "tell" delegates to plan tell with provided prompt and name
|
|
When I execute the CLI shortcut "tell" with argument list ["Draft spec", "--name", "alpha"]
|
|
Then the shortcut should exit with code 0
|
|
And the shortcut should forward keyword arguments {"prompt": "Draft spec", "name": "alpha", "stream": False}
|
|
|
|
Scenario: Shortcut "build" delegates to plan build with verbose flag
|
|
When I execute the CLI shortcut "build" with argument list ["--verbose"]
|
|
Then the shortcut should exit with code 0
|
|
And the shortcut should forward keyword arguments {"verbose": True}
|
|
|
|
Scenario: Shortcut "apply" delegates to plan apply with yes confirmation
|
|
When I execute the CLI shortcut "apply" with argument list ["-y"]
|
|
Then the shortcut should exit with code 0
|
|
And the shortcut should forward keyword arguments {"plan_id": None, "yes": True}
|
|
|
|
Scenario: Shortcut "context-load" delegates to context add with explicit paths
|
|
When I execute the CLI shortcut "context-load" with argument list ["readme.md", "src/main.py", "--no-recursive"]
|
|
Then the shortcut should exit with code 0
|
|
And the shortcut should forward keyword arguments {"paths": ["readme.md", "src/main.py"], "recursive": False}
|
|
|
|
Scenario: Shortcut "context-add" reuses context add shortcut logic
|
|
When I execute the CLI shortcut "context-add" with argument list ["notes.txt"]
|
|
Then the shortcut should exit with code 0
|
|
And the shortcut should forward keyword arguments {"paths": ["notes.txt"], "recursive": True}
|
|
|
|
Scenario: main converts Typer Exit return into exit code
|
|
When I execute main with stubbed return "exit" and value 7
|
|
Then main should return 7
|
|
And the Typer app should have received ["--help"] with standalone mode disabled
|
|
|
|
Scenario: main treats Typer Abort return as failure
|
|
When I execute main with stubbed return "abort" and value 0
|
|
Then main should return 1
|
|
And the Typer app should have received ["--help"] with standalone mode disabled
|
|
|
|
Scenario: main converts integer return to exit code
|
|
When I execute main with stubbed return "integer" and value 42
|
|
Then main should return 42
|
|
And the Typer app should have received ["--help"] with standalone mode disabled
|
|
|
|
Scenario: main defaults to success when Typer returns None
|
|
When I execute main with stubbed return "none" and value 0
|
|
Then main should return 0
|
|
And the Typer app should have received ["--help"] with standalone mode disabled
|
|
|
|
Scenario: main handles Typer abort exception
|
|
When I execute main with stubbed return "raise_abort" and value 0
|
|
Then main should return 1
|
|
And the Typer app should have received ["--help"] with standalone mode disabled
|