Skip to content
项目

关于

完全开源的命令行 AI 助手,灵感来自 OpenAI Codex,并支持本地语言模型。

开发工具

这些数字如何统计

可以做什么

  • Natural Language → Shell Command (via local or Ollama-hosted LLMs)
  • Local-only execution: no data sent to the cloud
  • Confirmation before running any command
  • Option to copy to clipboard / abort / execute

实测星标增长

24小时
0
7天
0
15天
+1
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Open Codex

Open Codex CLI

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 and full integration with Ollama.

🧠 Runs 100% locally – no OpenAI API key required. Everything works offline.


Supports

  • One-shot mode: open-codex "list all folders" -> returns shell command
  • Ollama integration for (e.g., LLaMA3, Mistral)
  • Native execution on macOS, Linux, and Windows

✨ Features

  • Natural Language → Shell Command (via local or Ollama-hosted LLMs)
  • Local-only execution: no data sent to the cloud
  • Confirmation before running any command
  • Option to copy to clipboard / abort / execute
  • Colored terminal output for better readability
  • Ollama support: use advanced LLMs with --ollama --model llama3

🔍 Example with Ollama:

open-codex --ollama --model llama3 "find all JPEGs larger than 10MB"

Codex will:

  1. Send your prompt to the Ollama API (local server, e.g. on localhost:11434)
  2. Return a shell command suggestion (e.g., find . -name "*.jpg" -size +10M)
  3. Prompt you to execute, copy, or abort

🛠️ You must have Ollama installed and running locally to use this feature.


🧱 Future Plans

  • Interactive, context-aware mode
  • Fancy TUI with textual or rich
  • Full interactive chat mode
  • Function-calling support
  • Whisper-based voice input
  • Command history & undo
  • Plugin system for workflows

📦 Installation

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

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

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

pipx install open-codex

🔹 Option 3: Clone & install locally

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

Once installed, use the open-codex CLI globally.


🚀 Usage Examples

▶️ One-shot mode

open-codex "untar file abc.tar"

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

▶️ Using Ollama

open-codex --ollama --model llama3 "delete all .DS_Store files recursively"

🛡️ Security Notice

All models run locally. Commands are executed only after your explicit confirmation.


🧑‍💻 Contributing

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


📝 License

MIT


❤️ Built with love and caffeine by codingmoh.

探索相关项目

加载中…