feat(exec): add shell command execution endpoint
This commit is contained in:
24
docs/API.md
24
docs/API.md
@@ -10,7 +10,7 @@ x-clickthrough-token: <token>
|
||||
|
||||
## `GET /health`
|
||||
|
||||
Returns status and runtime safety flags.
|
||||
Returns status and runtime safety flags, including `exec` capability config.
|
||||
|
||||
## `GET /screen`
|
||||
|
||||
@@ -143,6 +143,28 @@ Hotkey:
|
||||
}
|
||||
```
|
||||
|
||||
## `POST /exec`
|
||||
|
||||
Execute a shell command on the host running Clickthrough.
|
||||
|
||||
```json
|
||||
{
|
||||
"command": "Get-Process | Select-Object -First 5",
|
||||
"shell": "powershell",
|
||||
"timeout_s": 20,
|
||||
"cwd": "C:/Users/Paul",
|
||||
"dry_run": false
|
||||
}
|
||||
```
|
||||
|
||||
Notes:
|
||||
- `shell` supports `powershell`, `bash`, `cmd`
|
||||
- if `shell` is omitted, server uses `CLICKTHROUGH_EXEC_DEFAULT_SHELL`
|
||||
- output is truncated based on `CLICKTHROUGH_EXEC_MAX_OUTPUT_CHARS`
|
||||
- endpoint can be disabled with `CLICKTHROUGH_EXEC_ENABLED=false`
|
||||
|
||||
Response includes `stdout`, `stderr`, `exit_code`, timeout state, and execution metadata.
|
||||
|
||||
## `POST /batch`
|
||||
|
||||
Runs multiple `action` payloads sequentially.
|
||||
|
||||
Reference in New Issue
Block a user