Codex 接入指南
📚 Codex + CLI-Anything
Section titled “📚 Codex + CLI-Anything”Codex 是另一个强大的 AI 编程助手,自 2026-03-12 起通过 Skill 集成实现了对 CLI-Anything 的支持。Codex 采用与 OpenClaw 相似的 SKILL 机制,可以自动发现和使用 CLI-Hub 中的软件。
📋 前提条件
Section titled “📋 前提条件”- Codex 已安装并运行
- Python 3.10+
- Node.js 16+(用于 CLI-Hub Meta Skill)
- 目标软件已安装
🚀 快速接入
Section titled “🚀 快速接入”方式一:使用 CLI-Hub Meta Skill(推荐)
Section titled “方式一:使用 CLI-Hub Meta Skill(推荐)”这是最简便的方式,使用 CLI-Hub 的元技能来实现自治发现:
# 安装 cli-hub-meta-skillnpx skills add HKUDS/CLI-Anything --skill cli-hub-meta-skill -g -y安装完成后,Codex 就能自动发现和使用 CLI-Hub 中的软件。
方式二:手动安装特定 CLI
Section titled “方式二:手动安装特定 CLI”# 先创建一个工作目录mkdir -p ~/codex/cli-toolscd ~/codex/cli-tools
# 安装 CLI-Hubpip install cli-anything-hub
# 安装目标 CLIcli-hub install gimpcli-hub install blender💬 使用示例
Section titled “💬 使用示例”自动发现并使用
Section titled “自动发现并使用”User: 帮我把 image.jpg 调整为暖色调,然后导出
Codex:→ 分析需求:需要图片处理软件→ 在 CLI-Hub 中搜索合适的 CLI→ 发现 cli-anything-gimp→ 自动执行: cli-anything-gimp filter apply --input ./image.jpg --name "warm-tone" --intensity 0.7 cli-anything-gimp export file --input ./image-warm.jpg --format JPEG✅ 完成!指定软件操作
Section titled “指定软件操作”User: 用 Blender 渲染 3D 场景
Codex:→ 调用 cli-anything-blender scene render --input ./scene.blend --output ./render.png✅ 渲染完成User: 把 videos/ 目录下的所有 mp4 文件转为 gif
Codex:→ cli-anything-shotcut video convert-batch --input ./videos/ --output ./gifs/ --format gif✅ 转换完成⚙️ 配置选项
Section titled “⚙️ 配置选项”自定义 CLI 路径
Section titled “自定义 CLI 路径”在 Codex 配置文件中添加:
{ "cli-anything": { "enabled": true, "cli_hub_path": "~/.local/bin", "auto_discover": true }}排除特定软件
Section titled “排除特定软件”// 排除不需要的软件{ "cli-anything": { "exclude": ["premium-software"] }}🐛 常见问题
Section titled “🐛 常见问题”Q: Codex 找不到 CLI
Section titled “Q: Codex 找不到 CLI”解决:
# 确保 CLI 在 PATH 中export PATH="$HOME/.local/bin:$PATH"
# 在 Codex 配置中添加路径~/.codex/envQ: Skill 安装失败
Section titled “Q: Skill 安装失败”解决:
# 清除缓存rm -rf ~/.codex/skills/cache
# 重新安装npx skills add HKUDS/CLI-Anything --skill cli-hub-meta-skill -g -y --force