
Codex
Operate OpenAI Codex CLI in non-interactive headless environments.
Install
npx skills add XiaomiMiMo/MiMo-Code --skill codex -g -a claude-code -y- Repository
- XiaomiMiMo/MiMo-Code13.7k
- Category
- AI and agents
- Updated
- 3d ago
- License
- MIT
- Context cost
- Mediumabout 2,544 tokens
- Runs scripts
- No, instructions only
What it does
Operate OpenAI Codex CLI in non-interactive headless environments. Load only when the user explicitly authorizes this skill or names Codex / codex. Before any command, confirm the `codex` binary is available; if missing, stop and give install or auth guidance. Covers `codex exec` automation in Bash or PowerShell, native Windows or WSL2, scripts, CI/CD, Docker, Kubernetes, remote servers, agent harnesses, sandbox and approval modes, JSONL events, session resume, and stdin prompts.
Codex CLI
Use Codex CLI as a deterministic, non-interactive worker suitable for automation and agent orchestration.
Operating Rules
- Use
codex exec, not the interactivecodexTUI. - Pass the task as the positional
PROMPTargument. Do not use-pfor the prompt;-pselects a profile. - For ordinary unattended code changes, prefer:
codex exec \
-C /path/to/repo \
--sandbox workspace-write \
--ask-for-approval never \
"<TASK>"
- Use
--yoloonly inside an externally hardened and disposable runner. It disables Codex approvals and sandboxing. - For harnesses and CI, prefer
--jsonplus--output-last-message. - Do not make the run depend on a human answering questions. Resolve ambiguity using repository evidence and conservative defaults.
- Treat credentials as secrets. Inject
CODEX_API_KEYonly into the singlecodex execprocess when possible. - Before giving version-sensitive advice, inspect
codex exec --helpor current official Codex documentation if available. - On Windows, choose one execution environment per task: native PowerShell for Windows toolchains or WSL2 for Linux toolchains. Do not casually mix paths, installations, or authentication across them.
Choose the Execution Mode
Read-only analysis
Use when the task must not modify files:
codex exec \
-C /path/to/repo \
--sandbox read-only \
--ask-for-approval never \
"Analyze the repository and report risks. Do not modify files."
Workspace-scoped implementation
Use as the default for autonomous repository work:
codex exec \
-C /path/to/repo \
--sandbox workspace-write \
--ask-for-approval never \
"Implement the task, run relevant tests, and report unresolved blockers."
Externally isolated unrestricted execution
Use only when the enclosing container, VM, or sandbox enforces the real security boundary:

