openai-codex-cli
БесплатноБез исполняемых скриптовНе проверенOpenAI Codex CLI is an open-source terminal coding agent that reads your repository, edits files and runs commands inside an OS-enforced sandbox. Use when…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
OpenAI Codex CLI — AI Coding Agent in Your Terminal
Overview
Codex CLI (codex, npm package @openai/codex, Apache-2.0) is OpenAI's coding agent for the terminal. It works in the current directory: it reads files, proposes and applies edits, and runs commands. Two settings decide how much it may do on its own: the sandbox mode (what commands can touch) and the approval policy (when it must stop and ask). The old suggest / auto-edit / full-auto approval modes, config.yaml and codex.md no longer exist: configuration is TOML and project instructions live in AGENTS.md. This skill was checked against codex-cli 0.164.0.
Instructions
Install and sign in
npm install -g @openai/codex # or: brew install --cask codex
codex --version
codex # first run offers "Sign in with ChatGPT"
For headless machines, codex login --device-auth signs in without a local browser, and printenv OPENAI_API_KEY | codex login --with-api-key stores an API key read from stdin. codex login status shows what is active. The standalone installer script is also offered by OpenAI; download and inspect it rather than piping it into a shell.
Interactive and one-shot use
codex # interactive session in this repo
codex "Explain how the billing module is wired" # interactive, with a first prompt
codex -m gpt-6.1-sol "Refactor src/auth to use refresh tokens" # pick a model
codex -i docs/crash-screenshot.png "Why does this error appear?" # attach an image
codex --search "What changed in Prisma 7 migrations?" # live web search
codex resume --last # continue the latest session
Inside a session, /permissions shows or switches the sandbox and approval level.
Sandbox and approvals
| Flag | Values |
|---|---|
-s, --sandbox |
read-only, workspace-write, danger-full-access |
-a, --ask-for-approval |
on-request (model decides when to ask), never |
The usual "automatic" preset is --sandbox workspace-write --ask-for-approval on-request: edits and commands inside the workspace run without asking, while network use or writes outside it need approval. The network is off by default; enable it for the workspace-write sandbox with network_access = true under [sandbox_workspace_write] in the config. approval_policy = "untrusted" and --full-auto have been removed; --approve-for-me routes approval requests to automatic review in a workspace-write sandbox. --dangerously-bypass-approvals-and-sandbox is only for machines that are already isolated (a throwaway CI container).
Configuration: ~/.codex/config.toml
model = "gpt-6.1-sol"
model_reasoning_effort = "medium"
approval_policy = "on-request"
sandbox_mode = "workspace-write"
web_search = "cached" # cached | indexed | live | disabled
[sandbox_workspace_write]
network_access = false
Precedence, highest first: CLI flags and -c key=value overrides, project .codex/config.toml (trusted projects only), profile file ~/.codex/<name>.config.toml chosen with -p <name>, user config, system /etc/codex/config.toml, built-in defaults. One-off override: codex -c model_reasoning_effort="high" "...".
Project instructions: AGENTS.md
Codex reads ~/.codex/AGENTS.md (or AGENTS.override.md) and then every AGENTS.md from the repository root down to the current directory, later files overriding earlier ones, up to 32 KiB by default (project_doc_max_bytes).
# AGENTS.md
## Conventions
- Next.js 15 app router with tRPC and Drizzle; server components by default.
- Run `pnpm test` and `pnpm lint` before finishing a task.
- Never edit files under `drizzle/` by hand; generate migrations with `pnpm db:generate`.
Non-interactive: codex exec
codex exec runs one task and exits. Progress goes to stderr and only the final message to stdout. It defaults to a read-only sandbox, so allow edits explicitly.
codex exec --sandbox workspace-write "Fix the failing tests in packages/api"
codex exec --json "summarize the repo layout" | jq -c 'select(.type=="item.completed")'
codex exec "Extract project metadata" --output-schema ./schema.json -o ./project-metadata.json
git diff main | codex exec "List risky changes in this diff" # piped input is context
Useful flags: --ephemeral (no session files), --ignore-user-config, --skip-git-repo-check, -o <file> (final message to file). codex exec resume --last "also update the docs" continues a run.
Review, MCP, cloud
codex review --uncommitted # review working-tree changes
codex review --base main # review against a branch (also --commit <sha>)
codex mcp add context7 -- npx -y @upstash/context7-mcp # register an MCP server
codex mcp list
codex cloud # browse Codex Cloud tasks, apply results locally
codex apply
Установить openai-codex-cli в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл openai-codex-cli?
OpenAI Codex CLI is an open-source terminal coding agent that reads your repository, edits files and runs commands inside an OS-enforced sandbox. Use when someone asks to "install Codex CLI", "run codex in CI", "use codex exec", "set Codex approval and sandbox modes", "write AGENTS.md for Codex", "review my diff with Codex", or "configure ~/.codex/config.toml".
Как установить скилл openai-codex-cli?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл openai-codex-cli запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic