Langsung ke konten
Skillpedia
Agen20k Β· #10371

codex-cli

Fungsinya

Skill ini menunjukkan kepada AI cara menjalankan Codex dalam mode non-interaktif sebagai pembantu untuk coding, analisis, atau tinjauan. Skill ini ditujukan untuk developer yang ingin model lain mengerjakan atau memeriksa sebuah tugas.

Kapan dipakai

  • βœ“Saat Anda ingin menyerahkan tugas coding atau refactoring ke Codex dan mendapatkan hasilnya kembali.
  • βœ“Saat Anda ingin model kedua meninjau perubahan Anda dan menunjukkan masalah.
  • βœ“Saat Anda ingin menjalankan pekerjaan coding panjang dan berulang sementara Anda tetap merencanakan pekerjaan lainnya.

Link skill

https://github.com/kortix-ai/suna/blob/dev/.agents/skills/codex-cli/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/kortix-ai/suna/blob/dev/.agents/skills/codex-cli/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œSerahkan refactor ini ke Codex dan beri tahu saya apa yang diubahnya agar saya bisa memeriksanya.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

AI menulis tugas yang jelas, menjalankan codex exec di folder yang dipilih dengan pengaturan sandbox, menyimpan pesan akhir ke file, lalu memeriksa sendiri file yang berubah dan pengujiannya.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

<skill name="codex-cli"> <overview> Codex CLI is OpenAI's terminal coding agent (Rust). Its **non-interactive** mode, `codex exec`, makes it a perfect disposable sub-agent: you write the metaprompt, Codex explores/edits/runs commands on its own, and returns a final message you capture and verify. You stay the long-context planner; Codex is the implementer.

The golden rule: Codex's self-report is a claim, not the truth. Always capture its output, then independently verify the artifacts yourself (read the files, re-run the tests) before treating the task as done.

Verified available on this machine: codex-cli 0.137.0, logged in via ChatGPT (no API key needed). Confirm with codex login status. </overview>

<the-core-command> The one shape you'll use most:
codex exec \
  --cd <workdir> \
  --sandbox <read-only|workspace-write|danger-full-access> \
  -o /tmp/codex_<rand>.txt \
  "your metaprompt here"  2>>/tmp/codex_<rand>.log
  • Prompt as the final arg, OR pipe via stdin: echo "$PROMPT" | codex exec - (good for long/generated prompts). If both are given, stdin is appended.
  • -o, --output-last-message <file> β€” writes ONLY Codex's final message to a file. This is your clean capture; read it back, don't scrape the TUI stream.
  • 2>>/tmp/...log β€” Codex streams progress/reasoning to stderr; the final message goes to stdout. Redirect stderr to a log so it doesn't bloat your context. Generate the suffix with openssl rand -hex 4.
  • --cd <dir> β€” Codex's working root. Scope it to the relevant subdir (e.g. apps/api), not the whole monorepo, so it stays focused.
  • --skip-git-repo-check β€” only needed when running outside a git repo.</the-core-command>
<sandbox-tiers> Pick the **least** privilege that lets the task succeed:
  • read-only (default) β€” Codex can read/grep/run read-only commands but cannot edit files or hit the network. Use for review, analysis, planning, "find the bug", second opinions.
  • workspace-write β€” can edit files in --cd (and --add-dir paths) and run commands, but no network by default. Use for real implementation/refactors.
  • danger-full-access β€” no sandbox at all. Avoid; only for throwaway/ephemeral dirs you fully control.

Approvals: in exec mode Codex does not prompt for approvals. For a fully autonomous run with no gating at all, add --dangerously-bypass-approvals-and-sandbox. This is powerful β€” only use it when the user has explicitly authorized autonomous edits AND the --cd is scoped, or when running in an already-sandboxed/throwaway dir. When unsure, ask the user which sandbox tier before running with write access. </sandbox-tiers>

<output-modes> - Default: human-readable, final message on stdout (+ capture with `-o`). - `--json` β€” newline-delimited JSON events on stdout (tool calls, file changes, messages). Use when you want to parse what Codex actually did, not just its prose summary. - `--output-schema <file.json>` β€” force Codex's final response to conform to a JSON Schema. Use for reliable structured hand-back (e.g. a list of findings). - `-m, --model <model>` β€” pin the model. `-i, --image <file>` β€” attach images. `--add-dir <dir>` β€” extra writable roots. `--ephemeral` β€” don't persist the session to disk. </output-modes> <session-resume> Codex sessions are stateful. To continue a prior run with its context intact:
codex exec resume --last "now also update the tests"   # most recent session
codex exec resume <session-id> "..."                   # a specific one

The session id is printed at the start of each exec run. Use resume for multi-turn delegation (draft β†’ refine β†’ fix) instead of re-sending all context. </session-resume>

<delegation-patterns> - **One-shot task** β€” scope `--cd`, `workspace-write`, `-o` capture, verify. - **Second opinion / adversarial review** β€” `read-only`, ask Codex to find bugs or critique your diff. Different model, different blind spots. - **Plan/implement split** β€” you write the spec, Codex implements it, you review. - **Refactor + test split** β€” Codex does the mechanical edit; you write/verify the tests (or vice-versa). Cross-checking catches more. - **Parallel fan-out** β€” for N independent files/tasks, launch N `codex exec` runs, each with its own `-o`/log file. To avoid edit collisions when multiple WRITE runs touch the repo at once, give each its own git worktree (`git worktree add`) and point `--cd` there. - **Cost routing** β€” small mechanical fixes β†’ C
Pertanyaan umum

Apakah Codex mendapat akses penuh ke komputer saya?

Tidak. Codex bekerja di dalam sandbox dengan tingkat yang ditetapkan untuk setiap eksekusi, seperti read-only atau workspace-write.

Apakah saya memerlukan API key OpenAI?

Skill ini menyatakan bahwa login ChatGPT sudah cukup, dan dapat diperiksa dengan perintah codex login status.

Apakah laporan Codex bisa dipercaya?

Tidak sepenuhnya. Skill ini menyatakan bahwa laporan mandirinya adalah klaim, sehingga AI harus memverifikasi file dan menjalankan ulang pengujian sendiri.

Detail

Deskripsi asli dari pembuat

Drive OpenAI's Codex CLI (`codex exec`) as a non-interactive coding sub-agent from inside Claude Code. Load WHENEVER you want to delegate a coding/analysis/refactor task to Codex, get a second opinion / adversarial review from another model, fan out parallel agents across files or worktrees, or run a long mechanical job while you stay the planner. Covers the exact `codex exec` flags, sandbox tiers, output capture, JSON/schema modes, session resume, parallel fan-out, and the mandatory "delegate β†’ capture β†’ independently verify, never trust the self-report" supervision loop.

repo: kortix-ai/suna

Popularitas

Bintang GitHub
20k
Peringkat
#10371
Lisensi
β€”
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa