Open Codex
May 4, 2025 ยท View on GitHub
Open Codex CLI
Lightweight coding agent that runs in your terminal
brew tap codingmoh/open-codex && brew install open-codex

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:
- Send your prompt to the Ollama API (local server, e.g. on
localhost:11434) - Return a shell command suggestion (e.g.,
find . -name "*.jpg" -size +10M) - 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
textualorrich - 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.