| terminal_create_or_get | Create a new visible terminal window or get an existing one by name. The terminal opens in a visible window that the user can interact with directly.
Commands sent to this terminal will be executed in that visible window.
Args:
name: Optional name for the terminal. If a terminal with this name
already exists and is still alive, it will be returned instead
of creating a new one.
working_dir: Optional working directory for the terminal.
If not specified, uses the current working directory.
Returns:
dict: Contains session_id, name, platform, and a status message.
Use the session_id for subsequent operations.
Examples:
- Create unnamed terminal: terminal_create_or_get()
- Create named terminal: terminal_create_or_get(name="dev-server")
- Get existing terminal: terminal_create_or_get(name="dev-server")
|
| terminal_send_input | Send input (command or text) to a terminal. The input is sent to the visible terminal window and executed there.
The user can see the command being executed in real-time.
Args:
session_id: The terminal session ID returned by terminal_create_or_get.
text: The text/command to send. This will be executed as a shell command.
Returns:
dict: Contains success status, session_id, and the sent text.
Examples:
- Run a command: terminal_send_input(session_id="abc123", text="ls -la")
- Start a server: terminal_send_input(session_id="abc123", text="npm start")
- Run Python: terminal_send_input(session_id="abc123", text="python script.py")
Note:
The command is executed asynchronously. Use terminal_get_output to
retrieve the results after the command completes.
|
| terminal_get_output | Get the output from a terminal. Retrieves the recent output from the terminal's history. This includes
both command inputs and their outputs.
Args:
session_id: The terminal session ID returned by terminal_create_or_get.
lines: Number of lines to retrieve from the end (default: 100, max: 1000).
Returns:
dict: Contains success status, session_id, and the output text.
Examples:
- Get last 100 lines: terminal_get_output(session_id="abc123")
- Get last 50 lines: terminal_get_output(session_id="abc123", lines=50)
Note:
Output may have a slight delay as it's captured asynchronously from
the terminal process.
|
| terminal_list | List all active terminal sessions. Returns information about all terminal sessions that are currently
open and active.
Returns:
dict: Contains a list of terminal sessions with their details.
|
| terminal_close | Close a terminal session. Closes the terminal window and cleans up associated resources.
Args:
session_id: The terminal session ID to close.
Returns:
dict: Contains success status and message.
|