run_command
Run shell commands on a Windows PC and get the output. Supports PowerShell, Git Bash, and WSL for any CLI task, from npm install to git status. Returns STDOUT/STDERR with configurable timeout.
Instructions
Execute a shell command on this Windows PC and return its output. Use this tool to run any CLI command: package installation (npm, pip, cargo), code compilation, file management via CLI, registry queries, network diagnostics (ping, tracert, ipconfig), git operations, build scripts, or anything that can run in a terminal. Default shell is PowerShell with a timeout of 30 seconds. Returns both STDOUT and STDERR. The 'shell' parameter switches to Git Bash or WSL for Unix-style commands (ls, grep, bash scripts). WARNING: Dangerous commands will still execute — make sure the command is correct before running.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory where the command runs. Use absolute path. Default: user home directory (C:\Users\<username>) | |
| shell | No | Shell to run the command in. "powershell" (default) is native Windows. "gitbash" uses Git Bash (C:\Program Files\Git\bin\bash.exe) for Unix utilities. "wsl" uses WSL (System32\bash.exe → default distro, e.g. Ubuntu) for real Linux commands. Use PowerShell unless the command is Unix-specific. | |
| command | Yes | The shell command to execute. Examples: "dir C:\Users", "Get-Process", "npm install", "git status", "ipconfig /all", "ls -la" | |
| timeout | No | Execution timeout in milliseconds. Default: 30000 (30 seconds). Increase for long-running commands like npm install or builds. |