{"record":{"id":"e9e6ace581d15d54","repo":"clockworklabs/SpacetimeDB","slug":"invalid-subcommand-unknown-e9e6ac","errorCode":null,"errorMessage":"Invalid subcommand: {unknown}","messagePattern":"Invalid subcommand: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/subcommands/login.rs","lineNumber":91,"sourceCode":"            Err(_) => println!(\"Token saved.\"),\n        }\n        return Ok(());\n    }\n\n    if let Some(server) = server_issued_login {\n        let host = Url::parse(&config.get_host_url(Some(server))?)?;\n        spacetimedb_login_and_save(&mut config, &host, true, open_browser).await?;\n    } else {\n        spacetimedb_login_and_save(&mut config, &host, false, open_browser).await?;\n    }\n\n    Ok(())\n}\n\nasync fn exec_subcommand(config: Config, cmd: &str, args: &ArgMatches) -> Result<(), anyhow::Error> {\n    match cmd {\n        \"show\" => exec_show(config, args).await,\n        unknown => Err(anyhow::anyhow!(\"Invalid subcommand: {unknown}\")),\n    }\n}\n\nasync fn exec_show(config: Config, args: &ArgMatches) -> Result<(), anyhow::Error> {\n    let include_token = args.get_flag(\"token\");\n\n    let token = if let Some(token) = config.spacetimedb_token() {\n        token\n    } else {\n        println!(\"You are not logged in. Run `spacetime login` to log in.\");\n        return Ok(());\n    };\n\n    let identity = decode_identity(token)?;\n    println!(\"You are logged in as {identity}\");\n\n    if include_token {\n        println!(\"Your auth token (don't share this!) is {token}\");","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/subcommands/login.rs#L73-L109","documentation":"`spacetime login` accepts only the `show` subcommand (plus bare invocation to perform the login). Any other first argument falls through the match in exec_subcommand and is rejected as invalid (login.rs:91).","triggerScenarios":"Running `spacetime login logout`, `spacetime login whoami`, `spacetime login status`, or any other word after `login` that is not `show`.","commonSituations":"Assuming `spacetime login logout` mirrors the top-level `spacetime logout`; guessing subcommands by analogy with other CLIs; tab-completion gaps.","solutions":["Use the top-level `spacetime logout` to log out","Use `spacetime login show` (optionally `--token`) to display the current identity and token","Run `spacetime login --help` to see the accepted forms before guessing"],"exampleFix":"// before\nspacetime login logout\n// after\nspacetime logout","handlingStrategy":"validation","validationCode":"sub=\"${1:-}\"\nif [[ -n \"$sub\" && \"$sub\" != show ]]; then\n  echo \"unknown subcommand: $sub (accepted: show)\" >&2; exit 2\nfi\nspacetime login \"$@\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `spacetime <cmd> --help` to list valid subcommands","Remember logout is top-level: `spacetime logout`"],"tags":["cli","login","unknown-subcommand"],"backgroundTag":"unknown-subcommand","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}