@golba98/codexa 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/README.md +396 -100
  2. package/bin/codexa.js +62 -144
  3. package/package.json +14 -8
  4. package/src/app.tsx +596 -306
  5. package/src/commands/handler.ts +6 -6
  6. package/src/config/buildInfo.ts +2 -2
  7. package/src/config/layeredConfig.ts +1 -1
  8. package/src/config/persistence.ts +10 -0
  9. package/src/config/runtimeConfig.ts +1 -1
  10. package/src/config/settings.ts +8 -16
  11. package/src/config/trustStore.ts +1 -1
  12. package/src/config/updateCheckCache.ts +19 -1
  13. package/src/core/README.md +52 -0
  14. package/src/core/agent/loop.ts +282 -0
  15. package/src/core/agent/protocol.ts +211 -0
  16. package/src/core/agent/tools.ts +414 -0
  17. package/src/core/{codexExecArgs.ts → codex/codexExecArgs.ts} +2 -2
  18. package/src/core/{codexLaunch.ts → codex/codexLaunch.ts} +3 -3
  19. package/src/core/{codexPrompt.ts → codex/codexPrompt.ts} +3 -3
  20. package/src/core/debug/modelStateDebug.ts +34 -0
  21. package/src/core/executables/antigravityExecutable.ts +48 -0
  22. package/src/core/executables/codexExecutable.ts +1 -0
  23. package/src/core/executables/executableResolver.ts +65 -43
  24. package/src/core/perf/renderDebug.ts +10 -6
  25. package/src/core/process/processValidation.ts +9 -5
  26. package/src/core/providerLauncher/launcher.ts +59 -42
  27. package/src/core/providerLauncher/registry.ts +30 -14
  28. package/src/core/providerLauncher/types.ts +11 -9
  29. package/src/core/providerLauncher/workspaceConfig.ts +41 -26
  30. package/src/core/providerRuntime/anthropic.ts +7 -1
  31. package/src/core/providerRuntime/antigravity.ts +305 -0
  32. package/src/core/providerRuntime/claudeCodeDiscovery.ts +268 -22
  33. package/src/core/providerRuntime/claudeCodeDiscoveryDebug.ts +55 -0
  34. package/src/core/providerRuntime/contextMetadata.ts +12 -24
  35. package/src/core/providerRuntime/local.ts +129 -51
  36. package/src/core/providerRuntime/models.ts +22 -11
  37. package/src/core/providerRuntime/registry.ts +58 -31
  38. package/src/core/providerRuntime/types.ts +19 -14
  39. package/src/core/providers/codexSubprocess.ts +2 -2
  40. package/src/core/providers/types.ts +1 -1
  41. package/src/core/{attachments.ts → shared/attachments.ts} +27 -4
  42. package/src/core/{cleanupFastFail.ts → shared/cleanupFastFail.ts} +1 -1
  43. package/src/core/{hollowResponseFormat.ts → shared/hollowResponseFormat.ts} +1 -1
  44. package/src/core/terminal/clearFrameBoundary.ts +814 -0
  45. package/src/core/terminal/frameLock.ts +109 -0
  46. package/src/core/terminal/inkRenderReset.ts +123 -0
  47. package/src/core/terminal/terminalControl.ts +22 -0
  48. package/src/core/terminal/terminalTitle.ts +16 -102
  49. package/src/core/version/channel.ts +23 -0
  50. package/src/core/version/updateCheck.ts +193 -0
  51. package/src/core/{launchContext.ts → workspace/launchContext.ts} +32 -39
  52. package/src/core/{planStorage.ts → workspace/planStorage.ts} +2 -2
  53. package/src/core/{workspaceGuard.ts → workspace/workspaceGuard.ts} +97 -13
  54. package/src/headless/execRunner.ts +2 -2
  55. package/src/index.tsx +43 -89
  56. package/src/session/appSession.ts +10 -7
  57. package/src/session/chatLifecycle.ts +1 -1
  58. package/src/session/liveRenderScheduler.ts +1 -1
  59. package/src/session/types.ts +3 -2
  60. package/src/ui/ActionRequiredBlock.tsx +5 -5
  61. package/src/ui/ActivityBars.tsx +3 -3
  62. package/src/ui/ActivityIndicator.tsx +6 -6
  63. package/src/ui/AgentBlock.tsx +6 -6
  64. package/src/ui/AnimatedStatusText.tsx +1 -1
  65. package/src/ui/AppShell.tsx +670 -719
  66. package/src/ui/AttachmentImportPanel.tsx +8 -8
  67. package/src/ui/AuthPanel.tsx +20 -20
  68. package/src/ui/BottomComposer.tsx +158 -118
  69. package/src/ui/DashCard.tsx +3 -3
  70. package/src/ui/Markdown.tsx +17 -17
  71. package/src/ui/ModelPickerScreen.tsx +222 -42
  72. package/src/ui/ModelReasoningPicker.tsx +15 -15
  73. package/src/ui/Panel.tsx +3 -3
  74. package/src/ui/PlanActionPicker.tsx +6 -6
  75. package/src/ui/PlanReviewPanel.tsx +9 -9
  76. package/src/ui/ProviderPicker.tsx +735 -321
  77. package/src/ui/RunFooter.tsx +3 -3
  78. package/src/ui/RuntimeStatusBar.tsx +108 -0
  79. package/src/ui/SelectionPanel.tsx +8 -4
  80. package/src/ui/SettingsPanel.tsx +9 -9
  81. package/src/ui/Spinner.tsx +1 -1
  82. package/src/ui/TextEntryPanel.tsx +11 -11
  83. package/src/ui/ThinkingBlock.tsx +8 -8
  84. package/src/ui/Timeline.tsx +1625 -1472
  85. package/src/ui/TopHeader.tsx +437 -293
  86. package/src/ui/TranscriptShell.tsx +322 -0
  87. package/src/ui/TurnGroup.tsx +33 -33
  88. package/src/ui/UpdateAvailableCard.tsx +41 -0
  89. package/src/ui/UpdatePromptPanel.tsx +197 -0
  90. package/src/ui/focus.ts +3 -0
  91. package/src/ui/layout.ts +299 -25
  92. package/src/ui/layoutListWindow.ts +145 -0
  93. package/src/ui/logoVariants.ts +103 -0
  94. package/src/ui/modeDisplay.ts +12 -12
  95. package/src/ui/runtimeDisplay.ts +112 -0
  96. package/src/ui/textLayout.ts +15 -4
  97. package/src/ui/theme.tsx +274 -395
  98. package/src/ui/timelineMeasure.ts +218 -136
  99. package/scripts/audit-codexa-capabilities.mjs +0 -466
  100. package/scripts/gen-build-info.mjs +0 -33
  101. package/scripts/smoke-terminal-bench.mjs +0 -35
  102. package/src/appRenderStability.test.ts +0 -131
  103. package/src/commands/handler.test.ts +0 -655
  104. package/src/config/launchArgs.test.ts +0 -189
  105. package/src/config/layeredConfig.test.ts +0 -143
  106. package/src/config/persistence.test.ts +0 -114
  107. package/src/config/runtimeConfig.test.ts +0 -218
  108. package/src/config/settings.test.ts +0 -155
  109. package/src/config/trustStore.test.ts +0 -29
  110. package/src/core/attachments.test.ts +0 -155
  111. package/src/core/auth/codexAuth.test.ts +0 -68
  112. package/src/core/cleanupFastFail.test.ts +0 -76
  113. package/src/core/codex.ts +0 -124
  114. package/src/core/codexExecArgs.test.ts +0 -195
  115. package/src/core/codexLaunch.test.ts +0 -205
  116. package/src/core/codexPrompt.test.ts +0 -252
  117. package/src/core/executables/codexExecutable.test.ts +0 -212
  118. package/src/core/executables/executableResolver.test.ts +0 -129
  119. package/src/core/executables/geminiExecutable.test.ts +0 -116
  120. package/src/core/executables/pathSanityScan.test.ts +0 -47
  121. package/src/core/githubDiagnostics.test.ts +0 -92
  122. package/src/core/hollowResponseFormat.test.ts +0 -58
  123. package/src/core/launchContext.test.ts +0 -157
  124. package/src/core/models/codexCapabilities.test.ts +0 -45
  125. package/src/core/models/codexModelCapabilities.test.ts +0 -246
  126. package/src/core/models/modelSpecs.test.ts +0 -283
  127. package/src/core/perf/renderDebug.test.ts +0 -230
  128. package/src/core/planStorage.test.ts +0 -143
  129. package/src/core/process/CommandRunner.test.ts +0 -105
  130. package/src/core/projectInstructions.test.ts +0 -50
  131. package/src/core/providerLauncher/launcher.test.ts +0 -238
  132. package/src/core/providerLauncher/registry.test.ts +0 -324
  133. package/src/core/providerLauncher/workspaceConfig.test.ts +0 -638
  134. package/src/core/providerRuntime/anthropic.test.ts +0 -1120
  135. package/src/core/providerRuntime/capabilityProfile.test.ts +0 -311
  136. package/src/core/providerRuntime/contextMetadata.test.ts +0 -468
  137. package/src/core/providerRuntime/gemini.test.ts +0 -437
  138. package/src/core/providerRuntime/lmstudio.test.ts +0 -168
  139. package/src/core/providerRuntime/local.test.ts +0 -787
  140. package/src/core/providerRuntime/registry.test.ts +0 -233
  141. package/src/core/providers/codexJsonStream.test.ts +0 -148
  142. package/src/core/providers/codexSubprocess.test.ts +0 -68
  143. package/src/core/providers/codexTranscript.test.ts +0 -284
  144. package/src/core/terminal/startupClear.test.ts +0 -55
  145. package/src/core/terminal/terminalCapabilities.test.ts +0 -93
  146. package/src/core/terminal/terminalControl.test.ts +0 -75
  147. package/src/core/terminal/terminalSanitize.test.ts +0 -22
  148. package/src/core/terminal/terminalSelection.test.ts +0 -42
  149. package/src/core/terminal/terminalTitle.test.ts +0 -328
  150. package/src/core/updateCheck.test.ts +0 -194
  151. package/src/core/updateCheck.ts +0 -172
  152. package/src/core/workspaceActivity.test.ts +0 -163
  153. package/src/core/workspaceGuard.test.ts +0 -151
  154. package/src/core/workspaceRoot.test.ts +0 -23
  155. package/src/exec.test.ts +0 -13
  156. package/src/headless/execArgs.test.ts +0 -147
  157. package/src/headless/execRunner.test.ts +0 -436
  158. package/src/index.test.tsx +0 -620
  159. package/src/session/appSession.test.ts +0 -897
  160. package/src/session/chatLifecycle.test.ts +0 -64
  161. package/src/session/liveRenderScheduler.test.ts +0 -201
  162. package/src/session/planFlow.test.ts +0 -103
  163. package/src/session/planTranscript.test.ts +0 -65
  164. package/src/session/promptRunSchedule.test.ts +0 -36
  165. package/src/ui/ActivityIndicator.test.tsx +0 -58
  166. package/src/ui/AgentBlock.test.ts +0 -6
  167. package/src/ui/AnimatedStatusText.test.ts +0 -16
  168. package/src/ui/AppShell.test.tsx +0 -1776
  169. package/src/ui/AttachmentImportPanel.test.tsx +0 -204
  170. package/src/ui/BottomComposer.test.ts +0 -674
  171. package/src/ui/CodexLogo.tsx +0 -55
  172. package/src/ui/Markdown.test.ts +0 -157
  173. package/src/ui/ModelPickerProviderScope.test.tsx +0 -411
  174. package/src/ui/ModelPickerScreen.test.tsx +0 -99
  175. package/src/ui/ModelPickerState.test.tsx +0 -151
  176. package/src/ui/ModelReasoningPicker.test.tsx +0 -447
  177. package/src/ui/PlanReviewPanel.test.tsx +0 -267
  178. package/src/ui/PromptCardBorder.test.tsx +0 -161
  179. package/src/ui/ProviderPicker.test.tsx +0 -289
  180. package/src/ui/ProviderShortcut.test.tsx +0 -143
  181. package/src/ui/SettingsPanel.test.tsx +0 -233
  182. package/src/ui/StaticTranscriptItem.tsx +0 -56
  183. package/src/ui/Timeline.test.ts +0 -2067
  184. package/src/ui/TimelineNavigation.test.tsx +0 -201
  185. package/src/ui/TopHeader.test.tsx +0 -254
  186. package/src/ui/TurnGroup.test.tsx +0 -365
  187. package/src/ui/busyStatusAnimation.test.ts +0 -30
  188. package/src/ui/commandNormalize.test.ts +0 -142
  189. package/src/ui/diffRenderer.test.ts +0 -102
  190. package/src/ui/focusFlow.test.tsx +0 -1098
  191. package/src/ui/inputBuffer.test.ts +0 -151
  192. package/src/ui/layout.test.ts +0 -146
  193. package/src/ui/modeDisplay.test.ts +0 -42
  194. package/src/ui/runActivityView.test.ts +0 -89
  195. package/src/ui/runLifecycleView.test.tsx +0 -237
  196. package/src/ui/statusRenderIsolation.test.tsx +0 -654
  197. package/src/ui/terminalAnswerFormat.test.ts +0 -19
  198. package/src/ui/textLayout.test.ts +0 -18
  199. package/src/ui/themeFlow.test.ts +0 -53
  200. package/src/ui/timelineMeasureCache.test.ts +0 -986
  201. /package/src/core/{inputDebug.ts → debug/inputDebug.ts} +0 -0
  202. /package/src/core/{clipboard.ts → shared/clipboard.ts} +0 -0
  203. /package/src/core/{githubDiagnostics.ts → shared/githubDiagnostics.ts} +0 -0
  204. /package/src/core/{projectInstructions.ts → workspace/projectInstructions.ts} +0 -0
  205. /package/src/core/{workspaceActivity.ts → workspace/workspaceActivity.ts} +0 -0
  206. /package/src/core/{workspaceRoot.ts → workspace/workspaceRoot.ts} +0 -0
