gitbutlerapp/gitbutler · error
No supported agent was detected. In non-interactive mode…
Error message
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.
What it means
`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.
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.
Example fix
// before but skill install --json // error: No supported agent was detected... // after but skill install --json --path ~/.claude/skills/gitbutler
Defensive patterns
Strategy: validation
Validate before calling
# ensure a non-interactive run has an explicit target
[[ -t 0 || -n "$BUT_SKILL_PATH" ]] || BUT_SKILL_PATH=~/.claude/skills/gitbutler
but skill install ${BUT_SKILL_PATH:+--path "$BUT_SKILL_PATH"} Try / catch
but skill install --path "$DIR" 2>err.log || { grep -q 'No supported agent' err.log && but skill install --detect; } Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Scripting `but skill install --json` on a machine without a recognized agent tool; CI jobs without `--path`; automation that forgot the explicit flags.
Understand the failure class
Background: "--flag is required" and "must specify" CLI errors: how missing-required-flag validation works and how to fix it — this error's family across 20 libraries.
Related errors
- Interactive setup requires a terminal. Use `but agent setup…
- Refusing to directly update
- Refusing to directly update
- Aborting due to empty branch name
- Aborting due to empty
AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18).
Data as JSON: /api/errors/7941cbeb1d20e2fd.
Report an issue: GitHub.
Appendix: source
Thrown at crates/but/src/command/skill/mod.rs:1028
.prompt_select("Where would you like to install the skill?", &options)?
.copied()
{
Some(InstallScopeOption::Local) => Ok(InstallScope::Local),
Some(InstallScopeOption::Global) => Ok(InstallScope::Global),
None => Err(UserCancelled.into()),
}
}
/// Prompt user to select installation scope and format
fn prompt_for_install_path(
ctx: Option<&mut Context>,
global: bool,
out: &mut OutputChannel,
progress: &mut impl std::io::Write,
) -> Result<PathBuf> {
let t = theme::get();
if out.for_human().is_none() {
anyhow::bail!(
"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."
);
}
if !out.can_prompt() {
anyhow::bail!(
"Human input required - run this in a terminal, or specify --path/--detect to avoid interactive prompts."
);
}
let local_scope_available = if !global {
match ctx.as_ref() {
Some(ctx) => {
let repo = ctx.repo.get()?;
repo.workdir().is_some()
}
None => false,
}
} else {View on GitHub (pinned to 58e5313667)