Show HN:开放 Codex – 基于开源大型语言模型的 OpenAI Codex 命令行工具
Show HN: Open Codex – OpenAI Codex CLI with open-source LLMs

原始链接: https://github.com/codingmoh/open-codex

Open Codex是一个开源的、命令行AI助手,灵感来源于OpenAI Codex,它在你的终端本地运行,无需API密钥。它使用本地语言模型,例如phi-4-mini,将自然语言翻译成shell命令。支持macOS、Linux和Windows系统。 你可以通过Homebrew (`brew tap codingmoh/open-codex; brew install open-codex`)、pipx或克隆GitHub仓库并本地安装来安装它。安装完成后,使用`open-codex`加上你的自然语言提示即可。 Open Codex提供单次交互模式,根据你的输入建议shell命令,并在执行前询问你是否确认。你可以选择执行、复制到剪贴板或放弃该命令。它具有彩色终端输出,并且正在积极开发中,未来将包含交互式聊天、函数调用、语音输入、命令历史记录和插件系统等功能。欢迎贡献代码。

Codingmoh 创建了 Open Codex,这是一个开源的命令行工具,旨在成为 OpenAI Codex CLI 的本地开源替代方案。由于抽象泄漏和更新中断,在为原始 Codex CLI 分支和维护更改方面遇到困难后,他们使用 Python 从头开始重写了它。Open Codex 旨在与本地大型语言模型 (LLM) 配合使用。目前,它通过 lmstudio-community/Phi-4-mini-instruct-GGUF 支持 phi-4-mini 模型 (GGUF)。该项目旨在具有可扩展性,未来计划支持更多模型、交互式聊天模式和函数调用。Open Codex 可以通过 Homebrew (`brew tap codingmoh/open-codex` 和 `brew install open-codex`) 或 PyPI (`pip install open-codex`) 安装。源代码可在 GitHub 上获取。当前版本仅支持单次模式。

原文

Lightweight coding agent that runs in your terminal

brew tap codingmoh/open-codex

brew install open-codex

Codex demo GIF using: codex "explain this codebase to me"


Open Codex is a fully open-source command-line AI assistant inspired by OpenAI Codex, supporting local language models like phi-4-mini.

No API key is required. Everything runs locally.

Supports:

  • One-shot mode: open-codex "list all folders" -> returns shell command
  • 🧠 Local-only execution using supported OS models (currently phi-4-mini)

  • Natural Language to Shell Command (via local models)
  • Works on macOS, Linux, and Windows (Python-based)
  • Confirmation before execution
  • Add to clipboard / abort / execute prompt
  • One-shot interaction mode (interactive and function-calling coming soon)
  • Colored terminal output for better readability

  • Interactive, context aware mode
  • Fancy TUI with textual or rich
  • Add support for additional OSS Models
  • Full interactive chat mode
  • Function-calling support
  • Voice input via Whisper
  • Command history and undo
  • Plugin system for workflows

🔹 Option 1: Install via Homebrew (Recommended for MacOS)

brew tap codingmoh/open-codex
brew install open-codex

🔹 Option 2: Install via pipx (cross-platform)

🔹 Option 3: Clone & Install locally

git clone https://github.com/codingmoh/open-codex.git
cd open_codex
pip install .

Once installed, you can use the open-codex CLI globally.


open-codex "untar file abc.tar"

✅ Codex suggests a shell command
✅ Asks for confirmation / add to clipboard / abort
✅ Executes if approved


All models run locally. Commands are only executed after explicit approval.


PRs welcome! Ideas, issues, improvements — all appreciated.


MIT


❤️ Built with love and caffeine by codingmoh.

联系我们 contact @ memedata.com