agentleFS
AwakehshAwakehsh/awesome-agent-tools/skills/codex-cli/SKILL.md

codex-cli

Skill8 starsChanged 23 days agoMITView on GitHub

Interact with OpenAI Codex CLI for plan review, code review, and complex problem discussion. Supports either ChatGPT-account or API-key login, model selection, and multi-round conversations. Use when the user wants a second opinion from Codex on an implementation plan, a diff, or a hard technical question, or invokes /codex-cli. Usage: /codex-cli <command> [options]

  • Reads credentials

23 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use opencode-cli, antigravity-cli and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • julweberSkill

    opencode-cli

    Expert control of opencode via the command line. Use when running opencode TUI, headless server, web UI, or the `run` non-interactive mode; managing sessions, providers, agents, MCP servers, models, stats, import/export, GitHub integration, debugging, database tools, upgrades, or shell completions.

    Also in 5 projects that use this

  • yu-iskwSkill

    antigravity-cli

    Executes coding, review, research, and automation tasks using Google Antigravity CLI (`agy`). Uses Antigravity's native fine-grained allow/ask/deny permissions instead of Gemini CLI approval modes.

    Also in 3 projects that use this

  • julweberSkill

    claude-cli

    Expert control of the `claude` CLI (Claude Code). Use when running Claude Code interactively or non-interactively, managing sessions, configuring MCP servers, managing plugins, handling authentication, or piping prompts through claude for scripting.

    Also in 3 projects that use this

  • ihiteshguptaSkill

    terraform

    Expert in Infrastructure as Code with Terraform. Use for creating, managing, and versioning infrastructure across cloud providers.

    Also in 3 projects that use this

  • mrgoonieSkill

    claude-code

    Also in 4 projects that use this

  • GoogleSkill

    ponytail

    Forces the laziest solution that actually works, simplest, shortest, most minimal. Channels a senior dev who has seen everything: question whether the task needs to exist at all (YAGNI), reach for the standard library before custom code, native platform features before dependencies, one line before fifty. Supports intensity levels: lite, full (default), ultra. Use on ANY coding task: writing, adding, refactoring, fixing, reviewing, or designing code, and choosing libraries or dependencies. Also use whenever the user says "ponytail", "be lazy", "lazy mode", "simplest solution", "minimal solution", "yagni", "do less", or "shortest path", or complains about over-engineering, bloat, boilerplate, or unnecessary dependencies. Do NOT use for non-coding requests (general knowledge, prose, translation, summaries, recipes).

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 20 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Logged in — two supported paradigms: Check the current one first:

    line 36
  2. Very specific:

    Check yours: the codex exec header prints sandbox: <mode>, or read sandbox_mode in ~/.codex/config.toml.

    line 60
  3. Very specific:

    Do NOT background short ask/single-file reviews — the realtime reasoning trace is more useful in foreground.

    line 138

“Common” is measured: kept by at least 6 in 10 of the 20 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Codex CLI Interaction Skill

Interact with OpenAI Codex CLI to leverage its reasoning for plan review, code analysis, and complex problem discussions.

Naming: "codex-cli" Skill = this document. "Codex CLI" = the OpenAI command-line tool being invoked.

🚨 Model Rule — READ FIRST

  • If the user names a model, use exactly that model. Respect the user's choice.
  • If the user does NOT name a model, do NOT pass -m or -c model= at all. Let Codex use the default from ~/.codex/config.toml.
  • Never hardcode a model name. Model names change across Codex releases, and the names available under ChatGPT-account login differ from those under API-key login. Hardcoding a name is the #1 cause of "model does not exist" failures.
  • To see the active default without guessing: run any codex exec — its header prints model: <name> — or read the model = "..." line in ~/.codex/config.toml.

codex exec IS an agent loop (not single-shot)

codex exec is non-interactive, which is NOT the same as "single-shot". Each codex exec call runs a full agent loop: Codex autonomously reads files, greps, runs shell commands, and reasons over many steps before returning. "Non-interactive" only means there is no human back-and-forth mid-run — it does not reduce Codex's agentic capability.

  • This is why the skill uses codex exec (not the interactive TUI): you can't drive an interactive terminal from another agent, but exec gives you the same autonomous loop.
  • For a follow-up round (e.g. round 2 of a review), continue the SAME session: codex exec resume <session-id> "<follow-up>". Capture the session id: printed in round 1's header.
  • Do NOT use resume --last in automation. --last resolves to the most recent session globally; any concurrent Codex call steals "last", so you resume the wrong thread. Always resume by explicit <session-id>.

Prerequisites

  1. Codex CLI installed
    which codex && codex --version
    Install path depends on your installer (e.g. ~/.local/bin/codex, or a package manager). If missing, follow the OpenAI Codex CLI install docs.
  2. Logged in — two supported paradigms. Check the current one first:

    codex login status

    Paradigm A — ChatGPT account (OAuth). Uses your ChatGPT subscription quota and rate limits.

    codex login          # opens a browser to authorize; no API key needed

    codex login status → Logged in using ChatGPT.

    Paradigm B — API key. Billed per API usage.

    codex login --with-api-key            # reads the key from stdin
    # non-interactive: codex login --with-api-key <<< "$OPENAI_API_KEY"

    codex login status → Logged in using an API key - sk-***.

    The skill's commands are identical under both paradigms. What differs: billing, rate limits, and which model names are available — which is exactly why you must not hardcode -m (see Model Rule).

