winops_cmd_cmd
Execute CMD commands on Windows and retrieve stdout, stderr, exit code, and execution time. Provides direct command-line control with output capture for automation and troubleshooting.
Instructions
Execute a CMD (cmd.exe) command and return stdout, stderr, exit_code, execution_time.
Return Format
{
"success": bool,
"message": str,
"stdout": str,
"stderr": str,
"exit_code": int,
"execution_time": float,
"next_steps": str | [],
"sampling_advice": str
}Examples
cmd(command="dir /s /b *.log", working_directory="C:\Logs")
cmd(command="ipconfig /all")Notes:
Uses asyncio.to_thread — never blocks the event loop.
ctx.sample() capped at 10s to prevent hang on unsupported clients.
Safety guards block Linux-isms (grep, tail, rm -rf, etc.) and em dashes.
stdout/stderr truncated at max_output_size chars each.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | CMD command to execute. | |
| stdin_data | No | Optional data to pipe to stdin of the command. | |
| max_output_size | No | Truncate stdout/stderr at this many chars. | |
| timeout_seconds | No | Hard timeout 1-300s. | |
| working_directory | No | Optional working directory. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||