run_command
Execute a command in an iTerm2 session and wait for it to finish, then return the resulting screen output. Includes a configurable timeout and supports targeting a specific session.
Instructions
Run a command and wait for it to finish, returning the resulting screen.
Completion is detected via iTerm2's PromptMonitor COMMAND_END
notification, which requires iTerm2 shell integration to be installed in
the target shell. If the prompt-end event does not arrive within
timeout_seconds, the current screen is returned with a [timeout]
marker.
:param command: The command line to run.
:param session_id: Target session UUID. Defaults to the active session.
:param timeout_seconds: How long to wait for COMMAND_END before
giving up.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"command": "<command>"
},
"name": "run_command"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| session_id | No | ||
| timeout_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |