iterm_run
Execute terminal commands in iTerm directly from LLM applications, with options to run in new windows or existing sessions.
Instructions
[iTerm terminal operations] Run a command in iTerm
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | Command to run in iTerm | |
| newWindow | No | Whether to open in a new window (default: false) |
Implementation Reference
- src/categories/iterm.ts:43-60 (handler)Core handler logic for 'iterm_run' tool: generates AppleScript to run the specified command in an iTerm window, optionally in a new window.script: (args) => ` tell application "iTerm" ${ args.newWindow ? ` set newWindow to (create window with default profile) tell current session of newWindow ` : ` set w to current window tell w's current session ` } write text "${args.command}" activate end tell end tell `,
- src/categories/iterm.ts:28-42 (schema)Input schema definition for the 'iterm_run' tool, specifying 'command' as required and optional 'newWindow' parameter.schema: { type: "object", properties: { command: { type: "string", description: "Command to run in iTerm", }, newWindow: { type: "boolean", description: "Whether to open in a new window (default: false)", default: false, }, }, required: ["command"], },
- src/framework.ts:224-224 (registration)Registers tool names using '{category}_{script}' format, creating 'iterm_run' from 'iterm' category and 'run' script.name: `${category.name}_${script.name}`, // Changed from dot to underscore
- src/index.ts:30-30 (registration)Registers the 'iterm' ScriptCategory containing the 'run' script (becomes 'iterm_run' tool).server.addCategory(itermCategory);