Skip to main content
Delegate coding to OpenAI Codex CLI (features, PRs).

Skill metadata

Reference: full SKILL.md

The following is the complete skill definition that Mibyan loads when this skill is triggered. This is what the agent sees as instructions when the skill is active.

Codex CLI

Delegate coding tasks to Codex via the Mibyan terminal. Codex is OpenAI’s autonomous coding agent CLI.

When to use

  • Building features
  • Refactoring
  • PR reviews
  • Batch issue fixing
Requires the codex CLI and a git repository.

Prerequisites

  • Codex installed: npm install -g @openai/codex
  • OpenAI auth configured: either OPENAI_API_KEY or Codex OAuth credentials from the Codex CLI login flow
  • Must run inside a git repository — Codex refuses to run outside one
  • Use pty=true in terminal calls — Codex is an interactive terminal app
For Mibyan itself, model.provider: openai-codex uses Mibyan-managed Codex OAuth from ~/.mibyan/auth.json after mibyan auth add openai-codex. For the standalone Codex CLI, a valid CLI OAuth session may live under ~/.codex/auth.json; do not treat a missing OPENAI_API_KEY alone as proof that Codex auth is missing.

One-Shot Tasks

For scratch work (Codex needs a git repo):

Background Mode (Long Tasks)

Key Flags

Deprecated: --full-auto still works but the live CLI warns to use --sandbox workspace-write instead.

Mibyan Gateway Caveat

When invoking the Codex CLI from a Mibyan gateway/service context (for example, Telegram-driven agent sessions), Codex workspace-write sandboxing may fail even when the same command works in the user’s interactive shell. A typical symptom is bubblewrap/user-namespace errors such as setting up uid map: Permission denied or loopback: Failed RTM_NEWADDR: Operation not permitted. In that context, prefer:
Use process boundaries as the safety layer instead: explicit workdir, clean git status before launch, narrow task prompts, git diff review, targeted tests, and human/agent confirmation before committing broad changes.

PR Reviews

Clone to a temp directory for safe review:

Parallel Issue Fixing with Worktrees

Batch PR Reviews

Rules

  1. Always use pty=true — Codex is an interactive terminal app and hangs without a PTY
  2. Git repo required — Codex won’t run outside a git directory. Use mktemp -d && git init for scratch
  3. Use exec for one-shots — codex exec "prompt" runs and exits cleanly
  4. --sandbox workspace-write for building — auto-approves changes within the sandbox (--full-auto is deprecated for this)
  5. Background for long tasks — use background=true and monitor with process tool
  6. Don’t interfere — monitor with poll/log, be patient with long-running tasks
  7. Parallel is fine — run multiple Codex processes at once for batch work