gitbutlerapp/gitbutler · error

Human input required - run this in a terminal, or specify --

Error message

Human input required - run this in a terminal, or specify --path/--detect to avoid interactive prompts.

What it means

Even when stdout is human-readable, `but skill install` needs interactive stdin to present its scope/directory prompts. prompt_for_install_path checks out.can_prompt() and aborts when stdin is closed or redirected, rather than hanging on a prompt nobody can answer.

Source

Thrown at crates/but/src/command/skill/mod.rs:880

        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 {
        false
    };

    let mut input = out
        .prepare_for_terminal_input()

View on GitHub (pinned to caf1f223d3)

Solutions

  1. Pass --path or --detect to skip the prompts entirely
  2. Run from a fully interactive terminal (both stdin and stdout attached)
  3. Fix the harness to keep stdin a TTY (e.g. docker run -it)

Example fix

$ but skill install < /dev/null              # fails: cannot prompt
$ but skill install --detect                 # no prompt needed
Defensive patterns

Strategy: validation

Validate before calling

use std::io::IsTerminal;
// before invoking interactively-dependent commands:
if !std::io::stdin().is_terminal() {
    cmd.args(["--path", dir]); // or --detect
}

Prevention

When it happens

Trigger: `but skill install < /dev/null`, `echo | but skill install`, CI runners that allocate a TTY for stdout only, or harnesses closing stdin while leaving stdout attached.

Common situations: Cron jobs, agent-driven sessions with redirected stdin, `docker exec` without -t, piping input into commands by habit.

Related errors


AI-assisted analysis of gitbutlerapp/gitbutler@caf1f223d3 (2026-08-20). Data as JSON: /api/errors/26848d2eba362636. Report an issue: GitHub.