{"record":{"id":"7941cbeb1d20e2fd","repo":"gitbutlerapp/gitbutler","slug":"no-supported-agent-was-detected-in-non-interactiv","errorCode":null,"errorMessage":"No supported agent was detected. In non-interactive mode, specify --path or --detect. Use --path <path> to choose an installation directory, or --detect to update an existing installation.","messagePattern":"No supported agent was detected\\. In non-interactive mode, specify --path or --detect\\. Use --path <path> to choose an installation directory, or --detect to update an existing installation\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/skill/mod.rs","lineNumber":1028,"sourceCode":"        .prompt_select(\"Where would you like to install the skill?\", &options)?\n        .copied()\n    {\n        Some(InstallScopeOption::Local) => Ok(InstallScope::Local),\n        Some(InstallScopeOption::Global) => Ok(InstallScope::Global),\n        None => Err(UserCancelled.into()),\n    }\n}\n\n/// Prompt user to select installation scope and format\nfn prompt_for_install_path(\n    ctx: Option<&mut Context>,\n    global: bool,\n    out: &mut OutputChannel,\n    progress: &mut impl std::io::Write,\n) -> Result<PathBuf> {\n    let t = theme::get();\n    if out.for_human().is_none() {\n        anyhow::bail!(\n            \"No supported agent was detected. In non-interactive mode, specify --path or --detect. Use --path <path> to choose an installation directory, or --detect to update an existing installation.\"\n        );\n    }\n    if !out.can_prompt() {\n        anyhow::bail!(\n            \"Human input required - run this in a terminal, or specify --path/--detect to avoid interactive prompts.\"\n        );\n    }\n\n    let local_scope_available = if !global {\n        match ctx.as_ref() {\n            Some(ctx) => {\n                let repo = ctx.repo.get()?;\n                repo.workdir().is_some()\n            }\n            None => false,\n        }\n    } else {","sourceCodeStart":1010,"sourceCodeEnd":1046,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/skill/mod.rs#L1010-L1046","documentation":"`prompt_for_install_path` resolves where to install skills, normally by interactively asking the user. In non-human output mode (e.g. `--json` or piped output) prompting is impossible and no agent was auto-detected, so it bails telling the user to make the choice explicit via flags.","triggerScenarios":"Running `but skill install` with non-human output (for_human() is None, e.g. JSON output) when no supported agent could be detected, and neither `--path` nor `--detect` was supplied.","commonSituations":"Scripting `but skill install --json` on a machine without a recognized agent tool; CI jobs without `--path`; automation that forgot the explicit flags.","solutions":["Pass `--path <dir>` to choose the installation directory explicitly.","Pass `--detect` to update an existing detected installation.","Run in an interactive terminal so the prompt path can be used."],"exampleFix":"// before\nbut skill install --json\n// error: No supported agent was detected...\n\n// after\nbut skill install --json --path ~/.claude/skills/gitbutler","handlingStrategy":"validation","validationCode":"# ensure a non-interactive run has an explicit target\n[[ -t 0 || -n \"$BUT_SKILL_PATH\" ]] || BUT_SKILL_PATH=~/.claude/skills/gitbutler\nbut skill install ${BUT_SKILL_PATH:+--path \"$BUT_SKILL_PATH\"}","typeGuard":null,"tryCatchPattern":"but skill install --path \"$DIR\" 2>err.log || { grep -q 'No supported agent' err.log && but skill install --detect; }","preventionTips":["In scripts/CI, always pass --path or --detect with `but skill install`.","Don't rely on agent auto-detection on machines without supported agents.","Use interactive terminals for prompted installs only."],"tags":["cli","non-interactive","missing-flag"],"backgroundTag":"missing-required-flag","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"}