npx skills add https://github.com/oil-oil/codex --skill codexcodex CLI —— 该脚本能正确处理输出捕获、会话跟踪和实时进度流。[、]、空格或特殊字符的文件路径(例如 --file "src/app/[locale]/page.tsx")。不加引号的话,zsh 会将 [...] 视为通配符模式并报错“未找到匹配项”。--file 将 Codex 指向关键文件 —— 它会直接读取这些文件的当前版本。粘贴内容会浪费令牌,并可能传递过时的代码。脚本路径为:
~/.claude/skills/codex/scripts/ask_codex.sh
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
最小化调用:
~/.claude/skills/codex/scripts/ask_codex.sh "您的自然语言请求"
附带文件上下文:
~/.claude/skills/codex/scripts/ask_codex.sh "重构这些组件以使用新的 API" \
--file src/components/UserList.tsx \
--file src/components/UserDetail.tsx
多轮对话(继续之前的会话):
~/.claude/skills/codex/scripts/ask_codex.sh "同时添加指数退避的重试逻辑" \
--session <来自之前运行的 session_id>
脚本路径为:
~/.claude/skills/codex/scripts/ask_codex.ps1
最小化调用:
& ~/.claude/skills/codex/scripts/ask_codex.ps1 "您的自然语言请求"
附带文件上下文:
& ~/.claude/skills/codex/scripts/ask_codex.ps1 "重构这些组件以使用新的 API" `
-f src/components/UserList.tsx `
-f src/components/UserDetail.tsx
多轮对话(继续之前的会话):
& ~/.claude/skills/codex/scripts/ask_codex.ps1 "同时添加指数退避的重试逻辑" `
-Session <来自之前运行的 session_id>
脚本在成功时打印:
session_id=<thread_id>
output_path=<markdown 文件的路径>
读取 output_path 处的文件以获取 CodeX 的响应。如果计划进行后续调用,请保存 session_id。
--read-only。--file 传递 1-4 个入口点文件作为起始提示。Codex 拥有与 Claude 相同的工具,会自行发现相关文件 —— 无需预先枚举所有内容。对于多步骤项目,使用 --session <id> 来继续完整的对话历史。对于独立的并行任务,使用带有 run_in_background: true 的 Task 工具。
script: tcgetattr/ioctl: Operation not supported on socket (退出码 1):script 命令在启动时使用 tcgetattr 探测 stdin,并且只容忍 ENOTTY/ENODEV 错误。当 Claude Code 通过 socketpair 连接 stdin 时,内核返回的是 EOPNOTSUPP —— 而 script 没有将其列入白名单,因此它会立即退出。脚本通过首先使用 script -q /dev/null true 探测来自动检测此情况,并回退到直接执行。如果仍然看到此错误,请更新到最新版本。ERROR codex_core::codex: failed to load skill ...:Codex 自身安装的某个技能的 YAML 文件已损坏。此警告是无害的,不影响当前任务 —— 忽略它。(no response from codex):Codex 已运行但未产生可读输出。检查 stderr 以获取线索;任务可能触发了沙箱限制。--workspace <path> —— 目标工作区目录(默认为当前目录)。--file <path> —— 将 CodeX 指向关键入口点文件(可重复,相对于工作区或绝对路径)。不要在提示中重复它们的内容。--session <id> —— 恢复之前的会话以进行多轮对话。--model <name> —— 覆盖模型(默认:使用 Codex 配置)。--reasoning <level> —— 推理强度:low、medium、high(默认:medium)。代码审查、调试、复杂重构或根本原因分析时使用 high。--sandbox <mode> —— 覆盖沙箱策略(默认:通过 full-auto 进行工作区写入)。--read-only —— 只读模式,用于纯讨论/分析,不进行文件更改。当使用 --session 恢复之前的对话时,请注意以下限制:
codex exec resume 命令需要一个受 git 信任的目录。它不支持 --skip-git-repo-check。-c/--config 和 --last。以下选项在恢复模式中不受支持:
--sandbox--full-auto--read-only--model--workspace(在原始会话的上下文中恢复)每周安装数
369
仓库
GitHub Stars
70
首次出现
2026年2月24日
安全审计
安装于
gemini-cli315
codex315
kimi-cli315
cursor315
opencode315
amp315
codex CLI directly — the script handles output capture, session tracking, and real-time progress streaming correctly.[, ], spaces, or special characters (e.g. --file "src/app/[locale]/page.tsx"). Without quotes, zsh treats [...] as a glob pattern and fails with "no matches found".--file to point Codex to key files — it reads them directly at their current version. Pasting contents wastes tokens and risks passing stale code.The script path is:
~/.claude/skills/codex/scripts/ask_codex.sh
Minimal invocation:
~/.claude/skills/codex/scripts/ask_codex.sh "Your request in natural language"
With file context:
~/.claude/skills/codex/scripts/ask_codex.sh "Refactor these components to use the new API" \
--file src/components/UserList.tsx \
--file src/components/UserDetail.tsx
Multi-turn conversation (continue a previous session):
~/.claude/skills/codex/scripts/ask_codex.sh "Also add retry logic with exponential backoff" \
--session <session_id from previous run>
The script path is:
~/.claude/skills/codex/scripts/ask_codex.ps1
Minimal invocation:
& ~/.claude/skills/codex/scripts/ask_codex.ps1 "Your request in natural language"
With file context:
& ~/.claude/skills/codex/scripts/ask_codex.ps1 "Refactor these components to use the new API" `
-f src/components/UserList.tsx `
-f src/components/UserDetail.tsx
Multi-turn conversation (continue a previous session):
& ~/.claude/skills/codex/scripts/ask_codex.ps1 "Also add retry logic with exponential backoff" `
-Session <session_id from previous run>
The script prints on success:
session_id=<thread_id>
output_path=<path to markdown file>
Read the file at output_path to get CodeX's response. Save session_id if you plan follow-up calls.
--read-only.--file as starting hints. Codex has the same tools as Claude and will discover related files on its own — no need to enumerate everything upfront.For multi-step projects, use --session <id> to continue with full conversation history. For independent parallel tasks, use the Task tool with run_in_background: true.
script: tcgetattr/ioctl: Operation not supported on socket (exit code 1): the script command probes stdin with tcgetattr at startup and only tolerates ENOTTY/ENODEV errors. When Claude Code connects stdin via a socketpair, the kernel returns EOPNOTSUPP instead — which script doesn't whitelist, so it exits immediately. The script detects this automatically by probing with script -q /dev/null true first and falls back to direct execution. Update to the latest version if you still see this error.ERROR codex_core::codex: failed to load skill ... in stderr: one of Codex's own installed skills has a broken YAML file. This warning is harmless and doesn't affect the current task — ignore it.--workspace <path> — Target workspace directory (defaults to current directory).--file <path> — Point CodeX to key entry-point files (repeatable, workspace-relative or absolute). Don't duplicate their contents in the prompt.--session <id> — Resume a previous session for multi-turn conversation.--model <name> — Override model (default: uses Codex config).--reasoning <level> — Reasoning effort: low, medium, high (default: medium). Use high for code review, debugging, complex refactoring, or root cause analysis.When using --session to resume a previous conversation, note these limitations:
codex exec resume command requires a git-trusted directory. It does not support --skip-git-repo-check.-c/--config and --last. The following options are not supported in resume mode:
--sandbox--full-auto--read-only--model--workspace (resumes in the original session's context)Weekly Installs
369
Repository
GitHub Stars
70
First Seen
Feb 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli315
codex315
kimi-cli315
cursor315
opencode315
amp315
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
138,300 周安装
(no response from codex) in the output file: Codex ran but produced no readable output. Check stderr for clues; the task may have hit a sandbox restriction.--sandbox <mode> — Override sandbox policy (default: workspace-write via full-auto).--read-only — Read-only mode for pure discussion/analysis, no file changes.