AI Coding CLI Reference: Codex, Gemini CLI, OpenCode
Updated by Alex Sorokoletov
Reference pages for 11 topics across 3 open-source coding agents: hook events and their payloads, plugin APIs, every configuration key with its default, and permission and sandbox modes. Tables are generated from each tool’s source at its latest release tag, so they match the shipped code, and each page links the exact files and the vendor’s official documentation.
Claude Code environment variables
All 1201 variables Claude Code has read since v2.1.69, searchable by any part of the name, with the version each was added or removed in. Updated to v2.1.310.
Codex CLI
OpenAI · verified against v0.163.0 · official docs · release tracker
- Codex CLI Hooks Reference: All 12 Codex CLI hook events with stdin fields, stdout JSON, timeouts and matchers, plus hooks.json vs config.toml, exit code 2 blocking and the review prompt.
- Codex CLI Plugins Reference: Codex CLI plugin.json fields, what a plugin bundles (skills, MCP servers, apps, hooks), marketplace sources, codex plugin commands and Claude Code support.
- Codex CLI config.toml Reference: Codex CLI config.toml location and layer precedence, profiles, custom model providers and wire_api, MCP servers, every top-level key and every feature flag.
- Codex CLI Permissions and Sandbox Reference: Codex CLI sandbox modes, approval policies and permission profiles (:read-only, :workspace, :danger-full-access), which one wins, --yolo, requirements.toml.
Gemini CLI
Google · verified against v0.65.0 · official docs · release tracker
- Gemini CLI Hooks Reference: All 11 Gemini CLI hook events with examples, stdin and stdout JSON, matchers, millisecond timeouts, exit codes, why hooks do not run, Claude Code mapping.
- Gemini CLI Extensions Reference: Install, list, update and uninstall Gemini CLI extensions from GitHub, the gemini-extension.json manifest, and what an extension bundles: MCP, hooks, skills.
- Gemini CLI settings.json Reference: Gemini CLI settings.json location on macOS, Linux and Windows, a working example, merge order, $VAR expansion, MCP servers, and every key with its default.
- Gemini CLI Permissions and Policy Engine: Skip Gemini CLI permission prompts: YOLO, auto-accept edits, Always allow, policy engine TOML rules and tiers, sandbox, trusted folders, denial errors.
OpenCode
Anomaly · verified against v1.19.4 · official docs · release tracker
- OpenCode Plugins Reference: All 21 OpenCode plugin hooks with input and output shapes, where plugins load from, load order, why a plugin does not load, and the Claude Code hook mapping.
- OpenCode Config Reference (opencode.json): Every opencode.json key with type and description, where OpenCode looks for config files, the merge order, env overrides, and which OpenCode 2 keys 1.x accepts.
- OpenCode Permissions Reference: OpenCode permission keys, defaults, per-agent rules, bash pattern matching, why the last matching rule wins, --auto mode and the OpenCode 2 permissions array.