# 用于本地 AI 编程 Agent 工作流的 Codex CLI
在终端运行 AI 编程 Agent，检查代码、编辑文件、跑校验并总结 diff。
Agent Readiness Score: 88/100
A primary coding-agent CLI; powerful, but its permissions need repository and shell boundaries.
## Install

- npm: `npm install -g @openai/codex`

## Structured output

Supported output formats: text, patch, json.
Prefer structured output flags such as `--json`, `--format json`, or equivalent when available.

## Commands requiring approval

- Start Codex: `codex` — requires-review; require explicit user approval.
- Run with a prompt: `codex "review the current diff"` — requires-review; require explicit user approval.

## Agent instructions

- Human developer: Give Codex a narrow repo task, then inspect the diff and verification results before committing.

## Safety notes

- Review file edits and shell commands before approving high-impact changes.
- Use repository instructions and scoped worktrees to keep changes bounded.
- Avoid giving unrestricted deploy, billing, or production database access.

## Metadata

Official URL: https://developers.openai.com/codex/cli
GitHub: https://github.com/openai/codex
Docs: https://developers.openai.com/codex/cli
