run_command
Execute shell commands on a single host or multiple hosts concurrently. Supports background execution, output abbreviation, and progress tracking for efficient SSH orchestration.
Instructions
Executes a shell command on a single host ('host') or multiple hosts concurrently ('hosts'). If using 'hosts', returns a JSON map mapping hostnames to their stdout, stderr, and exit codes. Features optional 'background' execution (starting the command and returning a local log file path immediately for async tracking), 'quiet' execution (suppressing progress logs), and output abbreviation controls. Prefer 'hosts' to execute commands across cluster nodes simultaneously.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | The target hostname or IP address | |
| hosts | No | A list of hostname targets to query concurrently | |
| quiet | No | If true, suppresses terminal progress logging in background files (default: false) | |
| command | Yes | The shell command to run on target | |
| max_lines | No | Max lines to return if abbreviate is true (default: 100) | |
| abbreviate | No | If true, limits long stdout output (default: true) | |
| background | No | If true, runs command in background and returns log path immediately (default: false) | |
| progress_interval_secs | No | Number of seconds between progress reporting updates (default: 5) |