run_long_command
Run long shell commands like builds, installs, or test suites and capture complete output, with configurable timeouts and regex-based early stopping.
Instructions
Run a long-running shell command and capture its full output.
Unlike monitor_command (which re-runs a command repeatedly), this runs
ONE command and streams its output until it finishes or times out.
Use for: builds, installs, database migrations, test suites, any single
command that takes a while.
Examples:
- Build: command="npm run build", timeout_seconds=300
- Tests: command="pytest -v", stop_pattern="FAILED|passed"
- Install: command="apt install -y nginx", timeout_seconds=120
Args:
command: Shell command to run.
timeout_seconds: Max seconds to wait (default 600 = 10 min, max 3600).
tail_lines: Number of output lines to return from the end (default 100).
stream_check_interval: Seconds between progress checks (default 5).
stop_pattern: Regex — kill the process early if output matches this.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| tail_lines | No | ||
| stop_pattern | No | ||
| timeout_seconds | No | ||
| stream_check_interval | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |