|
1 |
| -# Ghost in the Shell |
| 1 | +# Open Codex |
2 | 2 |
|
3 |
| -**Ghost in the Shell** is a cross-platform command-line assistant that lets you use natural language to run shell commands. Whether you’re on macOS, Linux, or Windows, just type what you want to do — AI Shell will suggest the correct shell command, ask for your confirmation, and optionally execute it. |
| 3 | +<h1 align="center">Open Codex Codex CLI</h1> |
| 4 | +<p align="center">Lightweight coding agent that runs in your terminal</p> |
4 | 5 |
|
5 |
| -Supports both: |
6 |
| -- **One-shot mode**: `ai "archive.tar"` → returns shell command |
7 |
| -- **Interactive mode**: `ai -i` → opens a terminal chat with the AI |
| 6 | +<p align="center"><code> |
| 7 | +brew install brew tap codingmoh/open-codex |
| 8 | +brew install open-codex |
| 9 | +</code></p> |
| 10 | + |
| 11 | + |
8 | 12 |
|
9 | 13 | ---
|
10 | 14 |
|
| 15 | +**Open Codex** is a fully open-source command-line AI assistant inspired by OpenAI Codex, supporting local language models like `phi-4-mini`. |
| 16 | + |
| 17 | +No API key is required. Everything runs locally. |
| 18 | + |
| 19 | +Supports: |
| 20 | +- **One-shot mode**: `open-codex "list all folders"` -> returns shell command |
| 21 | +- 🧠 Local-only execution using supported OS models (currently `phi-4-mini`) |
| 22 | + |
| 23 | +--- |
11 | 24 | ## ✨ Features
|
12 | 25 |
|
13 |
| -- Natural Language to Shell Command (via OpenAI API) |
| 26 | +- Natural Language to Shell Command (via local models) |
14 | 27 | - Works on macOS, Linux, and Windows (Python-based)
|
15 | 28 | - Confirmation before execution
|
16 |
| -- Interactive chat mode for iterative CLI tasks |
| 29 | +- Add to clipboard / abort / execute prompt |
| 30 | +- One-shot interaction mode (interactive and function-calling coming soon) |
17 | 31 | - Colored terminal output for better readability
|
18 |
| -- Optional tmux split-pane workflow (chat left, shell right) |
19 | 32 |
|
20 | 33 | ---
|
21 | 34 |
|
22 |
| -## Installation |
23 |
| - |
24 |
| -### Option 1: Install via Homebrew (recommended for macOS) |
25 |
| - |
26 |
| -```bash |
27 |
| -brew tap codingmoh/ghost-in-the-shell |
28 |
| -brew install ghost-in-the-shell |
29 |
| -``` |
30 |
| - |
31 |
| -### Option 2: Install via pip (any OS) |
32 |
| - |
33 |
| -```bash |
34 |
| -pip install ghost-in-the-shell |
35 |
| -``` |
| 35 | +## 🧱 Future Plans |
36 | 36 |
|
37 |
| -### Option 3: Clone & Install locally |
| 37 | +- Interactive, context aware mode |
| 38 | +- Fancy TUI with `textual` or `rich` |
| 39 | +- Add support for additional OSS Models |
| 40 | +- Full interactive chat mode |
| 41 | +- Function-calling support |
| 42 | +- Voice input via Whisper |
| 43 | +- Command history and undo |
| 44 | +- Plugin system for workflows |
38 | 45 |
|
39 |
| -```bash |
40 |
| -git clone https://github.com/codingmoh/ghost_in_the_shell.git |
41 |
| -cd ghost_in_the_shell |
42 |
| -pip install . |
43 |
| -``` |
| 46 | +--- |
44 | 47 |
|
45 |
| -Now you can use the `ai` command globally. |
46 | 48 |
|
47 |
| ---- |
| 49 | +## 📦 Installation |
48 | 50 |
|
49 |
| -## 🔑 Set OpenAI API Key |
50 | 51 |
|
51 |
| -You need an OpenAI API key to use this tool: |
| 52 | +### 🔹 Option 1: Install via Homebrew (Recommended for MacOS) |
52 | 53 |
|
53 | 54 | ```bash
|
54 |
| -export OPENAI_API_KEY="your-api-key-here" |
| 55 | +brew tap codingmoh/open-codex |
| 56 | +brew install open-codex |
55 | 57 | ```
|
56 | 58 |
|
57 |
| -You can also add this line to your `.bashrc`, `.zshrc`, or `.bash_profile`. |
58 |
| - |
59 |
| ---- |
60 |
| - |
61 |
| -## Usage |
62 | 59 |
|
63 |
| -### One-shot prompt |
| 60 | +### 🔹 Option 2: Install via pipx (cross-platform) |
64 | 61 |
|
65 | 62 | ```bash
|
66 |
| -ai "untar backup.tar.gz" |
| 63 | +pipx install open-codex |
67 | 64 | ```
|
68 | 65 |
|
69 |
| -✅ AI suggests a shell command |
70 |
| -✅ Asks for confirmation |
71 |
| -✅ Runs the command if you approve |
72 |
| - |
73 |
| ---- |
74 |
| - |
75 |
| -### Interactive mode |
| 66 | +### 🔹 Option 3: Clone & Install locally |
76 | 67 |
|
77 | 68 | ```bash
|
78 |
| -ai -i |
| 69 | +git clone https://github.com/codingmoh/open-codex.git |
| 70 | +cd open_codex |
| 71 | +pip install . |
79 | 72 | ```
|
80 | 73 |
|
81 |
| -🧠 Open a chat session right in the terminal. |
82 |
| -💬 Type natural language instructions like: |
83 |
| - |
84 |
| -``` |
85 |
| -You: compress all PNGs in this folder |
86 |
| -AI: tar -czvf images.tar.gz *.png |
87 |
| -``` |
88 | 74 |
|
89 |
| -Type `exit` or `quit` to leave. |
| 75 | +Once installed, you can use the `open-codex` CLI globally. |
90 | 76 |
|
91 | 77 | ---
|
92 | 78 |
|
93 |
| -### 🪟 tmux Split Mode (optional) |
| 79 | +## 🚀 Usage |
94 | 80 |
|
95 |
| -Want to split your terminal into chat + shell? |
| 81 | +### One-shot mode |
96 | 82 |
|
97 | 83 | ```bash
|
98 |
| -tmux |
99 |
| -# Then split horizontally: |
100 |
| -Ctrl-B % |
101 |
| -# In left pane: |
102 |
| -ai -i |
103 |
| -# In right pane: |
104 |
| -use your normal shell |
| 84 | +open-codex "untar file abc.tar" |
105 | 85 | ```
|
106 | 86 |
|
107 |
| ---- |
108 |
| - |
109 |
| -## 🛡️ Security Notice |
110 |
| - |
111 |
| -Always review AI-generated commands before executing them. |
| 87 | +✅ Codex suggests a shell command |
| 88 | +✅ Asks for confirmation / add to clipboard / abort |
| 89 | +✅ Executes if approved |
112 | 90 |
|
113 | 91 | ---
|
114 | 92 |
|
115 |
| -## 🧱 Future Plans |
| 93 | +## 🛡️ Security Notice |
116 | 94 |
|
117 |
| -- Voice input via Whisper |
118 |
| -- Local LLM support (e.g., llama.cpp) |
119 |
| -- Fancy TUI with textual or rich |
120 |
| -- Command history and undo |
121 |
| -- Plugin system for workflows |
| 95 | +All models run locally. Commands are only executed after explicit approval. |
122 | 96 |
|
123 | 97 | ---
|
124 | 98 |
|
125 |
| -## Contributing |
| 99 | +## 🧑💻 Contributing |
126 | 100 |
|
127 | 101 | PRs welcome! Ideas, issues, improvements — all appreciated.
|
128 | 102 |
|
|
134 | 108 |
|
135 | 109 | ---
|
136 | 110 |
|
137 |
| -❤️ Built with love and caffeine by [codingmoh](https://github.com/codingmoh). |
| 111 | +❤️ Built with love and caffeine by [codingmoh](https://github.com/codingmoh). |
| 112 | + |
0 commit comments