AgentKit
ReferenceCLI commands
BetaYou are reading docs for the beta channel (2.4.1-beta.1) — updated automatically on every beta release.Switch to stable →

CLI commands

ak codex-agent-runtime register

Idempotently register ak-agent-runtime in ~/.codex/config.toml.

Writes [mcp_servers.ak-agent-runtime] with command=ak args=["codex-agent-runtime", "serve"] to the user's Codex config so Codex auto-discovers AgentKit's MCP runtime on startup. Other [mcp_servers.*] entries are preserved.

Who it's for: Power devs setting up the Codex adapter for AgentKit kits.

When to use it: Run once after ak kit init --target codex to wire the MCP runtime into your Codex config. Safe to re-run: idempotent if the entry is already present.

What changes on disk: Writes or updates ~/.codex/config.toml (CODEX_HOME or --codex-home overrides the base dir). Idempotent: re-running with the same target leaves the file untouched and exits 0.

Usage

ak codex-agent-runtime register [flags]

Examples

ak codex-agent-runtime register                          # write to ~/.codex/config.toml
ak codex-agent-runtime register --codex-home ~/.codex   # explicit config dir
ak codex-agent-runtime register --json                   # machine-readable result

Flags

FlagDescription
--codex-home stringOverride $CODEX_HOME (defaults to ~/.codex)
-h, --helphelp for register
--jsonEmit machine-readable JSON (implies --no-interactive)
--no-interactiveDisable interactive prompts (CI-safe)
-q, --quietSuppress non-error output on stderr
-V, --verboseExtra diagnostic output on stderr (loses to --quiet)
-y, --yesAssume yes for all prompts

Output modes

ModeBehavior
prettydefault on TTY (colors, ASCII markers)
plainauto when stdout piped or --no-interactive
json--json (single-object envelope, NDJSON-safe)

Exit codes

CodeMeaning
0success
1runtime error
2invalid flags
3user-cancel (SIGINT, prompt-cancel)
5config file could not be read or written

On this page