shell
Executes remote shell commands in persistent SSH sessions, with automatic session management, smart wait times, and interrupt controls. Enables long-running remote operations for AI assistants.
Instructions
PRIMARY TOOL - Intelligent shell command handler for remote sessions.
This tool automatically detects and handles:
Remote shell commands (ssh, gcloud compute ssh, aws ssm, az ssh, etc.) - Starts a persistent session
Regular commands when session is active - Executes in the remote session
Session control - Use special exit sequences to close the session
Smart Wait Time: Automatically adjusts wait time based on command type (longer for builds, shorter for ls).
Working Directory Tracking: Tracks cd commands and shows current directory in prompt.
Control sequences (to avoid conflict with normal commands):
~.or//end- End session and return to local shell//stopor//killor//ctrl-c- Send Ctrl+C (SIGINT) to interrupt running command
Auto-reconnect: Sessions automatically attempt to reconnect on disconnection.
Sessions auto-cleanup after 1 hour of inactivity. Output is displayed exactly as the terminal shows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stream | No | Enable streaming output for long-running commands | |
| command | Yes | The shell command to execute | |
| waitTime | No | Override smart wait time (ms). If not provided, automatically determined based on command type. | |
| forceNewSession | No | Force creation of a new parallel session even if one is active |