CLI Agent Delegation

Delegate tasks to external CLI coding tools like Claude Code, Gemini CLI, Codex, Copilot, or Aider.

Tool Name

cli_agent

Parameters

KeyTypeDefaultDescription
toolstringName of the CLI tool to invoke (e.g., "claude", "gemini")
promptstringThe prompt/task to send to the CLI tool
working_dirstringnullWorking directory for command execution

Default Tools

When cli_agents.enabled = true with no explicit tool configs, these defaults are registered (if the command exists on the system):

NameCommandDefault Args
claudeclaude-p --output-format json
geminigemini-p --output-format json --sandbox=false
codexcodexexec --json --full-auto
copilotcopilot-p
aideraider--yes --message
Discovery
Only tools whose commands are found via which are registered. Missing tools are silently skipped.

Custom Configuration

config.toml
[cli_agents]
enabled = true
timeout_secs = 600
max_output_chars = 16000

[cli_agents.tools.claude]
command = "claude"
args = ["-p", "--output-format", "json"]
description = "Claude Code for coding tasks"

[cli_agents.tools.custom-tool]
command = "/usr/local/bin/my-ai-tool"
args = ["--json"]
description = "My custom AI tool"
timeout_secs = 120

Output Extraction

The tool attempts to extract structured output:

  • JSON: looks for result, output, content, or message fields
  • JSONL: takes the last line containing content
  • Fallback: returns raw output, truncated to max_output_chars