推荐的 API: https://nicecode.vip/
转载 [星纬智联技术]
基于原版 Codex ,加了五个核心功能:
功能 一句话说明
Agent Teams 多 Agent 组队协作,任务分发 + 持久化消息
Hooks 18 种生命周期事件拦截,对齐 Claude Code
Anthropic API ( Agent )原生 anthropic-sdk-rs ,直接用 Claude 模型
Web UI codex serve启动浏览器交互,Axum + React + SSE
Remote Control 手机/其他设备远程控制本地 CLI 会话(就是在 TUI 里面启动 serve)
一键安装( macOS / Linux / WSL ):
curl -fsSL
https://raw.githubusercontent.com/stellarlinkco/codex/main/scripts/install.sh | bash
Windows PowerShell:
irm
https://raw.githubusercontent.com/stellarlinkco/codex/main/scripts/install.ps1 |iex
脚本自动检测 OS 和架构,二进制装到~/.local/bin 。验证:
codex --version
# 输出类似:codex 1.2.1
系统要求:macOS 12+ / Ubuntu 22.04+( glibc >= 2.35 )/ Windows 11 WSL2 ,4GB RAM 起步。
codex serve启动 webUI 默认随机端口+安全 Token ,搭配内网穿透可以远程 VibeCoding 。
codex serve
# 指定端口:codex serve --port 8080
# 不自动打开浏览器:codex serve --no-open
对标 Claude Code 的 Sub-Agents 。多个 Agent 组队,各司其职。
worktree: true给 Agent 独立的 Git Worktree ,避免互相踩文件。任务有锁、消息有持久化 Inbox ( JSONL ),进程崩了数据也不丢。
任务流很简单:team_task_list→team_task_claim_next→ 干活 →team_task_complete 。成员之间用team_message点对点聊,team_broadcast群发。
18 种生命周期事件,跟 Claude Code 的 Hooks 基本对齐。
[[hooks.pre_tool_use]]
command= ["python3","/Users/me/.codex/hooks/
check_tool.py"]
timeout=5
[hooks.pre_tool_use.matcher]
tool_name_regex="^(shell|exec)$"
三种 Handler:
Command:跑 Shell 命令,stdin 进 JSON ,stdout 出 JSON
Prompt:让模型判断,返回{"ok": true/false}
Agent:起一个验证 Agent ,能调工具做复杂检查
退出码0放行,2阻断。Hook 输出可以注入上下文、改写工具输入、做权限决策。
Skill 级别也能定义 Hooks ,在
SKILL.md的 YAML frontmatter 里写,作用域限定在 Skill 激活期间。
config.toml里定义 Provider ,支持 openai 和 anthropic:
[model_providers.anthropic]
name="Anthropic"
base_url="
https://api.anthropic.com"
env_key="ANTHROPIC_API_KEY"
wire_api="anthropic"
model_provider="anthropic"
model="claude-sonnet-4-5"
exportANTHROPIC_API_KEY="sk-ant-api03-..."
还能按 Agent 角色分配不同 ProviderArchitect 用 Claude 推理,Developer 用 GPT 写代码,各取所需。
电脑上跑着 CLI ,手机浏览器远程操控。目前是 MVP 阶段,轮询机制。
# TUI 里输入 /remote-control ,handoff 到 serve
/remote-control
会话 handoff 到codex serve ,浏览器接管。心跳 30 秒,断线自动重连(退避 1s → 2s → 4s → 8s → 30s 封顶)。
项目仓库:
https://github.com/stellarlinkco/codex推荐的 API: https://nicecode.vip/