From b9cff7c9cdb851e0dea0c157d4728720d31a75d6 Mon Sep 17 00:00:00 2001 From: Max Dubrinsky Date: Tue, 5 May 2026 16:59:24 -0400 Subject: [PATCH] feat(cli): add openshell gateway list subcommand Wires up a first-class `gateway list` command that calls the existing `run::gateway_list()` helper. Resolves the dead reference in `crates/openshell-bootstrap/src/errors.rs:248`, where the port-conflict recovery hint already pointed users at this command. Updates the manage-gateways doc to teach the new verb instead of the `gateway select`-with-no-arg fallback. Closes #1173 Signed-off-by: Max Dubrinsky --- crates/openshell-cli/src/main.rs | 10 ++++++++++ docs/sandboxes/manage-gateways.mdx | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/openshell-cli/src/main.rs b/crates/openshell-cli/src/main.rs index 1d060a68a7..fb4c9c1e04 100644 --- a/crates/openshell-cli/src/main.rs +++ b/crates/openshell-cli/src/main.rs @@ -1031,6 +1031,13 @@ enum GatewayCommands { #[arg(long, env = "OPENSHELL_GATEWAY", add = ArgValueCompleter::new(completers::complete_gateway_names))] name: Option, }, + + /// List registered gateways. + /// + /// Prints a table of all registered gateways with their endpoint, type, + /// and authentication mode. The active gateway is marked with `*`. + #[command(help_template = LEAF_HELP_TEMPLATE, next_help_heading = "FLAGS")] + List, } // ----------------------------------------------------------------------- @@ -1956,6 +1963,9 @@ async fn main() -> Result<()> { .unwrap_or_else(|| "openshell".to_string()); run::gateway_admin_info(&name)?; } + GatewayCommands::List => { + run::gateway_list(&cli.gateway)?; + } }, // ----------------------------------------------------------- diff --git a/docs/sandboxes/manage-gateways.mdx b/docs/sandboxes/manage-gateways.mdx index 549f13c9f2..f12f6951c2 100644 --- a/docs/sandboxes/manage-gateways.mdx +++ b/docs/sandboxes/manage-gateways.mdx @@ -161,7 +161,7 @@ One gateway is always the active gateway. All CLI commands target it by default. List all registered gateways: ```shell -openshell gateway select +openshell gateway list ``` Switch the active gateway: