execute_command
Run shell commands synchronously and capture their output. Use for CLI tools, build scripts, version control, package managers, and system commands.
Instructions
EXECUTE SHELL COMMANDS synchronously and get output. Use for running CLI tools, build scripts, version control, package managers. Common uses: git commands, npm/pip/go commands, Python/Node.js scripts, build tools. IMPORTANT: Do NOT use for file operations - use dedicated file tools instead. Keywords: execute, run, command, shell, bash, terminal, cli, script, git, npm, python. / 同步执行shell命令并获取输出。用于运行CLI工具、构建脚本、版本控制、包管理器。常见用途:git命令、npm/pip/go命令、Python/Node.js脚本、构建工具。重要:不要用于文件操作 - 请使用专用的文件工具。关键词:执行、运行、命令、shell、终端、脚本。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Command arguments as separate list elements. Each argument is a separate string. Examples: For 'git commit -m "message"' use ['commit', '-m', 'message']. For 'npm install express' use ['install', 'express']. For 'python script.py --arg value' use ['script.py', '--arg', 'value']. | |
| command | Yes | The command executable name (without arguments). This is the program to run. Examples: 'git' (version control), 'npm' (Node.js package manager), 'python' (Python interpreter), 'go' (Go compiler), 'ls' (list files), 'make' (build tool), 'docker' (container tool). | |
| timeout | No | Maximum time in seconds to wait for command completion. 0 means no timeout (wait indefinitely). Use reasonable timeouts: 30s for quick commands, 300s (5min) for builds, 0 for long-running tasks. Default is 0. | |
| work_dir | Yes | The working directory where the command will be executed. Can be absolute or relative to the sandbox root. Use '.' for current directory. The command will run as if you cd'd into this directory first. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stderr | Yes | ||
| stdout | Yes | ||
| message | Yes | ||
| success | Yes | ||
| exit_code | Yes | ||
| command_line | Yes | ||
| current_work_dir | Yes |