Run Shell Command
run_commandExecute shell commands with full piping and redirect support, capturing stdout, stderr, and exit code. Optionally specify a working directory.
Instructions
Run a shell command and return its stdout, stderr and exit code. Runs through the system shell, so pipes, redirects and globs work. Killed after the configured timeout.
WARNING: This executes arbitrary commands on the local machine. Only use commands the user would approve.
Args:
command (string): The shell command line to run.
cwd (string): Optional working directory.
Returns exit code plus captured stdout/stderr.
Example: { "command": "ls -la | head", "cwd": "~/project" }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | Shell command line | |
| cwd | No | Working directory |