package/README.md CHANGED
@@ -1,31 +1,214 @@
1
1
  # Codexa
2
2
 
3
- A terminal UI (TUI) wrapper around the `codex` CLI. Built with TypeScript, Bun, and Ink (React for terminal rendering). Codexa gives `codex` a richer interactive shell with scrollable conversation history, workspace locking, layered TOML config, themes, and in-app slash commands.
3
+ A terminal UI (TUI) wrapper for coding agents. Built with TypeScript, Bun, and Ink (React for terminal rendering). Codexa routes to OpenAI Codex, Anthropic Claude Code, Google Gemini, and local models — giving each a richer interactive shell with scrollable history, workspace locking, layered TOML config, themes, and in-app slash commands.
4
4
 
5
- ## Prerequisites
5
+ ## Quick Start
6
6
 
7
- - **Bun** required to run locally from source
8
- - **codex CLI** — the underlying agent that Codexa wraps. Must be available on `PATH` or pointed to via `CODEX_EXECUTABLE`
7
+ Fastest path for normal users (OpenAI Codex route):
9
8
 
10
- ## Installation
9
+ 1. **Install Codex CLI** — see [Installing OpenAI Codex CLI](#installing-openai-codex-cli)
10
+ 2. **Authenticate Codex** — run `codex` once and sign in with ChatGPT when prompted
11
+ 3. **Install Codexa** — `npm install -g @golba98/codexa@latest`
12
+ 4. **Run Codexa** — `cd <your-workspace> && codexa`
11
13
 
12
- **Local source install:**
14
+ Verify both are ready:
15
+
16
+ ```
17
+ codex --version
18
+ codexa --version
19
+ ```
20
+
21
+ ## Requirements
22
+
23
+ | For... | Requires |
24
+ |--------|----------|
25
+ | Global install (`codexa` command) | Node.js + npm |
26
+ | Local dev / running from source | [Bun](https://bun.sh) |
27
+ | Codex/OpenAI route | Codex CLI installed and authenticated |
28
+ | Claude/Anthropic route | Claude Code CLI installed and authenticated |
29
+ | Gemini/Google route | Gemini CLI installed and authenticated |
30
+ | Local route | LM Studio (or any OpenAI-compatible server) |
31
+
32
+ ## Installing Codexa
33
+
34
+ ```
35
+ npm install -g @golba98/codexa@latest
36
+ ```
37
+
38
+ Verify:
39
+
40
+ ```
41
+ codexa --version
42
+ ```
43
+
44
+ ## Updating Codexa
45
+
46
+ ```
47
+ npm install -g @golba98/codexa@latest
48
+ ```
49
+
50
+ After updating, confirm the version:
51
+
52
+ ```
53
+ codexa --version
54
+ ```
55
+
56
+ If it still shows the old version, check which binary is active:
57
+
58
+ ```bash
59
+ # Linux/macOS
60
+ which -a codexa
61
+
62
+ # Windows PowerShell
63
+ Get-Command codexa
64
+ ```
65
+
66
+ If the wrong binary is active, see [Troubleshooting](#troubleshooting).
67
+
68
+ ## Tool Overview
69
+
70
+ Codexa and provider CLIs are independent tools with separate version numbers. Updating one does not update the others.
71
+
72
+ | Tool | Purpose | Version check | Update |
73
+ |------|---------|---------------|--------|
74
+ | Codex CLI | OpenAI coding agent | `codex --version` | `codex update` or reinstall |
75
+ | Claude Code CLI | Anthropic coding agent | `claude --version` | `npm install -g @anthropic-ai/claude-code@latest` |
76
+ | Codexa | TUI wrapper / workspace experience | `codexa --version` | `npm install -g @golba98/codexa@latest` |
77
+
78
+ ## Provider CLI Setup
79
+
80
+ Codexa can route to multiple providers. Each provider CLI must be installed and authenticated separately — Codexa does not manage provider authentication.
81
+
82
+ ### Installing OpenAI Codex CLI
83
+
84
+ **Standalone (macOS/Linux):**
85
+
86
+ ```bash
87
+ curl -fsSL https://chatgpt.com/codex/install.sh | sh
88
+ ```
89
+
90
+ **Standalone (Windows):**
13
91
 
14
92
  ```powershell
15
- bun install
16
- npm link
93
+ powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
17
94
  ```
18
95
 
19
- Then run `codexa` from the workspace directory you want to use.
96
+ **npm (all platforms):**
97
+
98
+ ```
99
+ npm install -g @openai/codex
100
+ ```
101
+
102
+ **Homebrew (macOS):**
103
+
104
+ ```
105
+ brew install --cask codex
106
+ ```
107
+
108
+ After installing, run `codex` once and sign in with ChatGPT when prompted, or configure an API key for API key auth.
109
+
110
+ > Codexa does not manage Codex authentication. The Codex route requires an already-authenticated Codex CLI.
111
+
112
+ **Updating Codex CLI:**
113
+
114
+ | Install method | Update command |
115
+ |----------------|----------------|
116
+ | Standalone macOS/Linux | Rerun the `curl` installer |
117
+ | Standalone Windows | Rerun the PowerShell installer |
118
+ | npm | `npm install -g @openai/codex@latest` |
119
+ | Homebrew | `brew upgrade --cask codex` |
120
+
121
+ Preferred self-update (when supported): `codex update`
122
+
123
+ ### Installing Claude Code CLI
124
+
125
+ ```
126
+ npm install -g @anthropic-ai/claude-code
127
+ ```
128
+
129
+ Verify:
130
+
131
+ ```
132
+ claude --version
133
+ ```
20
134
 
21
- ## Usage
135
+ Authenticate — run `claude` once and sign in when prompted:
136
+
137
+ ```
138
+ claude
139
+ ```
140
+
141
+ > Codexa does not manage Claude authentication. The Claude route requires an already-authenticated Claude Code CLI. Codexa routes to the `claude` executable — make sure it is on your PATH and working before switching to the Anthropic provider in Codexa.
142
+
143
+ **Updating Claude Code CLI:**
144
+
145
+ ```
146
+ npm install -g @anthropic-ai/claude-code@latest
147
+ ```
148
+
149
+ ### Installing Gemini CLI
150
+
151
+ Codexa routes to the `gemini` executable. Install the Gemini CLI separately and authenticate per Google's instructions. Once installed and authenticated, Codexa can use it without additional configuration.
152
+
153
+ If the Gemini executable is not on PATH or has a non-standard name, specify it explicitly:
154
+
155
+ ```bash
156
+ # Environment variable
157
+ export GEMINI_EXECUTABLE="/path/to/gemini"
158
+
159
+ # or in .codex/config.toml
160
+ gemini_command_path = "/path/to/gemini"
161
+ ```
162
+
163
+ ### Using Local Models (LM Studio)
164
+
165
+ Codexa can route the Local provider through any OpenAI-compatible server.
166
+
167
+ 1. Start LM Studio and load a model.
168
+ 2. Enable the LM Studio local server.
169
+ 3. Confirm the endpoint is `http://localhost:1234/v1`.
170
+ 4. Open Codexa's provider picker with `/providers`.
171
+ 5. Select `Local`, refresh models if needed, then choose `Use in Codexa`.
172
+
173
+ Environment variable configuration:
174
+
175
+ ```bash
176
+ export CODEXA_LOCAL_BASE_URL="http://localhost:1234/v1"
177
+ export CODEXA_LOCAL_API_KEY="lm-studio"
178
+ export CODEXA_LOCAL_MODEL="google/gemma-4-26b-a4b"
179
+ ```
180
+
181
+ Workspace provider config in `.codexa/providers.json`:
182
+
183
+ ```json
184
+ {
185
+ "providers": {
186
+ "local": {
187
+ "enabled": true,
188
+ "type": "openai-compatible",
189
+ "base_url": "http://localhost:1234/v1",
190
+ "api_key": "lm-studio",
191
+ "default_model": "google/gemma-4-26b-a4b",
192
+ "models": {
193
+ "google/gemma-4-26b-a4b": {
194
+ "contextLength": 8192
195
+ }
196
+ }
197
+ }
198
+ }
199
+ }
200
+ ```
201
+
202
+ `OPENAI_BASE_URL`, `OPENAI_API_BASE`, and `OPENAI_API_KEY` are also accepted for the Local provider only. They do not redirect other routes.
203
+
204
+ ## Running Codexa
22
205
 
23
206
  ### Interactive mode
24
207
 
25
- Launch from the directory you want to use as the workspace:
208
+ Launch from the directory you want as the workspace:
26
209
 
27
- ```powershell
28
- cd "<path-to-your-workspace>"
210
+ ```bash
211
+ cd <your-workspace>
29
212
  codexa
30
213
  ```
31
214
 
@@ -43,7 +226,7 @@ The session is locked to the directory Codexa was launched from.
43
226
 
44
227
  Non-flag arguments are sent as an initial prompt on startup:
45
228
 
46
- ```powershell
229
+ ```bash
47
230
  codexa "explain this codebase"
48
231
  codexa --profile review --model gpt-5.4 "review src/app.tsx"
49
232
  ```
@@ -52,7 +235,7 @@ codexa --profile review --model gpt-5.4 "review src/app.tsx"
52
235
 
53
236
  Run a single prompt non-interactively and exit:
54
237
 
55
- ```powershell
238
+ ```bash
56
239
  codexa exec "refactor src/utils.ts to use async/await"
57
240
  codexa exec --model gpt-5.4-mini --reasoning low "summarize changes in HEAD"
58
241
  codexa exec --timing "run the test suite and fix failures"
@@ -117,6 +300,7 @@ Type `/` in the composer to access in-app commands. Key commands:
117
300
  | `/workspace` | Show locked workspace path |
118
301
  | `/workspace relaunch <path>` | Restart TUI in another directory |
119
302
  | `/auth` · `/auth status` | Auth panel or status probe |
303
+ | `/update check` | Check npm registry for a newer Codexa version |
120
304
  | `/mouse` | Toggle mouse mode (wheel scroll vs. native selection) |
121
305
  | `/verbose` | Toggle verbose output |
122
306
  | `/copy` | Copy last response to clipboard |
@@ -153,7 +337,7 @@ writable_roots = ["/path/to/dir"]
153
337
 
154
338
  # Codexa-specific
155
339
  [codexa]
156
- backend = "codex-subprocess" # codex-subprocess (only active backend in v1)
340
+ backend = "codex-subprocess" # codex-subprocess (default)
157
341
  mode = "full-auto" # suggest | auto-edit | full-auto
158
342
 
159
343
  # Gemini CLI path (if using Gemini)
@@ -175,77 +359,15 @@ sandbox_mode = "read-only"
175
359
 
176
360
  **Example with CLI overrides:**
177
361
 
178
- ```powershell
362
+ ```bash
179
363
  codexa --profile review --config model="gpt-5.4" --config codexa.mode="suggest"
180
364
  ```
181
365
 
182
- ### Gemini CLI Executable
183
-
184
- Codexa resolves the Gemini executable directly by path rather than through shell aliases or wrappers. To specify the Gemini CLI location:
185
-
186
- ```powershell
187
- $env:GEMINI_EXECUTABLE = "C:\Users\you\AppData\Roaming\npm\gemini.cmd"
188
- ```
189
-
190
- or in `config.toml`:
191
-
192
- ```toml
193
- gemini_command_path = "C:\\Users\\you\\AppData\\Roaming\\npm\\gemini.cmd"
194
- ```
195
-
196
- ### Using local models with LM Studio
197
-
198
- Codexa can route the Local provider through OpenAI-compatible local servers such as LM Studio.
199
-
200
- 1. Start LM Studio.
201
- 2. Load a model.
202
- 3. Enable the LM Studio local server.
203
- 4. Confirm the endpoint is `http://localhost:1234/v1`.
204
- 5. Open Codexa's provider picker with `/providers`.
205
- 6. Select `Local`, refresh models if needed, then choose `Use in Codexa`.
206
-
207
- Codexa checks `GET http://localhost:1234/v1/models` and uses the returned model IDs in the Local model picker. If LM Studio returns `google/gemma-4-26b-a4b`, that model appears as a selectable Local model.
208
-
209
- Context length is detected separately from model discovery. Codexa first looks for context metadata returned by the provider, then CLI metadata, then an explicit workspace config override, then exact known registry entries. If no trusted source provides a limit, Codexa shows `Context: Unknown` and does not calculate a context percentage.
210
-
211
- Environment variable configuration:
212
-
213
- ```powershell
214
- $env:CODEXA_LOCAL_BASE_URL = "http://localhost:1234/v1"
215
- $env:CODEXA_LOCAL_API_KEY = "lm-studio"
216
- $env:CODEXA_LOCAL_MODEL = "google/gemma-4-26b-a4b"
217
- ```
218
-
219
- Workspace provider configuration in `.codexa/providers.json`:
220
-
221
- ```json
222
- {
223
- "providers": {
224
- "local": {
225
- "enabled": true,
226
- "type": "openai-compatible",
227
- "base_url": "http://localhost:1234/v1",
228
- "api_key": "lm-studio",
229
- "default_model": "google/gemma-4-26b-a4b",
230
- "models": {
231
- "google/gemma-4-26b-a4b": {
232
- "contextLength": 8192
233
- }
234
- }
235
- }
236
- }
237
- }
238
- ```
239
-
240
- `OPENAI_BASE_URL`, `OPENAI_API_BASE`, and `OPENAI_API_KEY` are also accepted for the Local provider only. They do not redirect OpenAI/Codex, Gemini, or Claude routes.
241
-
242
- Use the `models.<modelId>.contextLength` override only when you know the loaded model/server limit. Values must be positive integers; zero, negative, and non-numeric values are ignored.
243
-
244
366
  ### Project Trust
245
367
 
246
- Project config (`.codex/config.toml`) is only applied when the detected project root is explicitly trusted. Manage trust with:
368
+ Project config (`.codex/config.toml`) is only applied when the detected project root is explicitly trusted:
247
369
 
248
- ```text
370
+ ```
249
371
  /config trust status
250
372
  /config trust on
251
373
  /config trust off
@@ -255,22 +377,20 @@ Untrusted project config is detected but blocked, and shown visibly in `/config`
255
377
 
256
378
  ## Workspace Management
257
379
 
258
- Codexa locks the session to the directory it was launched from. To start in the correct workspace:
380
+ Codexa locks the session to the directory it was launched from:
259
381
 
260
- ```powershell
261
- cd "<path-to-your-workspace>"
382
+ ```bash
383
+ cd <your-workspace>
262
384
  codexa
263
385
  ```
264
386
 
265
387
  To recover from the wrong workspace without restarting manually:
266
388
 
267
- ```text
389
+ ```
268
390
  /workspace relaunch .
269
391
  /workspace relaunch <workspace-path>
270
392
  ```
271
393
 
272
- `/workspace relaunch` restarts the TUI process in the target directory. It does not hot-swap the workspace in the running process.
273
-
274
394
  ## Themes
275
395
 
276
396
  16 built-in themes. Switch with `/theme <name>` or open the picker with `/themes`:
@@ -290,31 +410,207 @@ UI-only preferences are stored in `~/.codexa-settings.json` (separate from runti
290
410
  | Busy loader | `/setting busy-loader <bool>` | `true` · `false` |
291
411
  | Mouse mode | `/mouse` | wheel scroll · native selection |
292
412
 
293
- ## Development
413
+ ## Published vs Local Codexa
294
414
 
295
- ```powershell
296
- bun install # Install dependencies
297
- bun run dev # Start with file watching
415
+ **Published Codexa** (`npm install -g @golba98/codexa@latest`):
416
+ - Installed globally; available as `codexa` anywhere
417
+ - Stable release; updates on demand via npm
418
+ - Use this for daily work
419
+
420
+ **Local Codexa** (`bun run dev` from the repo):
421
+ - Runs directly from the working tree
422
+ - Reflects uncommitted changes immediately (with `--watch`)
423
+ - Header shows `Codexa vX.Y.Z-dev local` so you can tell it apart from the published build
424
+ - Use this for testing new features or contributing
425
+
426
+ > **Gotcha:** When testing local changes, confirm you are running the local build and not the global one. Use `Get-Command codexa` (Windows) or `which -a codexa` (Linux/macOS) to check.
427
+
428
+ ## Local Development
429
+
430
+ **Requirement:** [Bun](https://bun.sh) installed.
431
+
432
+ ```bash
433
+ # Linux/macOS
434
+ cd /path/to/13-Custom-CLI-Normal
435
+ bun install
436
+
437
+ bun run typecheck # Type-check without emit
438
+ bun test # Run all tests
439
+ bun run dev # Start with file watching (development)
298
440
  bun run start # Single run without watching
299
- bun run typecheck # TypeScript type-check (no emit)
441
+ bun run build # Generate build info + typecheck
442
+ ```
443
+
444
+ ```powershell
445
+ # Windows PowerShell
446
+ cd C:\Development\1-JavaScript\13-Custom-CLI-Normal
447
+ bun install
448
+
449
+ bun run typecheck
450
+ bun test
451
+ bun run dev
452
+ bun run start
453
+ bun run build
454
+ ```
455
+
456
+ Dev launches lock the workspace to the directory Bun was invoked from.
457
+
458
+ **Option A — Install a separate `codexa-dev` command (recommended for contributors):**
459
+
460
+ ```
461
+ bun run install:dev-bin
462
+ ```
463
+
464
+ This installs two shims into your npm global bin directory — `codexa-dev` and the short alias `cxd` — both pointing at the local repo. The published `codexa` command is not modified — they coexist.
465
+
466
+ ```bash
467
+ cd <your-workspace>
468
+ codexa-dev # or: cxd
469
+ ```
470
+
471
+ To confirm exactly which file is executing: `CODEXA_DEBUG_LAUNCH=1 codexa-dev`
472
+
473
+ Uninstall by removing the `codexa-dev` and `cxd` shims from your npm global bin directory (`npm prefix -g`).
474
+
475
+ **Option B — Redirect the global `codexa` command to the repo:**
476
+
477
+ ```
478
+ npm link
300
479
  ```
301
480
 
302
- Dev launches lock the workspace to the directory Bun was invoked from. For the normal end-user flow, use `npm link` and run `codexa` from the intended workspace instead.
481
+ This replaces the global `codexa` with a symlink to the repo. Undo with `npm unlink -g @golba98/codexa`.
482
+
483
+ **Refresh the global `codexa` from this checkout** (without publishing to npm):
484
+
485
+ ```
486
+ npm install -g .
487
+ ```
303
488
 
304
489
  ## Testing
305
490
 
306
- ```powershell
491
+ ```bash
307
492
  bun test # Run all tests
308
493
  bun test src/ui/layout.test.ts # Run a specific file or pattern
309
494
  ```
310
495
 
311
496
  Tests are colocated with source files (`*.test.ts` / `*.test.tsx`).
312
497
 
313
- ## Repo Hygiene
498
+ ## Troubleshooting
499
+
500
+ ### `npm install -g @golba98/codexa@latest` installs an older version
501
+
502
+ Run these diagnostics to understand the npm registry state:
503
+
504
+ ```bash
505
+ npm view @golba98/codexa version
506
+ npm view @golba98/codexa versions --json
507
+ npm view @golba98/codexa dist-tags --json
508
+ ```
509
+
510
+ If `dist-tags.latest` points to an older version, the registry may be slow to propagate. Wait a few minutes and retry, or install a specific version explicitly:
511
+
512
+ ```bash
513
+ npm install -g @golba98/codexa@1.0.3
514
+ ```
515
+
516
+ ### `codexa --version` still shows an old version after updating
517
+
518
+ Check which binary is active and what version is installed globally:
519
+
520
+ ```bash
521
+ # Linux/macOS
522
+ which -a codexa
523
+
524
+ # Windows PowerShell
525
+ Get-Command codexa
526
+
527
+ # Check globally installed version
528
+ npm list -g --depth=0 @golba98/codexa
529
+ ```
530
+
531
+ Multiple `codexa` entries from `which -a` means more than one binary exists on PATH. The first one wins. If a local dev build (`codexa-dev` or `npm link`) is ahead of the published binary on PATH, it will shadow the global install.
532
+
533
+ ### Multiple `codexa` binaries on PATH
534
+
535
+ Run `which -a codexa` to see all of them. The first one in the list is what runs. Reorder PATH, or uninstall/unlink the unwanted binary:
536
+
537
+ ```bash
538
+ npm unlink -g @golba98/codexa # remove npm link
539
+ npm uninstall -g @golba98/codexa # remove global install
540
+ ```
541
+
542
+ Then reinstall: `npm install -g @golba98/codexa@latest`
543
+
544
+ ### Installed from a local tarball
545
+
546
+ If you installed from a `.tgz` file rather than from the npm registry, `npm list -g` shows the version from that tarball. To switch to the registry version:
547
+
548
+ ```bash
549
+ npm uninstall -g @golba98/codexa
550
+ npm install -g @golba98/codexa@latest
551
+ ```
552
+
553
+ ### npm global prefix not on PATH
554
+
555
+ Find where npm installs global binaries:
556
+
557
+ ```bash
558
+ npm prefix -g # e.g. /home/you/.local/share/npm
559
+ ```
560
+
561
+ The `bin/` subdirectory of that path must be on your PATH. Add it to `~/.bashrc` or `~/.zshrc`:
562
+
563
+ ```bash
564
+ export PATH="$(npm prefix -g)/bin:$PATH"
565
+ ```
566
+
567
+ Then restart your terminal.
568
+
569
+ ### Local linked build running instead of published package
570
+
571
+ If you ran `npm link` from the repo, `codexa` points at the local source. The header shows `Codexa vX.Y.Z-dev local` in that case. To go back to the published version:
572
+
573
+ ```bash
574
+ npm unlink -g @golba98/codexa
575
+ npm install -g @golba98/codexa@latest
576
+ ```
577
+
578
+ ### Update notice does not appear
579
+
580
+ Codexa checks for updates on startup and caches the result for 6 hours (stored in `~/.codexa-update-check.json`). The update notice only appears when the npm registry `latest` version is newer than the running version.
581
+
582
+ Published npm versions are immutable. Versions before the fixed update checker may not show update notices even when a newer package exists. If in doubt, update directly:
583
+
584
+ ```bash
585
+ npm install -g @golba98/codexa@latest
586
+ ```
587
+
588
+ If you expect a notice but don't see one:
589
+
590
+ 1. Check the current registry state: `npm view @golba98/codexa dist-tags --json`
591
+ 2. Clear the cache to force a fresh check: delete `~/.codexa-update-check.json`, then restart Codexa
592
+ 3. Force an explicit check in-app: `/update check`
593
+ 4. Update checks are disabled for local dev builds (`codexa-dev` / `cxd`)
594
+
595
+ | Symptom | Fix |
596
+ |---------|-----|
597
+ | `codex: command not found` | Install Codex CLI and restart the terminal |
598
+ | `claude: command not found` | Install Claude Code CLI: `npm install -g @anthropic-ai/claude-code` |
599
+ | `codexa: command not found` | Run `npm install -g @golba98/codexa@latest`, or use `bun run dev` from the repo |
600
+ | Codexa still shows old version after update | Check `which -a codexa` — a different binary may be earlier on PATH |
601
+ | Codex updated but Codexa did not | Independent tools — update Codexa: `npm install -g @golba98/codexa@latest` |
602
+ | Codexa updated but Codex did not | Independent tools — update Codex: `codex update` |
603
+ | Local changes not reflected when running `codexa` | You may be running the global binary — use `bun run dev` or `codexa-dev` from the repo |
604
+
605
+ ## Versions
606
+
607
+ See [CHANGELOG.md](CHANGELOG.md) for the full release history.
608
+
609
+ **Current release: v1.0.4**
314
610
 
315
- Local-only files kept out of version control:
611
+ v1.0.4 is an update-notice reliability fix:
612
+ - Older installed versions can detect when npm `latest` is newer
613
+ - `/update check` bypasses stale cache and reports a useful status
614
+ - Failed registry lookups do not get cached as “up to date”
316
615
 
317
- - `node_modules/`
318
- - `.claude/`
319
- - `.env` and other local secret files
320
- - Editor, OS, and cache files
616
+ > Versions before the fixed update checker may not show update notices. Update directly with `npm install -g @golba98/codexa@latest`.