Execute Terminal Command
terminal_execRun shell commands locally and capture stdout, stderr, exit code, and duration to support debugging, automation, and system checks.
Instructions
在本地电脑终端中执行 Shell 命令,返回标准输出、标准错误、退出码与执行耗时。
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": "terminal_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | 命令执行工作目录,默认使用配置中的 defaultCwd | |
| env | No | 附加环境变量键值对 | |
| shell | No | 指定 Shell 可执行文件路径,如 /bin/zsh 或 /bin/bash | |
| command | Yes | 要执行的终端命令 | |
| timeoutMs | No | 超时时间(毫秒),默认读取服务配置 |