{"record":{"id":"34b0f4f2d4ea5b17","repo":"Hmbown/CodeWhale","slug":"this-binary-s-login-command-does-not-store-provider-keys-use","errorCode":null,"errorMessage":"This binary's `login` command does not store provider keys. Use the `codewhale` CLI: `codewhale login` for the Codewhale account device flow, or `codewhale auth set --provider <id>` for a provider key.","messagePattern":"This binary's `login` command does not store provider keys\\. Use the `codewhale` CLI: `codewhale login` for the Codewhale account device flow, or `codewhale auth set --provider <id>` for a provider key\\.","errorType":"error_code","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":8419,"sourceCode":"/// `Config`, so copying the saved value here keeps those entry points from\n/// silently falling back to a route classifier or an older config.toml value.\nfn apply_saved_reasoning_preference(config: &mut Config, settings: &crate::settings::Settings) {\n    let Some(reasoning_effort) = settings.reasoning_effort.as_ref() else {\n        return;\n    };\n    config.reasoning_effort = Some(reasoning_effort.clone());\n    config.reasoning_effort_inferred_from_legacy_alias = false;\n}\n\nfn run_login(api_key: Option<String>) -> Result<()> {\n    if api_key.is_some() {\n        bail!(\n            \"`login --api-key` is not account sign-in. \\\n             Use `codewhale login` for the Codewhale account, \\\n             or `codewhale auth set --provider <id>` for a provider key.\"\n        );\n    }\n    bail!(\n        \"This binary's `login` command does not store provider keys. \\\n         Use the `codewhale` CLI: `codewhale login` for the Codewhale account device flow, \\\n         or `codewhale auth set --provider <id>` for a provider key.\"\n    );\n}\n\nfn run_logout() -> Result<()> {\n    config::clear_api_key()?;\n    println!(\"Cleared saved API key.\");\n    Ok(())\n}\n\nasync fn run_xai_device_auth(config_path: Option<&Path>) -> Result<()> {\n    let pending = crate::oauth::login(crate::oauth::OAuthProvider::Xai).await?;\n    let activation = crate::oauth::activate_login(pending, config_path, None)?;\n    println!(\n        \"xAI OAuth is ready; activated {} via {}\",\n        codewhale_config::quote_os_path(&activation.auth_path),","sourceCodeStart":8401,"sourceCodeEnd":8437,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lib.rs#L8401-L8437","documentation":"The TUI binary's run_login unconditionally bails: unlike the codewhale CLI, this binary cannot perform account sign-in or store provider keys at all. Every login invocation reaches one of the two bail!s, with this one covering any call that didn't pass --api-key.","triggerScenarios":"Running `login` (with or without --api-key) in the TUI binary — run_login always errors, directing the user to the codewhale CLI's device-flow login or auth set.","commonSituations":"Users trying to authenticate from inside the TUI binary because that's the only binary they installed; following CLI documentation while running the TUI binary.","solutions":["Use the `codewhale` CLI instead: `codewhale login` for device-flow account sign-in","Or `codewhale auth set --provider <id>` to store a provider key","Install the codewhale CLI if only the TUI binary is present"],"exampleFix":"// before\ncodewhale-tui login\n// after\ncodewhale login","handlingStrategy":"fallback","validationCode":"// detect TUI binary and route auth to the codewhale CLI\nif binary_name() == \"codewhale-tui\" { exec(\"codewhale\", &[\"login\"])?; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Perform all authentication via the codewhale CLI","Don't script `login` against the TUI binary"],"tags":["cli","auth","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}