opencode_pty
Create, list, inspect, resize, rename, and close terminal PTY sessions to run commands in a chosen working directory with custom args and environment variables.
Instructions
Manage terminal (PTY) sessions. Actions: list (all PTY sessions), create (new terminal with command/args/cwd), get (session by ID), update (resize or rename), remove (close session). Skip 'connect' — it's a WebSocket upgrade.
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": {
"action": "<action>"
},
"name": "opencode_pty"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | PTY session ID (required for get/update/remove) | |
| cwd | No | Working directory (for create) | |
| env | No | JSON object of environment variables (for create) | |
| args | No | JSON array of arguments (for create) | |
| cols | No | Terminal columns (for update — resize) | |
| rows | No | Terminal rows (for update — resize) | |
| title | No | Session title (for create/update) | |
| action | Yes | ||
| command | No | Command to run (for create) |