execute_command
Execute commands in PowerShell, CMD, or Git Bash on Windows with configurable working directory, environment variables, and timeout.
Instructions
[Command Execution] Execute a command in the specified shell (powershell, cmd, or gitbash)
Example usage (PowerShell):
{
"shell": "powershell",
"command": "Get-Process | Select-Object -First 5",
"workingDir": "C:\\Users\\username"
}Example usage with custom environment variables:
{
"shell": "powershell",
"command": "python -c \"print('Hello δΈη')\"",
"env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
}
}Example usage (CMD):
{
"shell": "cmd",
"command": "dir /b",
"workingDir": "C:\\Projects"
}Example usage (Git Bash):
{
"shell": "gitbash",
"command": "ls -la",
"workingDir": "/c/Users/username"
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Custom environment variables for command execution (optional). Example: {"PYTHONIOENCODING": "utf-8"} | |
| shell | Yes | Shell to use for command execution | |
| command | Yes | Command to execute | |
| timeout | No | Command timeout in seconds (overrides config default) | |
| workingDir | No | Working directory for command execution (optional) |