{"record":{"id":"27def51d0d3a9ae4","repo":"clockworklabs/SpacetimeDB","slug":"invalid-subcommand-unknown-27def5","errorCode":null,"errorMessage":"Invalid subcommand: {unknown}","messagePattern":"Invalid subcommand: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/subcommands/server.rs","lineNumber":137,"sourceCode":"    exec_subcommand(config, paths, cmd, subcommand_args).await\n}\n\nasync fn exec_subcommand(\n    config: Config,\n    paths: &SpacetimePaths,\n    cmd: &str,\n    args: &ArgMatches,\n) -> Result<(), anyhow::Error> {\n    match cmd {\n        \"list\" => exec_list(config, args).await,\n        \"set-default\" => exec_set_default(config, args).await,\n        \"add\" => exec_add(config, args).await,\n        \"remove\" => exec_remove(config, args).await,\n        \"fingerprint\" => exec_fingerprint(config, args).await,\n        \"ping\" => exec_ping(config, args).await,\n        \"edit\" => exec_edit(config, args).await,\n        \"clear\" => exec_clear(config, paths, args).await,\n        unknown => Err(anyhow::anyhow!(\"Invalid subcommand: {unknown}\")),\n    }\n}\n\n#[derive(Tabled)]\n#[tabled(rename_all = \"UPPERCASE\")]\nstruct LsRow {\n    default: String,\n    hostname: String,\n    protocol: String,\n    nickname: String,\n}\n\npub async fn exec_list(config: Config, _args: &ArgMatches) -> Result<(), anyhow::Error> {\n    let mut rows: Vec<LsRow> = Vec::new();\n    for server_config in config.server_configs() {\n        let default = if let Some(default_name) = config.default_server_name() {\n            server_config.nick_or_host_or_url_is(default_name)\n        } else {","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/subcommands/server.rs#L119-L155","documentation":"`exec` in the server subcommand module dispatches on the subcommand string (`list`, `set-default`, `add`, `remove`, `fingerprint`, `ping`, `edit`, `clear`). An unrecognized token falls into the `unknown` catch-all arm and is returned verbatim in this error. Clap normally rejects unknown subcommands earlier, so this arm mainly fires when the dispatch is reached programmatically or argument parsing was bypassed.","triggerScenarios":"Invoking the internal dispatch with an arbitrary string, a typo that slips past clap's validation layer, or a new subcommand name that exists in the CLI spec but not in this match arm (version drift between the parser definition and this dispatcher).","commonSituations":"Running a newer/older CLI binary where the subcommand table is out of sync; scripts calling `spacetime server <typo>`; shell aliases mangling the subcommand token.","solutions":["Run `spacetime server --help` and use one of the listed subcommands exactly","Check for typos in the subcommand token","If you expected the subcommand to exist, update the CLI (`spacetime update`) — the parser and dispatcher may be from different versions"],"exampleFix":"# before\nspacetime server ls\n# after\nspacetime server list","handlingStrategy":"validation","validationCode":"# Validate the subcommand token before invoking\n[[ \" list set-default add remove fingerprint ping edit clear \" == *\" $1 \"* ]] || { echo \"unknown: $1\"; exit 2; }\nspacetime server \"$@\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate commands from a fixed list of known subcommands in scripts","Run `spacetime server --help` after CLI updates to see current subcommands","Avoid string-mangling subcommand tokens through aliases"],"tags":["spacetimedb","cli","invalid-subcommand","server-config"],"backgroundTag":"invalid-cli-subcommand","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}