codex-cli
Skill này làm gì
Skill này chỉ cho AI cách chạy Codex ở chế độ không tương tác như một trợ lý viết code, phân tích hoặc review. Skill dành cho nhà phát triển muốn một mô hình khác thực hiện hoặc kiểm tra tác vụ.
Khi nào nên dùng
- ✓Khi bạn muốn giao một tác vụ viết code hoặc refactor cho Codex và nhận kết quả về.
- ✓Khi bạn muốn một mô hình thứ hai review thay đổi của mình và chỉ ra vấn đề.
- ✓Khi bạn muốn chạy một công việc viết code dài và lặp lại trong khi bạn tiếp tục lên kế hoạch.
Liên kết skill
https://github.com/kortix-ai/suna/blob/dev/.agents/skills/codex-cli/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Giao việc refactor này cho Codex và cho tôi biết nó đã thay đổi gì để tôi kiểm tra.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI viết một tác vụ rõ ràng, chạy codex exec trong thư mục đã chọn với một thiết lập sandbox, lưu thông điệp cuối cùng vào file, rồi tự kiểm tra các file đã thay đổi và chạy lại test.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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>
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 withopenssl 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>
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-dirpaths) 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>
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>
Câu hỏi thường gặp
Codex có toàn quyền truy cập máy tính của tôi không?
Không. Codex chạy trong sandbox với mức được đặt cho từng lần chạy, chẳng hạn chỉ đọc hoặc ghi trong workspace.
Tôi có cần API key của OpenAI không?
Skill nói đăng nhập bằng tài khoản ChatGPT là đủ, và có thể kiểm tra bằng lệnh codex login status.
Có nên tin báo cáo của Codex không?
Không. Skill nói phần tự báo cáo chỉ là một lời khẳng định, nên AI phải tự kiểm tra file và chạy lại test.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 20k
- Vị trí xếp hạng
- #10371
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
claude-code
20kCho phép agent của bạn giao một tác vụ lập trình, review hoặc lên kế hoạch cho Claude Code CLI của Anthropic và lưu kết quả để kiểm tra.
commit-dis
20kCho phép agent của bạn lưu riêng các thay đổi trong cuộc trò chuyện này thành một commit trên nhánh Git hiện tại, không push và không tạo nhánh mới.
composio
20kGiúp agent của bạn dùng Composio để kết nối các ứng dụng như Gmail, Slack, GitHub và Notion, cho agent riêng hoặc cho sản phẩm bạn tự xây.
e2e
20kDạy agent của bạn viết test đầu cuối để điều khiển ứng dụng web hoặc di động bằng mục tiêu viết thường và các kiểm tra chính xác.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.