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: