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 optimized local language models.
No API key is required for the default model. Everything runs locally.
Supports:
- One-shot mode:
open-codex "list all folders"
-> returns shell command - 🧠 Local-only execution using optimized models:
- phi-4-mini (default, no auth required)
- qwen1.5-7b-chat (auth required, enhanced for coding tasks)
- Natural Language to Shell Command (via local models)
- Works on macOS, Linux, and Windows (Python-based)
- Smart command validation and error handling
- Real-time command output streaming
- 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
orrich
- 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
brew tap codingmoh/open-codex
brew install open-codex
pipx install open-codex
git clone https://github.com/codingmoh/open-codex.git
cd open_codex
pip install .
Once installed, you can use the open-codex
CLI globally.
Basic usage with default model (phi-4-mini):
open-codex "list all python files"
Using Qwen model for enhanced coding tasks:
# First, set your Hugging Face token
export HUGGINGFACE_TOKEN=your_token_here
# Then use the Qwen model
open-codex --model qwen-2.5-coder "find python files modified today"
# Or provide token directly
open-codex --model qwen-2.5-coder --hf-token your_token_here "your command"
✅ Codex suggests a validated shell command
✅ Shows real-time command output
✅ Provides clear error messages
✅ Asks for confirmation / add to clipboard / abort
✅ Executes if approved
- Fast and lightweight
- No authentication required
- Optimized for quick shell commands
- Best for basic file operations and system tasks
- Enhanced for coding tasks
- Requires Hugging Face authentication
- Improved command validation
- Better for complex development tasks
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.