Sandbox — what actually runs

  • codex exec's nominal default is read-only, but ~/.codex/config.toml (sandbox_mode) overrides it. If your config sets danger-full-access, commands run with full write access unless you pass -s read-only explicitly.
  • This skill follows your config; it does NOT force a sandbox. For a guaranteed no-writes review, add -s read-only.
  • Check yours: the codex exec header prints sandbox: <mode>, or read sandbox_mode in ~/.codex/config.toml.

Capabilities inside codex exec

CapabilityStatusNotes
Shell + file tools✅ stableCodex autonomously reads your repo, greps, runs commands (subject to sandbox).
Web / internet search⚠️ not available by flagcodex exec has no --search flag (only the interactive codex --search has one), and the old web_search_* feature flags are deprecated. Do not assume Codex can browse the web from exec.
browser_use / computer_use⚠️ account-onlyDepend on the ChatGPT.app ecosystem; unreliable under non-interactive exec.

CLI Flag Reference

⚠️ codex review and codex exec review have DIFFERENT flags.

  • codex review (top-level): NO -m flag. Set a model with -c model="..." only.
  • codex exec review: supports -m and -c model="...".

Flag Compatibility Matrix

Flagcodex reviewcodex exec reviewcodex exec "prompt"
-m, --modelNOYESYES
-c, --configYESYESYES
--uncommittedYESYESNO
--baseYESYESNO
--commitYESYESNO
-s, --sandboxNONOYES
--skip-git-repo-checkNOYESYES

Recommended Command Forms

These follow your config.toml model by default. Add -c model_reasoning_effort="..." to override effort; add a model flag ONLY if the user named a model.

Code review (use top-level codex review — simplest)

codex review --uncommitted                       # review staged+unstaged+untracked
codex review --base main                          # review changes vs a branch
codex review --commit HEAD~1                      # review a specific commit
# A review target (--uncommitted/--base/--commit) cannot be combined with custom
# instructions. For a focused review, use exec and name the diff in the prompt:
#   codex exec -s read-only "Review git diff main...HEAD for <focus>. Report file:line findings."
# effort override:  codex review --uncommitted -c model_reasoning_effort="high"
# user named model M: codex review --uncommitted -c model="M"   # NOTE: -c, not -m

Plan review / questions (use codex exec)

codex exec "Review this implementation plan: [...]
Evaluate: technical soundness, risks, missing considerations, approval status" \
  --skip-git-repo-check
# guaranteed no writes:  add  -s read-only
# user named model M:    add  -m M

Code review via exec (only when you need -m)

codex exec review --base main
codex exec review --uncommitted

Multi-round review (preserve context)

# Round 1 — capture the session id printed in the header
codex exec review --uncommitted            # header shows: session id: <UUID>
# Round 2+ — resume that EXACT session (never --last in automation)
codex exec resume <UUID> "Re-review after I addressed points 1 and 3."

Reasoning Effort

  • Default: follow config — do not pass an effort flag. Your config may already set a high tier (e.g. xhigh).
  • Override per call: -c model_reasoning_effort="medium|high|xhigh".
  • Rule of thumb if you must choose: short questions → medium; reviews/plans → high; critical → xhigh.

Long-Running Calls — Background Mode

For calls expected to exceed ~60s (xhigh effort, --base on large diffs, full-repo audits):

  • Invoke via Bash(run_in_background=true) so the main session stays responsive; Claude Code writes the output to a file — read it with Read when the command finishes, or run the command with Monitor to receive output lines as they arrive.
  • Sampling tip: launch 2–3 background runs of the same prompt in parallel — Codex output is non-deterministic, and merging runs surfaces more real issues than one run.
  • Do NOT background short ask/single-file reviews — the realtime reasoning trace is more useful in foreground.
  • ❌ Do NOT invoke Codex via a subagent (Agent tool). Run it from the main session with Bash(run_in_background=true) instead.

User Interface (how the skill is invoked)

/codex-cli ask "question"          # quick question
/codex-cli "question"              # shorter form of ask
/codex-cli reviewplan              # review an implementation plan
/codex-cli review --uncommitted    # review uncommitted changes
/codex-cli review --base main      # review changes vs branch

Map each to the recommended command forms above.

Output Format

Relay Codex feedback faithfully — do not summarize or filter. After each interaction:

=== CODEX FEEDBACK [Round N/MAX] ===
Model: <from header>   Reasoning: <effort>   Status: APPROVED / NEEDS REVISION
[Codex full response]
=== END CODEX FEEDBACK ===

Troubleshooting

SymptomFix
command not found: codexNot installed. which codex should return your install path.
Authentication requiredNot logged in. codex login (account) or codex login --with-api-key (API); verify with codex login status.
model 'xxx' does not existYou passed -m with a name unavailable in your login mode. Drop -m to use the config default.
-m rejected on codex reviewTop-level codex review has no -m. Use -c model="...", or switch to codex exec review.
Specify --uncommitted, --base, or --commitReview needs a target: --uncommitted / --base <branch> / --commit <sha>.
Resume ignored my prior contextYou used --last with concurrent sessions. Resume by explicit <session-id>.
Command hangsYou invoked Codex via a subagent (Agent tool). Run it from the main session with Bash(run_in_background=true).

Verify setup:

which codex && codex --version
codex login status
codex exec "reply OK" --skip-git-repo-check   # header shows active model + sandbox

Security & Privacy

  • Code transmission: your code/prompts are sent to OpenAI for processing.
  • Credentials: stored under ~/.codex/ (auth.json). Keep the directory private.
  • Sensitive code: be mindful when reviewing code with secrets or proprietary logic.
  • See OpenAI's data usage policies.

References

  • OpenAI Models Documentation — model names change; verify against your login mode.
  • Local source of truth for defaults: ~/.codex/config.toml and codex login status.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.