Skip to content
Back to skills

Agent Cli

ASecurity

ある AI エージェントから別の AI CLI(devin / codex / claude / cursor-agent / opencode / gemini / grok)を非対話で呼び出すときの実行規則。print モードの 選び方、認証・権限・cwd の罠、出力フォーマット、ACP 起動の注意をまとめる。 「codex に投げて」「devin を CLI から呼んで」「別エージェントに委譲」 といった依頼で使う。ユーザーが /agent-cli と入力したら使う。

  • 8 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 2, 2026
ai-agentsbackend

Works with

  • claude code
  • cursor
  • cli

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned October 2, 2026

npx -y skills add coil398/dotfiles --skill agent-cli --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Agent Cli?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Agent Cli
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/coil398-agent-cli/badge)](https://www.skillsdirectory.com/skills/coil398-agent-cli)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: agent-cli
description: >-
  ある AI エージェントから別の AI CLI(devin / codex / claude / cursor-agent /
  opencode / gemini / grok)を非対話で呼び出すときの実行規則。print モードの
  選び方、認証・権限・cwd の罠、出力フォーマット、ACP 起動の注意をまとめる。
  「codex に投げて」「devin を CLI から呼んで」「別エージェントに委譲」
  といった依頼で使う。ユーザーが /agent-cli と入力したら使う。
---

# agent-cli

別エージェントを呼ぶときの共通原則と CLI 別の勘所。**対話 TUI を起動しない**
ことが第一。必ず print / exec / run / acp 系の非対話モードを使う。

## 共通ルール

- **非対話モード必須**。引数なし起動や不明なサブコマンドは TUI を開いて
  non-tty でハングする(実測: `cursor-agent ls` は存在しないのに TUI 化した)
- **cwd を固定する**。セッション・設定・権限はディレクトリ単位。`cd` するか
  `-C` / `--dir` / `--workspace` / `--cd` で指定する
- **timeout を必ず付ける**。応答なしのまま無期限に待たない
- **機械処理は JSON 系フォーマット**(`--output-format json` / `--json` /
  `--format json` / ACP events)
- **env を汚染しない**。親エージェント固有の env が子の挙動を変える
  (実測: `ACP_BACKEND` 継承で `devin acp` が local credential を拒否)
- **委譲プロンプトは自己完結に**。子は親の会話文脈を見ない。
  目的・対象 path・完了条件を全部書く
- **権限緩和フラグは deny を無効化しない**。`--yolo` / bypass /
  `--dangerously-*` は確認の自動承認で、deny 系の強制拒否は残る(実測済み)
- **長いプロンプトはファイル経由**。argv の長さ・エスケープ問題を避ける
  (`--prompt-file` / stdin / `-` など)

## CLI 別詳細

| CLI | reference | 非対話の入口 |
|---|---|---|
| Devin | [references/devin.md](references/devin.md) | `devin -p` / `devin acp`(ACP) |
| Codex | [references/codex.md](references/codex.md) | `codex exec` |
| Claude Code | [references/claude.md](references/claude.md) | `claude -p` |
| Cursor | [references/cursor-agent.md](references/cursor-agent.md) | `cursor-agent -p` |
| OpenCode | [references/opencode.md](references/opencode.md) | `opencode run` / `serve`+`attach` / `acp` |
| Gemini | [references/gemini.md](references/gemini.md) | positional `gemini 'task'` |
| Grok | [references/grok.md](references/grok.md) | `grok -p` |

委譲の設計(transport 選定・監視・env 隔離・ネスト制限)は
[references/delegation.md](references/delegation.md)。

## 呼び分けの目安

| 用途 | 向いてるもの |
|---|---|
| 定型の非対話タスク | `codex exec` / `claude -p` / `cursor-agent -p` / `gemini` |
| 継続セッション・状態を持つ委譲 | `devin acp` / `opencode serve` + `attach` / `codex exec resume` |
| 最小副作用の相談 | `claude -p --bare`、各 CLI の plan/ask モード |
| 出力を機械処理 | `claude --output-format json`、`cursor-agent --output-format stream-json`、`opencode --format json`、`gemini -o json`、codex `--json`(JSONL)/`-o`、devin ACP events |
| 構造化された最終応答 | codex `--output-schema` + `-o` |

Files in this skill

  • SKILL.md3.3 KB
  • references/claude.md2.5 KB
  • references/codex.md3.3 KB
  • references/cursor-agent.md1.9 KB
  • references/delegation.md3.3 KB
  • references/devin.md4.5 KB
  • references/gemini.md1.1 KB
  • references/grok.md769 B
  • references/opencode.md1.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…