Agent CLIs
The agent CLI is the program that drives the actual LLM reasoning inside an agent workload — making LLM calls, choosing tools, processing responses, posting back to the conversation. Agyn is CLI-agnostic: it wraps any agent loop in agynd (the platform daemon) and hides the platform plumbing.
You pick a CLI by choosing the init image when you create an agent.
Built-in CLIs
| CLI | Init image | What it is |
|---|---|---|
| Codex | ghcr.io/agynio/agent-init-codex:<version> | OpenAI Codex CLI. Good general-purpose engineering agent loop. |
| Claude Code | ghcr.io/agynio/agent-init-claude:<version> | Anthropic Claude Code. Strong at long-running engineering tasks. |
| agn | ghcr.io/agynio/agent-init-agn:<version> | Agyn's native agent loop. Reference implementation; minimal, easy to extend. |
Each init image bundles agynd, the agyn CLI, the agent CLI binary, and a small startup script. At workload boot, the init container copies these binaries into a shared volume mounted at /agyn-bin; the runtime container has them on its PATH.
How to choose
| If you want… | Pick |
|---|---|
| The most-tested off-the-shelf agent loop today | Codex |
| First-class tool use and a tight loop suited to long engineering tasks | Claude Code |
| To understand or modify the agent loop yourself | agn |
| To use your own custom CLI | Build a custom init image (see below) |
Switching CLIs
Switching is a configuration change on the agent — replace the init image and (typically) the model. The agent's MCPs, secrets, volumes, and hooks transfer across CLIs because they are managed by the platform, not the CLI.
In the Console (Administer → Agents → edit) or Terraform:
resource "agyn_agent" "support" {
# ...
init_image = "ghcr.io/agynio/agent-init-claude:v1.0.0"
model = agyn_llm_model.sonnet_4_6.name
}
How a workload runs
The pod layout for any CLI:
Pod
├── init container (init image) # copies binaries to /agyn-bin
├── runtime container (your dev image) # runs agynd, which runs the CLI
├── files-mcp sidecar (if attached) # tool sidecar
├── your other MCP sidecars # one per MCP
├── hooks sidecars (if any) # one per hook
└── Ziti sidecar # private network access
Inside the runtime container:
/agyn-bin/agyndis the entrypoint.agyndfetches agent configuration from Gateway (skills →/skills/*.md, MCP configs → CLI's MCP config file, init scripts → executed in order).agyndexportsOPENAI_API_BASE/ANTHROPIC_API_URL/ equivalents to point atllm-proxy.zitiso LLM calls route through the platform proxy.agyndspawns the agent CLI.- The CLI runs its loop.
agyndposts model output to the thread, acknowledges messages, and sends keepalives while the CLI is producing output.
Writing a custom CLI
If none of the built-ins fit your use case, you can ship your own. The contract:
- Binary location. Place your CLI binary in
/agyn-bin/cli.agyndprepends/agyn-bin/cliand/agyn-binto PATH. - LLM endpoint. Honor the LLM endpoint and credentials
agyndexports as environment variables. By default this means using theOPENAI_API_BASE(responsesprotocol) or Anthropic equivalents — adapted clients work without modification. - MCP configuration. Read your MCP server endpoints from the config file
agyndwrites (path provided in an env var). Or use whatever convention the underlying SDK expects —agyndwrites Codex- and Claude-style configs out of the box. - Skills. Files in
/skills/are reusable prompt fragments — load them into your system prompt as appropriate for your loop. - Threads I/O. For each user message, your CLI receives it on stdin (or via an
agynd-provided file) and writes responses to stdout.agyndposts both to the conversation.
The simplest path is to fork the agn-cli repo and modify it. See agynio/agn-cli.
Custom init image
Bundle your CLI by extending the init-image pattern:
FROM ghcr.io/agynio/agent-init-base:latest
COPY mycli /agyn-bin/cli/mycli
COPY startup.sh /agyn-bin/startup.sh
The base image provides agynd and the agyn CLI. startup.sh is a shell script copied to the runtime container that prepares anything CLI-specific (mostly: which CLI binary agynd should spawn).
Push the image, then set it as init_image on an agent.
Hooks across CLIs
Hooks are sidecar processes that respond to events emitted by the agent CLI. Each CLI emits a slightly different event set; consult the CLI's documentation for the canonical list. agynd translates platform events into hook invocations.
agynd
For the full daemon spec (every env var, every file it writes, every API call it makes), see agynd.
Related
- Administer → Agents — pick a CLI when creating an agent.
- agynd — the wrapper daemon.
- MCP servers — tools your CLI's agent loop will call.
- Gateway API — what
agyndcalls under the hood.