From codex-cli
Use when preparing, running, debugging, or reviewing non-interactive Codex CLI automation with `codex exec`, `codex exec resume`, `codex review`, JSONL events, output schemas, last-message files, cwd/profile/config flags, sandbox and approval modes, or CI-style agent runs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/codex-cli:codex-exec-automationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill for non-interactive Codex CLI work: `codex exec`, `codex e`,
Use this skill for non-interactive Codex CLI work: codex exec, codex e,
codex exec resume, codex exec review, top-level codex review, JSONL event
streams, final-message capture, output schemas, prompt stdin, images, cwd
selection, and CI-like checks.
From this skill directory, the plugin root is ../...
Before relying on a flag, verify the installed CLI:
python3 ../../scripts/codex_cli_inspector.py --commands exec review doctor --json
If the user supplied a binary path, pass --codex "$CODEX_CLI_PATH".
Build commands from these decisions, in this order:
-C <repo> or run from the intended repository.--sandbox and --ask-for-approval.--profile, -c key=value, --enable, --disable, or --strict-config only when needed.-, or pipe a structured prompt.--json, --output-schema <file>, or -o <file> when automation must parse results.--ephemeral only when the run should not persist session files.Common safe patterns:
codex exec -C "$PROJECT" --sandbox workspace-write --ask-for-approval on-request "Implement the requested fix and run targeted tests."
codex exec -C "$PROJECT" --sandbox read-only --ask-for-approval never --json "Inspect this repo and report risks only."
codex review -C "$PROJECT" --uncommitted
codex review -C "$PROJECT" --base main
codex exec resume --last "Continue from the last non-interactive session and verify the fix."
For prompts that contain shell metacharacters, quotes, YAML, JSON, or long instructions, prefer stdin:
codex exec -C "$PROJECT" --sandbox workspace-write --ask-for-approval on-request - < prompt.md
Use codex review when the user asks for code review findings, changed-file
risk, commit review, base-branch comparison, or uncommitted changes. Choose one
review target:
--uncommitted for staged, unstaged, and untracked changes.--base <branch> for branch diff review.--commit <sha> for one commit.Keep custom review instructions narrow and actionable. Do not ask codex review
to implement fixes; run a separate codex exec task if the user wants changes.
Use --json for event streams and parse line-by-line. Do not load large JSONL
streams into memory as one array.
Use --output-schema <file> when downstream automation needs a typed final
answer. Keep schemas small, explicit, and versioned.
Use -o <file> when the last assistant message should be saved for a report or
handoff. Keep output files inside the intended workspace or an ignored output
directory.
--ignore-user-config, --ignore-rules, or --skip-git-repo-check casually. Explain what safety or reproducibility check is being bypassed.--ask-for-approval never; do not rely on interactive approval prompts.If a run fails:
--help check if the error mentions an unknown flag.codex doctor --summary --ascii for installation/config/auth/runtime issues.codex-log-reader to inspect the rollout file safely.Report the exact command used or recommended, the sandbox and approval policy, the cwd, whether session persistence was enabled, the output file/schema if any, and the verification result or blocker.
npx claudepluginhub xopoko/plug-n-skills --plugin codex-cliGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.