execute_command
Execute shell commands with support for pipes, redirection, and configurable options like working directory, timeouts, and output formats.
Instructions
命令执行:在系统中执行shell命令。支持管道、重定向,集成命令策略评估和sudo配置。
示例:列出文件 { "command": "ls -la", "output_format": "json" } 示例:带工作目录执行 { "command": "npm test", "working_directory": "/project", "timeout_ms": 120000 }
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | 要执行的系统命令,支持管道和重定向 | |
| working_directory | No | 工作目录路径,所有相对路径以此为基础解析 | |
| confirm | No | 确认执行高风险命令,需要在 warn 策略下设为 true | |
| timeout_ms | No | 超时时间(毫秒),防止命令长时间阻塞,默认60000 | |
| stdout_max | No | stdout最大输出长度,超出会被截断,默认4000 | |
| stderr_max | No | stderr最大输出长度,超出会被截断,默认2000 | |
| output_format | No | 输出格式:text(纯文本)、json(结构化JSON)、both(两者兼有) |