6 Commits

Author SHA1 Message Date
HAL9000 d55e610f90 test(plugin-cli): expand BDD tests to cover all happy paths and long-description truncation
Add mock-based @given steps and 14 new scenarios covering the rich
table list, show, enable, disable, remove happy paths, the abort
confirmation flow, and the description truncation branch
(plugin.py:134). The @when step now patches _get_plugin_manager via
context so PluginManager isolation works without a singleton.

ISSUES CLOSED: #5756
2026-06-15 06:36:16 -04:00
HAL9000 2b969c1994 fix(plugins): register plugin CLI subcommand in main.py and fix lint/test issues
- Register plugin command in CLI main.py imports and add_typer calls
- Add plugin to valid_cmds list in main() to prevent "Invalid command" error
- Remove unused PluginNotFoundError import from plugin.py (F401 lint fix)
- Fix line too long in plugin.py _print_plugin function (E501 lint fix)
- Fix list_plugins to output JSON even when no plugins installed
- Remove duplicate step definitions from plugin_cli_steps.py that conflicted
  with existing steps (I run, output should contain, output should be valid JSON)
- Rewrite plugin_cli.feature to test error cases that don't require pre-registered
  plugins (since PluginManager is not a singleton across CLI invocations)
2026-06-15 06:36:16 -04:00
HAL9000 14f134a463 feat(plugins): implement agents plugin CLI subcommand group and built-in plugin discovery
- Implement plugin CLI subcommand group with list, show, enable, disable, install, remove commands
- Add JSON/YAML output format support for all plugin commands
- Create Behave BDD tests for plugin CLI functionality
- Full type annotations and pyright compliance
- Supports plugin state management (ACTIVATED, DEACTIVATED, DISCOVERED, ERRORED)

Closes #5756
2026-06-15 06:36:16 -04:00
HAL9000 f1ad838270 fix(coverage): delete stale output.py and add BDD coverage for all format branches
CI / lint (pull_request) Successful in 42s
CI / build (pull_request) Successful in 1m8s
CI / quality (pull_request) Successful in 1m11s
CI / helm (pull_request) Successful in 56s
CI / security (pull_request) Successful in 1m30s
CI / typecheck (pull_request) Successful in 2m6s
CI / push-validation (pull_request) Successful in 25s
CI / unit_tests (pull_request) Successful in 5m52s
CI / docker (pull_request) Successful in 1m44s
CI / integration_tests (pull_request) Successful in 10m13s
CI / coverage (pull_request) Successful in 10m14s
CI / status-check (pull_request) Successful in 4s
The stale `src/cleveragents/cli/output.py` file (391 lines) was added by
this PR alongside the existing `output/` package. Python silently uses the
package, leaving output.py permanently unreachable and at 0% coverage,
which dragged the project total below the 96.5% threshold.

Additionally, the json/yaml/plain format branches in
`_cli_output_manager.py` had no BDD test coverage. The existing table
scenarios also set the output format after calling display_table(), so
the non-rich branches were never exercised.

Fixes:
- Delete src/cleveragents/cli/output.py (unreachable stale module)
- Add 18 BDD scenarios covering json/yaml/plain format branches for all
  display functions: success, warning, info, error panel, success panel,
  table, handle_exception
- Add step defs for CLIOutputManager instance method calls
- Fix scenario ordering: output format set before display calls

ISSUES CLOSED: #10655
2026-06-06 00:56:05 -04:00
HAL9000 cf9ec83374 fix(cli): add CLIOutputManager and helper functions to output module
Resolves ImportError in cli_error_handling_steps.py by implementing the CLIOutputManager class and display_* helper functions that were referenced in BDD tests but missing from the output package.

Also fixes duplicate step definitions that conflicted with existing cli_output_formats_steps.py by renaming the ambiguous steps.
2026-06-06 00:56:05 -04:00
HAL9000 949a5a655b refactor(cli): unify error handling and user feedback across CLI commands
- Create centralized CLIOutputManager class for consistent error handling
- Implement unified error display with debug flag support
- Add display helpers for success, warning, info, panels, and tables
- Support all output formats (rich, color, table, plain, json, yaml)
- Stack traces only shown when --debug flag is enabled
- Add comprehensive BDD tests for error handling scenarios
- Ensure consistent styling and iconography across all CLI commands
2026-06-06 00:56:05 -04:00