ssh_cmd_run
Execute a command on a remote SSH host with timeout management for long-running tasks. Poll, kill, or review history for ongoing commands.
Instructions
Execute a command on the remote host and return the results. Handles both immediate and long-running operations. Manages timeouts (I/O timeout and runtime timeout). Work with runtime_timeout primarily which should be set to something reasonable. If timeout occurs, you can use 'ssh_cmd_check' tool to check on the running command. Note that 'ssh_cmd_check' can be called immediately with a 'wait_seconds' argument where it waits for a given number of seconds and then returns with the command status. This way you can poll the command status until it completes. The command can also be killed using 'ssh_cmd_kill' tool. You can access the command history using the 'ssh_cmd_history' tool to see what were previous commands and what output they produced.
Returns: Dictionary containing command output, status, and metadata. Status field indicates success or the type of failure (timeout, runtime_timeout, etc.)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | Command to execute on remote host | |
| io_timeout | No | I/O timeout in seconds | |
| runtime_timeout | No | Total runtime timeout in seconds | |
| use_sudo | No | Run command with sudo |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||