@jiawang1209/codex-hud 0.1.3 → 0.1.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 (2) hide show
  1. package/README.md +83 -267
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,19 +1,20 @@
1
1
  # Codex HUD
2
2
 
3
- Codex HUD is a real-time heads-up display for Codex CLI and Agent CLI workflows, showing context, tools, task progress, git state, and session signals directly in the terminal.
3
+ Codex HUD is a terminal heads-up display for Codex CLI sessions. It surfaces the signals you usually need while working with an agent: model, reasoning effort, project, git branch, context usage, five-hour usage, weekly usage, active tools, and task progress.
4
4
 
5
- The first version ships with two layers:
6
-
7
- - A Codex native status-line setup command that configures the in-window Codex CLI footer.
8
- - A standalone `codex-hud status/watch` CLI core with richer session telemetry for development and future command-backed status-line support.
5
+ ```text
6
+ [gpt-5.5 medium] │ codex-hud git:(main*)
7
+ Context ████░░░░░░ 42% Usage ███████░░░ 68% (3h 24m / 5h) Weekly █████████░ 86% (6d 29m / 7d)
8
+ Todos 2/5 Exec active, Plan x2
9
+ ```
9
10
 
10
- Codex HUD reads local Codex configuration, git metadata, and safe session-log metadata. It uses session event types, tool names, token counters, rate-limit counters, and plan status only; it does not need to display private message bodies.
11
+ Codex HUD is intentionally local-first. It reads Codex config, Codex session metadata, and git metadata from your machine. It does not upload data or need to display private message bodies.
11
12
 
12
13
  ## Install
13
14
 
14
- Follow these steps in order. If you already have Node.js/npm or Codex CLI installed, you can skip that step.
15
+ Follow the steps in order. If Node.js/npm or Codex CLI is already installed, skip that step.
15
16
 
16
- ### 1. Set Up Node.js And npm
17
+ ### 1. Set Up npm
17
18
 
18
19
  Codex HUD is distributed through npm and requires Node.js 18 or newer.
19
20
 
@@ -36,9 +37,7 @@ Windows, PowerShell:
36
37
  winget install OpenJS.NodeJS.LTS
37
38
  ```
38
39
 
39
- You can also use `nvm`, NodeSource, or the installer from nodejs.org if that is how you usually manage Node.js.
40
-
41
- Check that npm is available:
40
+ Verify:
42
41
 
43
42
  ```bash
44
43
  npm --version
@@ -46,44 +45,33 @@ npm --version
46
45
 
47
46
  ### 2. Install Codex CLI
48
47
 
