MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / gateway_remove

Function gateway_remove

crates/openshell-cli/src/run.rs:1500–1523  ·  view source on GitHub ↗

Remove a local gateway registration without touching the gateway service.

(name: &str)

Source from the content-addressed store, hash-verified

1498
1499/// Remove a local gateway registration without touching the gateway service.
1500pub fn gateway_remove(name: &str) -> Result<()> {
1501 match gateway_metadata_source(name)? {
1502 Some(GatewayMetadataSource::User) => {}
1503 Some(GatewayMetadataSource::System) => {
1504 return Err(miette::miette!(
1505 "Gateway registration '{name}' is installed by the system and cannot be removed from user config.\n\
1506 Register a per-user gateway with the same name to override it, or select another gateway."
1507 ));
1508 }
1509 None => {
1510 return Err(miette::miette!(
1511 "No gateway metadata found for '{name}'.\n\
1512 List available gateways: openshell gateway select"
1513 ));
1514 }
1515 }
1516
1517 remove_gateway_registration(name);
1518 eprintln!(
1519 "{} Gateway registration '{name}' removed.",
1520 "✓".green().bold()
1521 );
1522 Ok(())
1523}
1524
1525/// Show gateway registration details.
1526pub fn gateway_admin_info(name: &str) -> Result<()> {

Callers 1

mainFunction · 0.85

Calls 2

gateway_metadata_sourceFunction · 0.85

Tested by

no test coverage detected