{"record":{"id":"e2dac3e851576e80","repo":"aaif-goose/goose","slug":"failed-to-run-gh-auth-status-make-sure-you-have","errorCode":null,"errorMessage":"Failed to run `gh auth status`. Make sure you have `gh` installed.","messagePattern":"Failed to run `gh auth status`\\. Make sure you have `gh` installed\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/goose-cli/src/recipes/github_recipe.rs","lineNumber":112,"sourceCode":"        download_dir.display(),\n        RECIPE_FILE_EXTENSIONS\n    ))\n}\n\nfn clone_and_download_recipe(recipe_name: &str, recipe_repo_full_name: &str) -> Result<PathBuf> {\n    let local_repo_path = ensure_repo_cloned(recipe_repo_full_name)?;\n    fetch_origin(&local_repo_path)?;\n    get_folder_from_github(&local_repo_path, recipe_name)\n}\n\npub fn ensure_gh_authenticated() -> Result<()> {\n    // Check authentication status\n    let status = Command::new(\"gh\")\n        .args([\"auth\", \"status\"])\n        .set_no_window()\n        .status()\n        .map_err(|_| {\n            anyhow::anyhow!(\"Failed to run `gh auth status`. Make sure you have `gh` installed.\")\n        })?;\n\n    if status.success() {\n        return Ok(());\n    }\n    println!(\"GitHub CLI is not authenticated. Launching `gh auth login`...\");\n    // Run `gh auth login` interactively\n    let login_status = Command::new(\"gh\")\n        .args([\"auth\", \"login\", \"--git-protocol\", \"https\"])\n        .status()\n        .map_err(|_| anyhow::anyhow!(\"Failed to run `gh auth login`\"))?;\n\n    if !login_status.success() {\n        Err(anyhow::anyhow!(\"Failed to authenticate using GitHub CLI.\"))\n    } else {\n        Ok(())\n    }\n}","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose-cli/src/recipes/github_recipe.rs#L94-L130","documentation":"goose shells out to the GitHub CLI (`gh auth status`) to verify authentication before touching recipe repos (crates/goose-cli/src/recipes/github_recipe.rs:105-113). Command::status() returns an io::Error when the `gh` process cannot even be spawned, and that io error is discarded and replaced by this message. It does NOT mean authentication failed — it means `gh` was never executed.","triggerScenarios":"std::process::Command::new(\"gh\").status() fails: no `gh` binary in PATH (ErrorKind::NotFound), exec permission denied, or exec format error. Triggered by any GitHub-recipe flow (run/list with GOOSE_RECIPE_GITHUB_REPO set).","commonSituations":"Fresh machine without GitHub CLI installed, `gh` installed via Homebrew but in a non-interactive shell PATH (cron, CI, launchd), or a broken gh installation (partial upgrade, wrong architecture binary).","solutions":["Install GitHub CLI: `brew install gh` (macOS), `winget install GitHub.cli` (Windows), or see cli.github.com; then restart the shell so PATH picks it up","Verify with `command -v gh && gh --version` in the same environment goose runs in (especially CI/cron where PATH differs)","If gh is installed but not found, add its install location to PATH or invoke goose from a shell where `gh` resolves"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Pre-flight check in the same shell/environment goose will use\ncommand -v gh >/dev/null 2>&1 && gh auth status >/dev/null 2>&1 \\\n  && echo \"gh ready\" || echo \"install gh and authenticate\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install GitHub CLI and re-hash PATH (restart shell) before goose sessions that use GitHub recipes","In CI, add an explicit setup-gh step and run `gh auth status` before invoking goose","Avoid static-message masking in your own code: keep the underlying io::Error in the message"],"tags":["goose-cli","github-cli","path","external-tool"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}