49
- Codex HUD is built for Codex CLI. If `codex --version` already works, skip this step.
50
-
51
- The current official Codex CLI install paths are documented in the
52
- [OpenAI Codex README](https://github.com/openai/codex#installing-and-running-codex-cli).
53
-
54
- macOS or Linux:
48
+ Codex HUD is built for Codex CLI. If this works, skip this step:
55
49
 
56
50
  ```bash
57
- curl -fsSL https://chatgpt.com/codex/install.sh | sh
58
- ```
59
-
60
- Windows, PowerShell:
61
-
62
- ```powershell
63
- powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
51
+ codex --version
64
52
  ```
65
53
 
66
- Cross-platform npm alternative:
54
+ Install Codex CLI with one of the official options:
67
55
 
68
56
  ```bash
69
57
  npm install -g @openai/codex
70
58
  ```
71
59
 
72
- macOS Homebrew alternative:
60
+ macOS users can also use Homebrew:
73
61
 
74
62
  ```bash
75
63
  brew install --cask codex
76
64
  ```
77
65
 
78
- Check that Codex CLI is available:
66
+ See the official OpenAI Codex README for current Codex CLI install options and release binaries:
79
67
 
80
- ```bash
81
- codex --version
68
+ ```text
69
+ https://github.com/openai/codex#installing-and-running-codex-cli
82
70
  ```
83
71
 
84
72
  ### 3. Install Codex HUD
85
73
 
86
- Install the published package from npm:
74
+ Install the package:
87
75
 
88
76
  ```bash
89
77
  npm install -g @jiawang1209/codex-hud
@@ -96,123 +84,50 @@ codex-hud setup
96
84
  codex
97
85
  ```
98
86
 
99
- For the fuller native auto-launch flow where `codex` starts a patched Codex binary with the HUD command wired into the footer, install the local build prerequisites first.
87
+ This is the safest default path. It uses Codex CLI's supported native status-line items.
100
88
 
101
- macOS:
89
+ ## Native Auto-Launch
90
+
91
+ For the fuller HUD experience, `codex-hud install` builds a patched Codex CLI adapter and installs a reversible `codex` shim. After that, the normal `codex` command launches Codex with `codex-hud status` wired into the footer.
92
+
93
+ macOS prerequisites:
102
94
 
103
95
  ```bash
104
96
  brew install git rust tmux
105
97
  ```
106
98
 
107
- Linux, Debian/Ubuntu:
99
+ Linux, Debian/Ubuntu prerequisites:
108
100
 
109
101
  ```bash
110
102
  sudo apt install -y git cargo tmux
111
103
  ```
112
104
 
113
- Then run:
105
+ Install and launch:
114
106
 
115
107
  ```bash
116
108
  codex-hud install
117
109
  codex
118
110
  ```
119
111
 
120
- `codex-hud install` prepares the native Codex HUD bundle and installs a reversible `codex` shim, so you can keep launching Codex with the normal `codex` command. If `codex` still resolves to the official binary after `codex-hud install`, add `~/.local/bin` before the existing Codex location in `PATH`.
121
-
122
- The npm package and built-in Codex status-line setup work on Windows through Node.js. The current `codex-hud install` native auto-launch flow is aimed at macOS/Linux because it builds a patched Codex binary and installs a Unix-style `~/.local/bin/codex` shim.
112
+ If `codex` still resolves to the official binary after install, put `~/.local/bin` before the existing Codex binary in `PATH`.
123
113
 
124
- ## Install From Source
125
-
126
- Use this when you want to test the latest GitHub version:
127
-
128
- ```bash
129
- git clone https://github.com/Jiawang1209/codex-hud.git
130
- cd codex-hud
131
- npm install
132
- npm run build
133
- npm link
134
- codex-hud install
135
- codex
136
- ```
114
+ Windows supports the npm package and `codex-hud setup` through Node.js. The current native auto-launch flow is aimed at macOS/Linux because it builds a patched Codex binary and writes a Unix-style `~/.local/bin/codex` shim.
137
115
 
138
- In this flow, `npm install` installs the project's development dependencies and `npm run build` compiles the TypeScript source into `dist/`. `npm link` makes the local `codex-hud` command available globally on your machine.
116
+ ## HUD Pane Mode
139
117
 
140
- ## Development Usage
118
+ Use a live HUD pane alongside Codex:
141
119
 
142
120
  ```bash
143
- node dist/index.js status
144
- node dist/index.js run
145
- node dist/index.js setup
146
- node dist/index.js doctor
147
- node dist/index.js config
148
- node dist/index.js config init
149
- node dist/index.js watch
150
- ```
151
-
152
- When installed as a package, the binary is:
153
-
154
- ```bash
155
- codex-hud status
156
121
  codex-hud run
157
- codex-hud install
158
- codex-hud native
159
- codex-hud install-shim
160
- codex-hud uninstall-shim
161
- codex-hud setup
162
- codex-hud doctor
163
- codex-hud config
164
- codex-hud config init
165
- codex-hud watch
166
- ```
167
-
168
- Example output:
169
-
170
- ```text
171
- [gpt-5.5 medium] │ codex-hud git:(main*)
172
- Context ████░░░░░░ 42% │ Usage ███████░░░ 68% (3h 24m / 5h) │ Weekly █████████░ 86% (6d 29m / 7d)
173
- Todos 2/5 │ Exec active, Plan x2
174
122
  ```
175
123
 
176
- ## Commands
177
-
178
- - `status`: print one HUD snapshot.
179
- - `watch`: refresh the HUD until interrupted.
180
- - `run`: launch Codex inside a tmux session with a live Codex HUD pane.
181
- - `pane`: internal command used by `run` to refresh the HUD in a small pane.
182
- - `install`: prepare the full native bundle: patched Codex checkout, build, and reversible `codex` shim.
183
- - `native`: launch a patched Codex CLI binary with `codex-hud status` wired into the native footer.
184
- - `install-shim`: install a reversible `codex` wrapper that launches `codex-hud native`.
185
- - `uninstall-shim`: remove the `codex` wrapper installed by `install-shim`.
186
- - `setup`: configure Codex CLI's native in-window `[tui].status_line` with HUD-like items.
187
- - `install-statusline`: alias for `setup`; accepts `--config <file>` for testing or custom Codex config paths.
188
- - `doctor`: check Codex CLI, `codex-hud`, shim, patched Codex, native status command, Codex home, and Node.js readiness.
189
- - `config`: print the effective Codex HUD configuration.
190
- - `config init`: create `~/.codex-hud/config.json` with default settings.
191
-
192
- ## Run Codex With A HUD Pane
193
-
194
- For the closest current approximation of a Claude HUD-like persistent display, use:
195
-
196
- ```bash
197
- codex-hud run
198
- ```
199
-
200
- The default launcher uses `tmux`. It creates a tmux session with Codex in the main pane and a small live HUD pane underneath.
201
-
202
124
  Pass Codex arguments after `--`:
203
125
 
204
126
  ```bash
205
127
  codex-hud run -- --model gpt-5.5 --sandbox danger-full-access
206
128
  ```
207
129
 
208
- Useful wrapper options:
209
-
210
- ```bash
211
- codex-hud run --session my-work --height 5
212
- codex-hud run --dry-run -- --model gpt-5.5
213
- ```
214
-
215
- Terminal launcher options:
130
+ Terminal launchers:
216
131
 
217
132
  ```bash
218
133
  codex-hud run --terminal tmux
@@ -220,205 +135,106 @@ codex-hud run --terminal iterm
220
135
  codex-hud run --terminal terminal
221
136
  ```
222
137
 
223
- Launcher behavior:
224
-
225
- - `tmux`: portable default, works inside Terminal.app, iTerm2, and most terminal emulators.
226
- - `iterm`: macOS iTerm2 AppleScript launcher with a native horizontal split pane.
227
- - `terminal`: macOS Terminal.app AppleScript launcher that opens separate Codex and HUD terminal sessions.
228
-
229
- `codex-hud run` is intentionally a wrapper, not a Codex fork. It keeps Codex HUD usable today while the project tracks native command-backed status-line support upstream.
230
-
231
- ## Auto-Launch With `codex`
232
-
233
- Recommended product install:
234
-
235
- ```bash
236
- npm install -g @jiawang1209/codex-hud
237
- codex-hud install
238
- codex
239
- ```
240
-
241
- `codex-hud install` clones a clean Codex CLI source checkout, applies the bundled native status-line patch, builds the patched Codex binary, and installs the reversible shim below.
242
-
243
- For the Claude HUD-like experience where users keep typing `codex` and the HUD appears automatically, Codex HUD provides a reversible command shim:
244
-
245
- ```bash
246
- codex-hud install-shim --codex /path/to/patched/codex
247
- ```
248
-
249
- The shim writes a `codex` wrapper to `~/.local/bin/codex`. If `~/.local/bin` appears before the official Codex binary in `PATH`, then:
138
+ `tmux` is the portable default. `iterm` and `terminal` are macOS launchers.
250
139
 
251
- ```bash
252
- codex
253
- ```
254
-
255
- will transparently run:
256
-
257
- ```bash
258
- codex-hud native --codex /path/to/patched/codex -- "$@"
259
- ```
260
-
261
- That native launcher starts the patched Codex binary with:
140
+ ## Commands
262
141
 
263
- ```bash
264
- -c 'tui.status_line=["command: codex-hud status"]'
265
- ```
142
+ | Command | Purpose |
143
+ | --- | --- |
144
+ | `codex-hud status` | Print one HUD snapshot. |
145
+ | `codex-hud watch` | Refresh the HUD until interrupted. |
146
+ | `codex-hud run` | Launch Codex with a persistent HUD pane. |
147
+ | `codex-hud setup` | Configure Codex CLI's built-in status line. |
148
+ | `codex-hud install` | Build the native adapter and install the reversible `codex` shim. |
149
+ | `codex-hud native` | Launch a patched Codex binary with command-backed HUD output. |
150
+ | `codex-hud doctor` | Check Codex, Node.js, shim, native adapter, and config readiness. |
151
+ | `codex-hud config` | Print the effective Codex HUD config. |
152
+ | `codex-hud config init` | Create `~/.codex-hud/config.json`. |
266
153
 
267
- Remove it and return to the official `codex` command with:
154
+ Remove the auto-launch shim:
268
155
 
269
156
  ```bash
270
157
  codex-hud uninstall-shim
271
158
  ```
272
159
 
273
- `install-shim` refuses to overwrite an existing non-Codex-HUD `codex` file in the target bin directory. Use `--bin-dir <dir>` for testing or custom PATH layouts.
274
-
275
- ## Codex In-Window Status Line
160
+ ## Configuration
276
161
 
277
- Run:
162
+ Create a config file:
278
163
 
279
164
  ```bash
280
- codex-hud setup
281
- ```
282
-
283
- This writes the closest currently supported Codex CLI native status line to `~/.codex/config.toml`:
284
-
285
- ```toml
286
- [tui]
287
- status_line = [
288
- "model-with-reasoning",
289
- "task-progress",
290
- "current-dir",
291
- "git-branch",
292
- "context-used",
293
- "five-hour-limit",
294
- "weekly-limit",
295
- "fast-mode",
296
- ]
297
- ```
298
-
299
- Restart `codex` after running setup. Inside Codex you can also use `/statusline` to inspect or reorder the built-in items.
300
-
301
- Claude HUD uses Claude Code's command-backed `statusLine` API, where the app invokes a plugin script directly in the prompt footer. Codex CLI 0.131.0 does not currently expose an equivalent command-backed status-line provider; its supported native integration is the fixed `tui.status_line` item list above. Codex HUD keeps the richer CLI renderer in place so it can become the status-line command as soon as Codex exposes that API.
302
-
303
- The upstream feature request draft lives at:
304
-
305
- ```text
306
- docs/upstream/codex-command-backed-statusline.md
165
+ codex-hud config init
307
166
  ```
308
167
 
309
- There is also a local native Codex CLI proof-of-concept patch that adds
310
- `tui.status_line = ["command: codex-hud status"]` support and preserves multi-line HUD output in
311
- the native bottom footer. See:
312
-
313
- ```text
314
- docs/native-codex-cli-patch.md
315
- ```
316
-
317
- ## Configuration
318
-
319
- Codex HUD looks for config at:
168
+ Default path:
320
169
 
321
170
  ```text
322
171
  ~/.codex-hud/config.json
323
172
  ```
324
173
 
325
- Supported MVP keys include `layout`, `refreshIntervalMs`, `pathLevels`, `display`, `colors`, and `codexHome`. The default `layout` is `expanded`, which renders a Claude HUD-like multi-line display. Set `layout` to `compact` for a single-line output.
326
-
327
- The configuration is intentionally close to Claude HUD-style customization. Example:
174
+ Minimal example:
328
175
 
329
176
  ```json
330
177
  {
331
- "language": "zh",
332
- "lineLayout": "expanded",
178
+ "layout": "expanded",
333
179
  "pathLevels": 2,
334
- "elementOrder": ["model", "project", "context", "usage", "weekly", "tools", "todos", "sessionTime"],
335
- "gitStatus": {
336
- "enabled": true,
337
- "showDirty": true,
338
- "showAheadBehind": true,
339
- "showFileStats": false
340
- },
180
+ "elementOrder": ["model", "project", "context", "usage", "weekly", "todos", "tools"],
341
181
  "display": {
342
- "showModel": true,
343
- "showProject": true,
344
- "showGit": true,
345
182
  "showContext": true,
346
183
  "showUsage": true,
347
- "showWeekly": true,
348
- "showTools": true,
349
- "showAgents": true,
350
- "showTodos": true,
351
- "showConfigCounts": true,
352
- "showDuration": true,
353
- "showMemoryUsage": true
184
+ "showWeekly": true
354
185
  },
355
186
  "colors": {
356
187
  "context": "yellow",
357
188
  "usage": "magenta",
358
- "weekly": "magenta",
359
- "warning": "yellow",
360
- "usageWarning": "magenta",
361
- "critical": "red",
362
- "model": "magenta",
363
- "project": "cyan",
364
- "git": "magenta",
365
- "gitBranch": "cyan",
366
- "label": "dim",
367
- "custom": "#FF6600"
189
+ "weekly": "magenta"
368
190
  }
369
191
  }
370
192
  ```
371
193
 
372
- `elementOrder` controls the order of HUD sections. `colors` accepts named ANSI colors such as `cyan`, `magenta`, `yellow`, `red`, `green`, `dim`, and truecolor hex values like `#FF6600`.
194
+ `layout` can be `expanded` or `compact`. `elementOrder` controls HUD section order. Colors support common ANSI names such as `cyan`, `magenta`, `yellow`, `red`, `green`, `gray`, `dim`, and truecolor hex values such as `#FF6600`.
373
195
 
374
- Initialize the config file with:
196
+ ## Install From Source
197
+
198
+ Use this when testing the latest GitHub version:
375
199
 
376
200
  ```bash
377
- codex-hud config init
201
+ git clone https://github.com/Jiawang1209/codex-hud.git
202
+ cd codex-hud
203
+ npm install
204
+ npm run build
205
+ npm link
206
+ codex-hud setup
207
+ ```
208
+
209
+ For native auto-launch from source:
210
+
211
+ ```bash
212
+ codex-hud install
213
+ codex
378
214
  ```
379
215
 
380
216
  ## Data Sources
381
217
 
218
+ Codex HUD reads:
219
+
382
220
  - `~/.codex/config.toml` for model and reasoning effort.
383
- - `~/.codex/sessions/**/*.jsonl` for token counters, rate limits, tool activity, and plan progress. Codex HUD prefers the newest session whose recorded cwd overlaps the current project.
221
+ - `~/.codex/sessions/**/*.jsonl` for token counters, rate limits, tool activity, and plan progress.
384
222
  - `git` for branch and dirty state.
385
223
  - `codex --version` for diagnostics.
386
224
 
387
- Tool activity is summarized from the most recent tool calls rather than the entire session, so long-running sessions stay readable.
388
- Context uses the latest token-count frame's `last_token_usage` when available, falling back to cumulative session usage only when needed.
389
- Progress values render as bars, with terminal colors enabled automatically for TTY output and disabled when `NO_COLOR` is set.
390
-
391
- ## Plugin Wrapper
392
-
393
- The repository includes `.codex-plugin/plugin.json` and `skills/codex-hud/SKILL.md`. The plugin wrapper documents how to install Codex HUD, configure the native Codex status line, and use the richer CLI renderer while Codex command-backed status-line support is not yet available.
225
+ Session parsing uses structured metadata such as event types, tool names, token counters, rate-limit counters, and plan status. It avoids displaying private transcript message bodies.
394
226
 
395
- ## Marketplace
396
-
397
- This repository includes a local marketplace snapshot at:
398
-
399
- ```text
400
- .agents/plugins/marketplace.json
401
- ```
227
+ ## Docs
402
228
 
403
- For local testing, add the marketplace snapshot from this repository and install `codex-hud` from it with Codex plugin commands.
229
+ - [Installation details](docs/installation.md)
230
+ - [Native Codex CLI patch](docs/native-codex-cli-patch.md)
231
+ - [Plugin marketplace wrapper](docs/plugin-marketplace.md)
232
+ - [Release checklist](docs/release.md)
233
+ - [Upstream command-backed status-line proposal](docs/upstream/codex-command-backed-statusline.md)
404
234
 
405
- ```bash
406
- codex plugin marketplace add /path/to/codex-hud
407
- codex plugin list --marketplace codex-hud-marketplace
408
- codex plugin add codex-hud@codex-hud-marketplace
409
- ```
410
-
411
- The marketplace entry uses the standard Codex plugin layout path `./plugins/codex-hud`.
412
-
413
- To install the plugin wrapper from GitHub:
414
-
415
- ```bash
416
- codex plugin marketplace add Jiawang1209/codex-hud --ref main
417
- codex plugin list --marketplace codex-hud-marketplace
418
- codex plugin add codex-hud@codex-hud-marketplace
419
- ```
235
+ ## Plugin Wrapper
420
236
 
421
- The Marketplace plugin is the Codex-side wrapper: it exposes Codex HUD guidance and diagnostics inside Codex. The terminal HUD runtime still needs the `codex-hud` CLI command from either `npm install -g @jiawang1209/codex-hud` after npm publish or the source install flow above.
237
+ This repository includes a Codex plugin wrapper in `.codex-plugin/` and `plugins/codex-hud/`. The plugin gives Codex-side guidance and marketplace metadata; the terminal HUD runtime still comes from the `codex-hud` CLI installed through npm or from source.
422
238
 
423
239
  ## Privacy
424
240
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jiawang1209/codex-hud",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Real-time terminal HUD for Codex CLI and Agent CLI sessions.",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/Jiawang1209/codex-hud",