SHELL API - USAGE GUIDE (for AI agents) ======================================= This API lets you run commands on the remote machine and read the result. Host OS: win32 | Default shell: powershell | Available shells: powershell, pwsh, cmd Base URL: http://desktop-29dmi9t.tail2307b2.ts.net ENDPOINTS --------- GET /doc -> this guide POST /exec -> run one command and return its output POST /exec ---------- Headers: Content-Type: application/json (no API key needed). Body (JSON): command string REQUIRED. The command / script to run. shell string optional. One of: powershell, pwsh, cmd. Default: powershell cwd string optional. Working directory (must exist). timeout_ms number optional. Default 30000, max 300000. Response (JSON): ok boolean true if exit_code == 0 and no timeout exit_code number|null stdout string stderr string shell, cwd string what was actually used timed_out boolean command was killed because of timeout truncated boolean output exceeded 1 MB and was cut duration_ms number error string only when the process could not start Errors: 400 invalid body. EXAMPLES -------- curl: curl -X POST http://desktop-29dmi9t.tail2307b2.ts.net/exec \ -H "Content-Type: application/json" \ -d '{"command":"Get-ChildItem"}' Specific shell + working directory: {"command":"dir","shell":"cmd","cwd":"C:\\Users"} RULES FOR THE AI ---------------- 1. Each call is a NEW process: "cd" and variables do NOT persist between calls. Use the "cwd" field, or chain commands in one call (e.g. "cd x; ls"). 2. Commands must be NON-INTERACTIVE (no prompts, no stdin). Use flags like -y / -Force. 3. Always check "ok" / "exit_code" and read "stderr" before assuming success. 4. For long tasks raise "timeout_ms" or run them in the background. 5. Prefer small, inspectable steps. Do not run destructive commands (delete, format, shutdown, registry edits) unless the user explicitly asked.