From dec177a499bfc997aaa34fd029311b0769bcc7e3 Mon Sep 17 00:00:00 2001 From: "Brent E. Edwards" Date: Thu, 2 Apr 2026 08:25:45 +0000 Subject: [PATCH] fix(cli): add -u short form to lsp add --update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the missing `-u` short-form alias for the `--update` option on the `lsp add` command, aligning the implementation with the specification (spec line 8645: `agents lsp add [--update|-u] (--config|-c) `). The Typer option declaration in `lsp.py` now includes `"-u"` alongside `"--update"`. A new Behave scenario ("Add LSP server with -u short form overwrites existing") and its step definition verify the short form works end-to-end through the CLI runner. No conflicts exist — `-u` was not claimed by any other option on `lsp add` (existing short forms: `-c` for `--config`, `-f` for `--format`). ISSUES CLOSED: #912 --- features/lsp_cli_new_coverage.feature | 8 ++++++++ features/steps/lsp_cli_new_coverage_steps.py | 7 +++++++ src/cleveragents/cli/commands/lsp.py | 1 + 3 files changed, 16 insertions(+) diff --git a/features/lsp_cli_new_coverage.feature b/features/lsp_cli_new_coverage.feature index 82510b8d9..6e87465fa 100644 --- a/features/lsp_cli_new_coverage.feature +++ b/features/lsp_cli_new_coverage.feature @@ -39,6 +39,14 @@ Feature: LSP CLI commands coverage Then the lsp CLI command should succeed And the lsp CLI output should contain "LSP Server Registered" + @lsp_cli_add + Scenario: Add LSP server with -u short form overwrites existing + Given a valid LSP server YAML config file + And the LSP server has been registered via CLI + When I run lsp CLI add with --config and -u short form + Then the lsp CLI command should succeed + And the lsp CLI output should contain "LSP Server Registered" + @lsp_cli_add Scenario: Add LSP server with --format json Given a valid LSP server YAML config file diff --git a/features/steps/lsp_cli_new_coverage_steps.py b/features/steps/lsp_cli_new_coverage_steps.py index 5759ed989..a1f944498 100644 --- a/features/steps/lsp_cli_new_coverage_steps.py +++ b/features/steps/lsp_cli_new_coverage_steps.py @@ -218,6 +218,13 @@ def step_run_lsp_add_update(context: Context) -> None: ) +@when("I run lsp CLI add with --config and -u short form") +def step_run_lsp_add_u_short(context: Context) -> None: + context.lsp_cli_result = _runner.invoke( + app, ["add", "--config", context.lsp_yaml_path, "-u"] + ) + + @when("I run lsp CLI add with --config and --format json") def step_run_lsp_add_json(context: Context) -> None: context.lsp_cli_result = _runner.invoke( diff --git a/src/cleveragents/cli/commands/lsp.py b/src/cleveragents/cli/commands/lsp.py index 221dc91fe..a620a0fca 100644 --- a/src/cleveragents/cli/commands/lsp.py +++ b/src/cleveragents/cli/commands/lsp.py @@ -122,6 +122,7 @@ def add( bool, typer.Option( "--update", + "-u", help="Allow overwriting an existing LSP server registration", ), ] = False,