AgentKit
ReferenceCLI commands

CLI commands

ak codex-agent-runtime unregister

Idempotently remove ak-agent-runtime from ~/.codex/config.toml.

ak codex-agent-runtime unregister

Idempotently remove ak-agent-runtime from ~/.codex/config.toml.

Synopsis

What it does: Removes the AgentKit-managed [mcp_servers.ak-agent-runtime] entry, leaving every other entry under [mcp_servers.*] intact. A missing entry is not an error: exits 0 with Changed=false.

Who it's for: Power devs removing or reconfiguring the Codex adapter for AgentKit.

When to use it: When you want to stop Codex from auto-loading the AgentKit MCP runtime, or before switching to a different MCP server configuration.

Examples: ak codex-agent-runtime unregister # remove from ~/.codex/config.toml ak codex-agent-runtime unregister --codex-home ~/.codex # explicit config dir ak codex-agent-runtime unregister --json # machine-readable result

What changes on disk: Writes ~/.codex/config.toml (CODEX_HOME or --codex-home overrides the base dir). Idempotent: a missing entry exits 0 unchanged.

Output modes: pretty default on TTY (colors, ASCII markers) plain auto when stdout piped or --no-interactive json --json (single-object envelope, NDJSON-safe)

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

ak codex-agent-runtime unregister [flags]

Options

      --codex-home string   Override $CODEX_HOME (defaults to ~/.codex)
  -h, --help                help for unregister
      --json                Emit machine-readable JSON (implies --no-interactive)
      --no-interactive      Disable interactive prompts (CI-safe)
  -q, --quiet               Suppress non-error output on stderr
  -V, --verbose             Extra diagnostic output on stderr (loses to --quiet)
  -y, --yes                 Assume yes for all prompts

SEE ALSO

On this page