Fully open-source command-line AI assistant inspired by OpenAI Codex, supporting local language models.
| Files | Last commit | Last update |
|---|---|---|
| 1 year ago | ||
| 1 year ago | ||
| 1 year ago | ||
| 1 year ago | ||
| 1 year ago | ||
| 1 year ago | ||
| 1 year ago | ||
| 1 year ago | ||
| 1 year ago | ||
| 1 year ago | ||
| 1 year ago | ||
| 1 year ago |
Translated by AI, submit an issue feedback
开放代码助手
Open Codex 命令行工具
轻量级编码助手,在终端中运行
brew tap codingmoh/open-codex && brew install open-codex

Open Codex 是一款完全开源的命令行 AI 助手,灵感源自 OpenAI Codex,支持 phi-4-mini 等本地语言模型以及与 Ollama 的全面集成。
🧠 100% 本地运行——无需 OpenAI API 密钥。所有功能均支持离线使用。
支持功能
- 单次模式:
open-codex "列出所有文件夹"→ 返回 Shell 命令 - Ollama 集成(例如,支持 LLaMA3、Mistral)
- 原生运行于 macOS、Linux 和 Windows 系统
✨ 特性
- 自然语言转 Shell 命令(通过本地或 Ollama 托管的语言模型)
- 纯本地执行:无数据上传至云端
- 运行任何命令前需确认
- 支持复制到剪贴板/取消/执行选项
- 彩色终端输出,提升可读性
- Ollama 支持:使用
--ollama --model llama3调用高级语言模型
🔍 使用 Ollama 的示例:
open-codex --ollama --model llama3 "find all JPEGs larger than 10MB"
Codex 将执行以下操作:
- 将您的提示发送至 Ollama API(本地服务器,例如
localhost:11434) - 返回 shell 命令建议(例如
find . -name "*.jpg" -size +10M) - 提示您执行、复制或取消
🛠️ 您必须在本地安装并运行 Ollama 才能使用此功能。
🧱 未来计划
- 交互式、上下文感知模式
- 基于
textual或rich的精美 TUI - 完整的交互式聊天模式
- 函数调用支持
- 基于 Whisper 的语音输入
- 命令历史记录与撤销
- 工作流插件系统
📦 安装
🔹 选项 1:通过 Homebrew 安装(推荐 MacOS 用户)
brew tap codingmoh/open-codex
brew install open-codex
🔹 选项 2:通过 pipx 安装(跨平台)
pipx install open-codex
🔹 选项 3:本地克隆并安装
git clone https://github.com/codingmoh/open-codex.git
cd open_codex
pip install .
安装完成后,可在全局使用 open-codex 命令行界面。
🚀 使用示例
▶️ 单次模式
open-codex "untar file abc.tar"
✅ Codex 建议一个 shell 命令
✅ 请求确认 / 添加到剪贴板 / 中止
✅ 如获批准则执行
▶️ 使用 Ollama
open-codex --ollama --model llama3 "delete all .DS_Store files recursively"
🛡️ 安全须知
所有模型均本地运行。命令仅在您明确确认后才会执行。
🧑💻 贡献指南
欢迎提交 PR!无论是想法、问题还是改进建议,我们都非常感谢。
📝 许可证
MIT
❤️ 由 codingmoh 倾注热爱与咖啡因打造。
Introduction
Fully open-source command-line AI assistant inspired by OpenAI Codex, supporting local language models.
Customize your domain