cli-adapters

A set of adapters that lets RagCode start and communicate with different AI-agent command-line programs. RagCode is a tool that coordinates agents, while the adapters account for differences in each vendor's commands and connection methods.

In plain words
What is it for?
Use it to run Codex, Claude, Gemini, or Grok through RagCode, configure their commands per repository, and support streaming, resuming, and cancelling sessions where available.
Why use it?
Vendor command syntax can change, so configurable presets reduce the need to rewrite the coordinator whenever an agent CLI changes.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/marshalleriksen-neura/ragcode/cli-adapters
Clone the repo
git clone --depth 1 https://github.com/MarshallEriksen-Neura/ragcode
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,439 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01439
Opus 5 $0.00000 $0.00720
Sonnet 5 $0.00000 $0.00288
Haiku 4.5 $0.00000 $0.00144

Measured 2d ago against content hash fe836b91e573, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cli-adapters scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/agents/cli-adapters.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RagCode Agent CLI Adapters

RagCode orchestrates AI agents by spawning their CLIs. Vendor CLI syntax drifts, so built-in command templates are presets, not hard-coded protocol truth. Anything can be overridden per-repo via .ragcode/agents/agents.json.

Built-in presets

Agent Command Default args supportsWrite connectorKind
codex codex --ask-for-approval never true codex-app-server (Tier 1)
claude claude (none) true claude-stream-json (Tier 2)
gemini gemini (none) false generic CLI spawn
grok grok (none) true grok-agent-stdio (Tier 2)

Grok uses grok agent stdio (ACP JSON-RPC). Probe only checks the subcommand exists; a real turn requires grok login (OAuth / cached token).

Concern Behavior
Stream session/updateagent_message_chunk (coalesced into one harness message)
Terminal _x.ai/session_notification / session/prompt stopReason
Resume Start-time only: start({ nativeSessionId })session/load({ sessionId, cwd, mcpServers }). No silent fallback to session/new. Post-start resume() throws.
Cancel ACP session/cancel notification, then process-tree kill (authoritative). Exactly one harness terminal; late stream events dropped.
Approval Strict: session/request_permission → ACP { outcome: { outcome: "selected", optionId } }. With permission_mode=always-approve (common default), Grok auto-approves and only emits pending_interaction / interaction_resolved notifications — no client RPC.

Capture lab: npx tsx scripts/grok-acp-capture.ts --mode resume|cancel Notes: docs/agents/captures/grok-acp-control-plane.md

Configuration: .ragcode/agents/agents.json

{
  "agents": {
    "codex":   { "adapter": "cli", "command": "codex",   "args": ["--ask-for-approval", "never"], "supportsWrite": true,  "supportsJson": true, "supportsStreaming": true, "supportsMcp": true,  "defaultTimeoutMs": 600000, "connectorKind": "codex-app-server" },
    "claude":  { "adapter": "cli", "command": "claude",  "args": [],                              "supportsWrite": true,  "supportsJson": true, "supportsStreaming": true, "supportsMcp": true,  "defaultTimeoutMs": 600000, "connectorKind": "claude-stream-json" },
    "gemini":  { "adapter": "cli", "command": "gemini",  "args": [],                              "supportsWrite": false, "supportsJson": true, "supportsStreaming": true, "supportsMcp": false, "defaultTimeoutMs": 300000 },
    "grok":    { "adapter": "cli", "command": "grok",    "args": [],                              "supportsWrite": true,  "supportsJson": true, "supportsStreaming": true, "supportsMcp": true,  "defaultTimeoutMs": 600000, "connectorKind": "grok-agent-stdio" }
  }
}

Read the full file on GitHub · 122 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 122 lines · 0 tokens per session scan A fe836b91e573

Subscribe to this mod's changes

cli-adapters is an agent published in the GitHub repository MarshallEriksen-Neura/ragcode (11 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,439 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories