词元之母TOK.MOM - 平台充值汇率 1:1 即 1 人民币充值到账 1 美元,支持一个 Key 调用近 600+ 海内外模型,限时特价模型低至 1 折,欢迎上岸!
| 来源 | 内置(默认安装) |
| 路径 | skills/autonomous-ai-agents/codex |
| 版本 | 1.0.0 |
| 作者 | Hermes Agent |
| 许可证 | MIT |
| 平台 | linux, macos, windows |
| 标签 | Coding-Agent, Codex, OpenAI, Code-Review, Refactoring |
| 相关 skill | claude-code, hermes-agent |
npm install -g @openai/codexOPENAI_API_KEY 或通过 Codex CLI 登录流程获取的 Codex OAuth 凭证pty=true — Codex 是一个交互式终端应用model.provider: openai-codex 会在执行 hermes auth add openai-codex 后使用 ~/.hermes/auth.json 中 Hermes 管理的 Codex OAuth。对于独立的 Codex CLI,有效的 CLI OAuth 会话可能存储在 ~/.codex/auth.json 中;不要仅凭缺少 OPENAI_API_KEY 就认为 Codex 认证缺失。terminal(command="codex exec 'Add dark mode toggle to settings'", workdir="~/project", pty=true)terminal(command="cd $(mktemp -d) && git init && codex exec 'Build a snake game in Python'", pty=true)# Start in background with PTY
terminal(command="codex exec --full-auto 'Refactor the auth module'", workdir="~/project", background=true, pty=true)
# Returns session_id
# Monitor progress
process(action="poll", session_id="<id>")
process(action="log", session_id="<id>")
# Send input if Codex asks a question
process(action="submit", session_id="<id>", data="yes")
# Kill if needed
process(action="kill", session_id="<id>")| 标志 | 效果 |
|---|---|
exec "prompt" | 单次执行,完成后退出 |
--full-auto | 沙箱模式,自动批准工作区内的文件变更 |
--yolo | 无沙箱,无需审批(最快,风险最高) |
terminal(command="REVIEW=$(mktemp -d) && git clone https://github.com/user/repo.git $REVIEW && cd $REVIEW && gh pr checkout 42 && codex review --base origin/main", pty=true)# Create worktrees
terminal(command="git worktree add -b fix/issue-78 /tmp/issue-78 main", workdir="~/project")
terminal(command="git worktree add -b fix/issue-99 /tmp/issue-99 main", workdir="~/project")
# Launch Codex in each
terminal(command="codex --yolo exec 'Fix issue #78: <description>. Commit when done.'", workdir="/tmp/issue-78", background=true, pty=true)
terminal(command="codex --yolo exec 'Fix issue #99: <description>. Commit when done.'", workdir="/tmp/issue-99", background=true, pty=true)
# Monitor
process(action="list")
# After completion, push and create PRs
terminal(command="cd /tmp/issue-78 && git push -u origin fix/issue-78")
terminal(command="gh pr create --repo user/repo --head fix/issue-78 --title 'fix: ...' --body '...'")
# Cleanup
terminal(command="git worktree remove /tmp/issue-78", workdir="~/project")# Fetch all PR refs
terminal(command="git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*'", workdir="~/project")
# Review multiple PRs in parallel
terminal(command="codex exec 'Review PR #86. git diff origin/main...origin/pr/86'", workdir="~/project", background=true, pty=true)
terminal(command="codex exec 'Review PR #87. git diff origin/main...origin/pr/87'", workdir="~/project", background=true, pty=true)
# Post results
terminal(command="gh pr comment 86 --body '<review>'", workdir="~/project")pty=true — Codex 是交互式终端应用,没有 PTY 会挂起mktemp -d && git initexec — codex exec "prompt" 运行后干净退出--full-auto — 在沙箱内自动批准变更background=true 并通过 process 工具监控poll/log 监控,对长时运行任务保持耐心