shell_exec
Execute PowerShell commands in a persistent session to preserve directory changes, environment variables, and virtual environment state across consecutive operations.
Instructions
在持久化 PowerShell 会话中执行命令。 核心创新:这是一个长期存活的 Shell 进程,不是每次开新进程。 效果:cd 之后目录保持、set 的环境变量保持、Python venv / node -e 等状态保持。 适用于:需要连续操作的场景(先 cd 再 git status、先激活 venv 再 pip install)。
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": "shell_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | 要执行的 PowerShell 命令 | |
| timeout | No | 超时毫秒,默认 30000 |