当地法典
- 作者仓库星标 0
- 作者更新于 2026年8月24日 07:33
- 作者仓库 claude-code-skills
- 领域
- 工程开发
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @daymade · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 需要 · OpenAI
- 兼容的系统
- macOS · Linux · Windows
- 运行环境要求
- Python
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 读取环境变量
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
# Local Codex
Delegate coding tasks to the local OpenAI Codex CLI agent using your ChatGPT Pro subscription (OAuth, no API charges).
## When to Use
- User wants to generate, refactor, or review code via Codex
- User wants to run `codex exec` for non-interactive tasks
- User wants to use Codex's GPT-5.5 agent capabilities
- User mentions "codex", "run codex", "delegate to codex"
## Authentication (OAuth / ChatGPT Pro)
**CRITICAL**: This skill uses OAuth authentication from `~/.codex/auth.json` (ChatGPT Pro flat-rate subscription). **Do NOT set `OPENAI_API_KEY` or pass API keys** — that would switch to pay-per-use billing.
- Codex desktop app and CLI share the same auth cache
- If auth fails, run `codex login` in terminal (browser OAuth flow)
- For auth issues, see [references/oauth-guide.md](references/oauth-guide.md)
## Codex CLI Path
The skill auto-detects Codex CLI in this order:
1. `/Applications/Codex.app/Contents/Resources/codex` (desktop app)
2. `/usr/local/bin/codex` (npm global)
3. `/opt/homebrew/bin/codex` (Homebrew)
4. `~/.npm-global/bin/codex`
5. `which codex` fallback
## Usage Patterns
### 1. Basic exec (single task)
```bash
python3 scripts/codex_wrapper.py exec "<prompt>" [<workdir>] [<model>] [<sandbox>] [<timeout>]
```
Example:
```bash
python3 scripts/codex_wrapper.py exec \
"Write a Python function to calculate fibonacci" \
/tmp \
gpt-5.5 \
workspace-write \
300
```
### 2. Code review
```bash
python3 scripts/codex_wrapper.py review [<workdir>] [<model>] [uncommitted:true] [<timeout>]
```
Example:
```bash
python3 scripts/codex_wrapper.py review \
/path/to/repo \
gpt-5.5 \
true \
300
```
### 3. Check status
```bash
python3 scripts/codex_wrapper.py status
```
## Output Format
The wrapper returns JSON with:
- `success`: bool
- `exit_code`: int
- `elapsed_seconds`: float
- `stdout`: raw output
- `stderr`: error stream (truncated)
- `parsed_jsonl`: parsed JSONL events (if --json)
- `final_message`: extracted assistant text (if available)
## Parameters
| Parameter | Default | Options |
|-----------|---------|---------|
| model | `gpt-5.5` | `gpt-5.5`, `gpt-5.5-pro`, `o4-mini`, etc. |
| sandbox | `workspace-write` | `read-only`, `workspace-write`, `danger-full-access` |
| timeout | 300 | seconds (increase for large tasks) |
| json_output | true | always true (wrapper parses JSONL) |
## Safety Notes
- `sandbox=read-only` for analysis/review tasks (no file writes)
- `sandbox=workspace-write` for code generation (writes to working dir)
- `sandbox=danger-full-access` only when explicitly needed (full system access)
- Always use `--skip-git-repo-check` when running outside git repos
- Use `--ephemeral` for one-off tasks (no session persistence)
## Session Management
For multi-step tasks, Codex supports session resume:
```bash
# First step
codex exec --ephemeral "Step 1..."
# Later
codex exec resume --last "Step 2..."
```
The wrapper currently runs single-shot exec. For multi-step workflows, use raw `codex exec` commands.
## Limitations
- Desktop app must be running for OAuth token refresh (or token must be fresh)
- `codex doctor` is buggy in current version (alpha), avoid using
- Environment variables are NOT inherited into Codex's sandbox; pass via config or prompt
- Large file operations may need increased timeout
章节与文件索引
按说明文件中的顺序排列。
何时使用
身份验证(OAuth / ChatGPT Pro)
Codex CLI 路径
1. 基本exec(单任务)
2. 代码审查
文件/命令 -> codex exec · ~/.codex/auth.json · OPENAI_API_KEY · codex login · /Applications/Codex.app/Contents/Resources/codex · /usr/local/bin/codex · /opt/homebrew/bin/codex · ~/.npm-global/bin/codex
内容校验值 -> 00efa63f9822
当前原文的自动摘译,尚未人工审校。
何时使用
用户希望通过 Codex 生成、重构或审查代码 用户希望运行
codex exec来执行非交互式任务 用户希望使用 Codex 的 GPT-5.5 代理功能 用户提及“codex”、“运行 codex”、“委托给 codex”身份验证(OAuth / ChatGPT Pro)
关键:此技能使用来自
~/.codex/auth.json(ChatGPT Pro 固定费率订阅)的 OAuth 身份验证。不要设置OPENAI_API_KEY或传递 API 密钥 - 这将切换到按使用付费计费。 Codex 桌面应用程序和 CLI 共享相同的身份验证缓存 如果身份验证失败,请在终端中运行codex login(浏览器 OAuth 流程) 对于身份验证问题,请参阅references/oauth-guide.mdCodex CLI 路径
该技能按以下顺序自动检测 Codex CLI:
/Applications/Codex.app/Contents/Resources/codex(桌面应用程序)/usr/local/bin/codex(npm 全局)/opt/homebrew/bin/codex(自制软件)~/.npm-global/bin/codex1. 基本exec(单任务)
示例:
2. 代码审查
示例: