{"record":{"id":"8f44ff218419e90a","repo":"gitbutlerapp/gitbutler","slug":"could-not-determine-which-forge-provider-to-authen","errorCode":null,"errorMessage":"Could not determine which forge provider to authenticate with","messagePattern":"Could not determine which forge provider to authenticate with","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/config.rs","lineNumber":866,"sourceCode":"    }\n\n    let auth_options = nonempty::nonempty![\n        (\"GitHub\", ForgeProvider::GitHub),\n        (\"GitLab\", ForgeProvider::GitLab),\n        (\"Bitbucket\", ForgeProvider::Bitbucket)\n    ];\n    let selected_option = {\n        let mut input = out\n            .prepare_for_terminal_input()\n            .context(\"Human input required - run this in a terminal\")?;\n        input\n            .prompt_select(\n                \"Select a forge provider to authenticate with\",\n                &auth_options,\n            )?\n            .cloned()\n            .ok_or_else(|| {\n                anyhow::anyhow!(\"Could not determine which forge provider to authenticate with\")\n            })?\n    };\n\n    match selected_option {\n        ForgeProvider::GitHub => github_auth(out).await,\n        ForgeProvider::GitLab => gitlab_auth(out).await,\n        ForgeProvider::Bitbucket => bitbucket_auth(out).await,\n    }\n}\n\n/// Authenticate with Bitbucket Cloud using an Atlassian API token.\nasync fn bitbucket_auth(out: &mut OutputChannel) -> Result<()> {\n    use but_bitbucket::AuthStatusResponse;\n\n    let t = theme::get();\n    let mut inout = out\n        .prepare_for_terminal_input()\n        .context(\"Human input required - run this in a terminal\")?;","sourceCodeStart":848,"sourceCodeEnd":884,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/config.rs#L848-L884","documentation":"Raised in `forge_auth` (crates/but/src/command/config.rs:866) when the interactive prompt for selecting a forge provider returns no selectable option — the user provided no selection (e.g. EOF, non-interactive stdin, or empty option list), so no provider can be chosen.","triggerScenarios":"Running the forge auth configuration flow when `input.prompt_select(...)` returns `None`: non-interactive stdin (piped/closed), user aborting the prompt, or `auth_options` being empty.","commonSituations":"Scripting `but config forge auth` without a TTY; CI environments where prompts can't render; canceling the selection dialog.","solutions":["Run the command in an interactive terminal so the provider prompt can be answered","Select one of the listed providers when prompted instead of aborting","Use a non-interactive configuration path (e.g. set forge credentials via config files or env) if no TTY is available","Ensure the provider list is populated — check your build/features if the list is unexpectedly empty"],"exampleFix":"// before\necho | but config forge auth   # prompt gets EOF -> no selection\n// after\nbut config forge auth   # run interactively and pick GitHub/GitLab","handlingStrategy":"try-catch","validationCode":"use std::io::IsTerminal;\nif !std::io::stdin().is_terminal() {\n    return Err(\"forge auth requires an interactive terminal; configure credentials non-interactively instead\");\n}","typeGuard":null,"tryCatchPattern":"match forge_auth(&mut out).await {\n    Err(e) if e.to_string().contains(\"which forge provider\") => eprintln!(\"run interactively and select a provider\"),\n    other => other,\n}","preventionTips":["Run interactive config commands only in a TTY","Check stdin is a terminal before prompting","Provide credentials via config/env for scripted environments"],"tags":["cli","authentication","interactive"],"backgroundTag":"missing-required-option","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}