Skip to main content

run_shell_command

Function run_shell_command 

Source
pub async fn run_shell_command(
    env: &dyn ExecutionEnv,
    command: &str,
    cwd: &str,
    options: &ShellRunOptions,
    on_chunk: &mut (dyn FnMut(&str) + Send),
    cancel: &CancellationToken,
) -> Result<BashOutcome, ShellRunError>
Expand description

Runs a user !cmd (executeBash): the configured shell, the process environment with <agent_dir>/bin on PATH, sanitised streaming chunks via on_chunk, a rolling buffer and a temp file for long output. Cancelling kills the process tree and returns the output so far with cancelled: true.

ยงErrors

The command could not run (missing working directory, shell not found, spawn failure).