cli_tool
Execute single or multiple CLI commands synchronously or asynchronously with configurable timeout, working directory, and platform-specific execution. Includes safe mode for command filtering.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
command | No | Single-line command content | |
commands | No | Multi-line command sequence (mutually exclusive with 'command') | |
cwd | No | Working directory (absolute or relative to build/) | |
mode | No | Execution mode: sync - synchronous blocking, async - asynchronous non-blocking | sync |
platform | No | Force execution context (win32, linux) | auto |
safe_mode | No | Enable dangerous command filtering | |
timeout | No | Command timeout in seconds |
Input Schema (JSON Schema)
{
"description": "CLI executor with sync/async modes and timeout.",
"name": "cli_tool",
"properties": {
"command": {
"description": "Single-line command content",
"type": "string"
},
"commands": {
"description": "Multi-line command sequence (mutually exclusive with 'command')",
"items": {
"type": "string"
},
"type": "array"
},
"cwd": {
"description": "Working directory (absolute or relative to build/)",
"type": "string"
},
"mode": {
"default": "sync",
"description": "Execution mode: sync - synchronous blocking, async - asynchronous non-blocking",
"enum": [
"sync",
"async"
],
"type": "string"
},
"platform": {
"default": "auto",
"description": "Force execution context (win32, linux)",
"enum": [
"auto",
"win32",
"linux",
"darwin"
],
"type": "string"
},
"safe_mode": {
"default": true,
"description": "Enable dangerous command filtering",
"type": "boolean"
},
"timeout": {
"default": 30,
"description": "Command timeout in seconds",
"minimum": 1,
"type": "number"
}
},
"required": [],
"type": "object"
}