glintline 0.0.0-stage → 0.3.0

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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,266 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.3.0] - 2026-11-15
11
+
12
+ ### Added
13
+
14
+ - Partial steps in `dropWhenNarrow`: `cache:session`, `cache:percent`,
15
+ `context:buffer`, `context:numbers` trim one piece of a widget instead of
16
+ removing it, so a line narrows gradually — e.g. the cache keeps its cold state
17
+ after losing its rates, the context keeps its bar after losing its numbers.
18
+ Each step is also a plain option: `cache.showPercent`,
19
+ `context.showBufferTokens`.
20
+ - `INSTALL.md` — a guided install written for a coding agent rather than a human.
21
+ Hand Claude Code the file's raw URL and it probes the runtime, checks whether an
22
+ OAuth token is present (so it does not propose widgets that would render blank),
23
+ proposes a widget set, merges `statusLine` into `~/.claude/settings.json` without
24
+ discarding existing keys, and verifies the result with a sample payload.
25
+ - `cache.showExpiry` (off by default) — the `cache` widget trails the prompt cache's
26
+ state from the new stdin `prompt_cache` object (Claude Code v2.1.251+): the
27
+ local time a warm cache goes cold (`cache 96% ⟳ 14:49`), or `cold` plus the
28
+ tokens the next request writes back (`cache 96% cold ↑28K`). A clock time
29
+ rather than a countdown, since the line is not redrawn while the session is
30
+ idle. Labels via `cache.expiryLabel` and `cache.coldLabel`.
31
+ - `git.worktree` widget — the linked worktree the session is in (`⎘ feature-xyz`),
32
+ from stdin `workspace.git_worktree`, else a Claude Code worktree session's
33
+ `worktree.name`; hidden in the main checkout. Shares the `git` namespace, so it
34
+ joins the branch with a space rather than a separator. On by default, placed
35
+ before `git.branch`; label via `git.worktreeLabel`.
36
+ - `StatusInput` types cover the rest of the current stdin schema: `fast_mode`,
37
+ `thinking`, `prompt_cache`, `session_name`, `prompt_id`, `workspace.repo`,
38
+ `pr`, `worktree`, `vim`, `agent`, `rate_limits.spend_limit`.
39
+
40
+ ### Changed
41
+
42
+ - Once stdin carries `rate_limits`, its windows are final: one it leaves out
43
+ (the 5-hour window on Ultra plans, which no longer have that limit) is no
44
+ longer filled in from the OAuth API, so `limit5h` hides instead of showing a
45
+ stale `5h: 0%`. Before the session's first response the API is still used.
46
+ - The fast-mode marker (`effort`'s ` fast`, `cost.onlyWhenFast`,
47
+ `extra.onlyWhenActive`) reads stdin `fast_mode`. Parsing `Fast mode ON/OFF`
48
+ out of the transcript remains as the fallback for Claude Code versions that do
49
+ not send it.
50
+
51
+ - The published binary now carries a `#!/usr/bin/env node` shebang instead of
52
+ `bun`, so it installs and runs under plain Node as well. The shebang is what
53
+ picks the runtime — npm and Bun both link `bin` as a symlink to the file
54
+ itself — so a `bun` shebang made the package unusable without Bun installed.
55
+ Nothing in the source needed changing: it was already node-only API. Bun stays
56
+ the fast path via `bunx --bun`, which overrides the shebang.
57
+ - `build` targets `node` rather than `bun`, keeping the bundle free of any
58
+ Bun-specific output. Bun still executes it unchanged.
59
+ - `engines` declares `node: >=22` alongside `bun` — the oldest Node release
60
+ still under support. The code itself needs nothing newer than `fetch`, so the
61
+ floor tracks the support window rather than a language feature.
62
+
63
+ ### Removed
64
+
65
+ - The `peak` widget and its `peak.*` options — the peak / off-peak schedule no
66
+ longer applies. A `peak` left in a config renders nothing.
67
+
68
+ ### Fixed
69
+
70
+ - `dropWhenNarrow` measured lines against the full `COLUMNS`, but Claude Code
71
+ keeps a two-column margin on each side (plus `statusLine.padding`), so a line
72
+ up to four columns too wide was truncated with `…` instead of shedding a
73
+ widget. Lines now fit into `COLUMNS − 2·(2 + statusLinePadding)`; the new
74
+ `statusLinePadding` option mirrors Claude Code's `statusLine.padding`, which
75
+ is not passed to the command.
76
+ - Session cache totals (`cache` with `window: "session"`/`"both"`,
77
+ `cache.tokens`) counted most responses two or three times: Claude Code writes
78
+ one transcript line per content block (thinking, text, each tool call), and
79
+ every line repeats the response's `usage`. Lines sharing a message id now
80
+ count once. The transcript cache schema bumps to v4, so existing scans are
81
+ redone on the next render.
82
+
83
+ ## [0.2.4] - 2026-07-02
84
+
85
+ ### Added
86
+
87
+ - `limit7d.perModel` option. When enabled, `limit7d` shows the active model's
88
+ own weekly cap (e.g. Fable) as the primary value — labeled `7d-<family>` —
89
+ with the general weekly cap trailing dimmed in parens, carrying its own
90
+ burn-rate arrow (`7d-fable 20% ↓↓ (92% ↑↑)`) — the two caps drain at
91
+ different rates, so each gets its own pace hint. The parenthesized percentage
92
+ stays dimmed as the secondary number; only its arrow keeps the usual colors.
93
+ Per-model caps come from the OAuth usage API's `limits[]` array, keyed by
94
+ model family (tolerating renames like "Fable 5"); models without a cap show
95
+ the general `7d`. Off by default, so the default `limit7d` still needs no API.
96
+
97
+ - Top-level `dropWhenNarrow` — widgets to shed, least important first, while a
98
+ rendered line still overflows the terminal. Without it the overflow truncates
99
+ whatever sits at the end of the line (typically the `7d` window); with it the
100
+ listed widgets give way instead, each taking its separator along. The line is
101
+ measured as rendered, so nothing is dropped while it fits. Width comes from
102
+ the `COLUMNS` env var Claude Code exports for status lines (v2.1.153+); when
103
+ it is missing or zero the width counts as unknown and nothing is dropped.
104
+ Width is measured in terminal columns: SGR sequences and combining marks /
105
+ variation selectors take none, CJK and emoji take two. East-Asian "Ambiguous"
106
+ glyphs (`■ ∼ ↓ Σ`) count as one, matching the default of most non-CJK setups.
107
+
108
+ - `GLINTLINE_DUMP_ENV` — writes the width Claude Code passed plus each rendered
109
+ line and its measured columns, for debugging `dropWhenNarrow`.
110
+
111
+ - `cache.window` option for the `cache` widget. The default `"session"` keeps
112
+ the cumulative lifetime hit-rate (summed over the whole transcript), which
113
+ stays high even on a resumed session. `"last"` grades only the most recent
114
+ assistant turn, so the value reflects whether the cache is warm right now and
115
+ honestly drops after a resume re-primes it. `"both"` combines them — the last
116
+ turn (primary, health-colored) followed by the session total marked `Σ` in a
117
+ dimmer color, e.g. `cache 96% Σ91%`.
118
+
119
+ ### Changed
120
+
121
+ - The `model` accent is now per generation, not just per family: opus 5 and
122
+ later render in lime (149) while 4.x keeps the familiar purple (141). The
123
+ override is scoped to its family, so `sonnet 5` / `fable 5` are unaffected.
124
+ - The haiku family accent moved from green (114) to silver (251), freeing the
125
+ green for its health-scale role (limit percentages, git additions, cache).
126
+
127
+ ### Removed
128
+
129
+ - `limit7d-sonnet` widget and its `limit7dSonnet` config — superseded by
130
+ `limit7d.perModel`, which surfaces any model's weekly cap generically.
131
+
132
+ ## [0.2.3] - 2026-06-11
133
+
134
+ ### Fixed
135
+
136
+ - Burn-rate arrows on the `5h`/`7d` widgets no longer go degenerate late in
137
+ the window. The old indicator graded `utilization / elapsed-fraction`, whose
138
+ ceiling is `1/progress`, so `↑↑` was unreachable past the window's midpoint
139
+ (and `↑` past 80% elapsed) exactly when the risk of getting capped is
140
+ highest. Over-pace windows are now graded by the share of the remaining time
141
+ you would spend locked at the cap, which stays meaningful across the whole
142
+ window; under-pace headroom keeps the same projected-landing thresholds.
143
+
144
+ ## [0.2.2] - 2026-06-09
145
+
146
+ ### Added
147
+
148
+ - Dedicated coral accent color for the Fable model family.
149
+
150
+ ### Fixed
151
+
152
+ - Fable model family is recognized, and an unknown family no longer duplicates
153
+ its version number (e.g. "Fable 5" rendered as "fable 5 5").
154
+
155
+ ## [0.2.1] - 2026-06-09
156
+
157
+ ### Fixed
158
+
159
+ - Git: repos with no commits (unborn HEAD) now report staged and untracked
160
+ changes instead of showing clean — staged counts come from `diff --cached`
161
+ and each git query runs independently so one failing doesn't suppress others.
162
+ - Transcript scan no longer permanently drops a record that was observed
163
+ mid-write: line completeness is based on a trailing newline rather than
164
+ guessing from the last character.
165
+ - Effort-level parsing accepts hyphenated/numeric levels (`super-max`), not
166
+ just `[a-z]+` (fallback path; stdin `effort.level` is still preferred).
167
+ - Model version is parsed from dashed ids (`claude-opus-4-8` → `4.8`), so the
168
+ fallback effort clamp no longer demotes `xhigh` when only an id is present.
169
+ - Config merge ignores `__proto__` / `constructor` / `prototype` keys, so a
170
+ crafted settings file can't clobber the config object's prototype.
171
+ - Context read from the transcript fallback now honors the auto-compact window
172
+ / `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`, matching the stdin path's percentage base.
173
+ - Peak-hours countdown is computed from real epoch timestamps, fixing a
174
+ ±1 hour error when the countdown spans a Pacific DST transition.
175
+
176
+ ## [0.2.0] - 2026-06-09
177
+
178
+ ### Changed
179
+
180
+ - **Breaking:** `widgets` is now `string[][]` — an array of lines. Each
181
+ inner array becomes one rendered line, joined by `\n`. The default
182
+ config now ships a second line (`session.id` + `cwd`). Users must
183
+ migrate any `widgets: ["a", "b"]` to `widgets: [["a", "b"]]`.
184
+
185
+ ### Added
186
+
187
+ - `session.id` widget — first 8 chars (configurable via `session.idLength`)
188
+ of the Claude Code session UUID, with optional `session.idLabel` prefix
189
+ (default `#`). Useful for identifying transcripts on disk.
190
+ - `cwd.format` (`"smart"` | `"home"` | `"short"` | `"full"`, default
191
+ `"smart"`) and `cwd.maxLength` (default `40`). `smart` uses a
192
+ home-relative path when it fits in `maxLength`, otherwise truncates
193
+ middle segments with `…`. `short` keeps the previous two-segment
194
+ behavior; `home` shows the full home-relative path; `full` shows the
195
+ absolute path.
196
+ - `limit5h.showBurnRate`, `limit7d.showBurnRate`, `limit7dSonnet.showBurnRate`
197
+ (default `true`) — appends a burn-rate indicator after the percentage:
198
+ `↑↑` / `↑` / `~` / `↓` / `↓↓`, comparing actual utilization to the linear
199
+ pace expected at this point in the window. Shown as `~` (gray) for the
200
+ first 10% of the window and hidden once the window has elapsed. Respects
201
+ the widget's `mono` flag.
202
+ - `model.label`, `effort.label`, `context.label` — optional prefix labels for
203
+ the three unlabeled widgets (defaults `✳`, `∼`, `⊠`). Rendered in
204
+ `lightGray`, matching `5h`/`7d`. Set to an empty string to hide.
205
+ - `model.showEffortIcon` (default `true`) — appends a single-char effort
206
+ icon after the model version/context (e.g. `✳ opus 4.6 1M ≋`). The icon is
207
+ mapped from the current effort level via `effort.icons` (defaults `∼` /
208
+ `≈` / `≋` / `≃` for low / medium / high / max) and colored like the text
209
+ `effort` widget.
210
+
211
+ ### Fixed
212
+
213
+ - Read the active reasoning effort from Claude Code's stdin `effort.level`
214
+ (authoritative — it reflects the `CLAUDE_CODE_EFFORT_LEVEL` env var, the
215
+ `effortLevel` setting, the model default and per-model capping) instead of
216
+ inferring it. Fixes a stale `xhigh` shown at session start when the active
217
+ effort was actually `high`. Falls back to the transcript toggle then
218
+ `settings.json` on Claude Code versions that don't send the field.
219
+ - Clamp `xhigh` effort to `high` on models below 4.7, where only four
220
+ effort levels exist (low / medium / high / max).
221
+
222
+ ## [0.1.0] - 2026-04-16
223
+
224
+ ### Added
225
+
226
+ - Initial public release.
227
+ - Widget-based status line rendering: `model`, `effort`, `cost`, `context`,
228
+ `peak`, `limit5h`, `limit7d`, `limit7d-sonnet`, `extra`, `cache`,
229
+ `cache.tokens`, `git.branch`, `git.diff`, `lines`, `session`, `version`,
230
+ `cwd`, `sep`, `space`.
231
+ - Session-level effort detection via incremental transcript scan (tracks
232
+ `/effort`, `/model … with X effort`, `/fast` toggles).
233
+ - Session-wide cache accounting: transcript scanner sums
234
+ `input_tokens`, `output_tokens`, `cache_creation_input_tokens` and
235
+ `cache_read_input_tokens` across all assistant messages, exposed as
236
+ `cache` (hit rate = `cache_read / (cache_read + cache_creation + input)`)
237
+ and `cache.tokens` (↓ reused / ↑ first-time cache creation).
238
+ - Fast mode detection (`/fast` output) with linked cost display.
239
+ - Anthropic OAuth Usage API integration with stale-while-revalidate cache
240
+ (60s fresh / 24h stale, refreshed by a detached child so the foreground
241
+ render never blocks on the network).
242
+ - Context window bar with optional auto-compact buffer segment
243
+ (`context.showCompactBuffer`). Respects
244
+ `CLAUDE_CODE_AUTO_COMPACT_WINDOW` and `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`.
245
+ - Pacific-Time peak/off-peak (weekdays 5–11 AM PT) with a countdown to the
246
+ next transition.
247
+ - Config loader with deep-merge over defaults, searched in
248
+ `$GLINTLINE_CONFIG`, `~/.config/glintline/settings.json`,
249
+ `~/.config/glintline.json`, `~/.claude/glintline.json`.
250
+ - Per-widget label overrides (`cache.label`, `session.label`,
251
+ `limit5h.label`, `limit7d.label`, `limit7dSonnet.label`, `extra.label`,
252
+ `peak.labelPeak`, `peak.labelOffPeak`); empty string hides the label.
253
+ - Per-widget `mono: true` flag for `peak`, `limit5h`, `limit7d`,
254
+ `limit7dSonnet`, `extra`, `cache` and `session` — disables the
255
+ usage/health color so the widget stops drawing attention based on state.
256
+ - Top-level `calmColors: true` swaps the vivid usage palette for muted
257
+ earth tones (sage 108 / ochre 179 / brick 167) across `context`,
258
+ `5h`/`7d`/`extra` and all progress-bar segments.
259
+ - Bar styles: `square`, `circle`, `bar`, `ascii`, `dots`, plus custom
260
+ `context.barChars: { full, empty }`.
261
+ - `GLINTLINE_DEBUG=1` logs recoverable errors to stderr as
262
+ `[glintline:<scope>]`; silent by default.
263
+ - `GLINTLINE_DUMP_STDIN=<path>` captures raw stdin for fixtures.
264
+ - MIT license, TypeScript strict mode, zero runtime dependencies.
265
+ - Unit test suite (52 tests) covering formatters, peak-hour math, context
266
+ token math, model detection, config merge, and cache hit rate.
package/INSTALL.md ADDED
@@ -0,0 +1,214 @@
1
+ # glintline — guided install
2
+
3
+ **This file is written for a coding agent, not for a human reader.** If you are a
4
+ person, the normal instructions live in [README.md](./README.md); the fastest path is
5
+ `bunx --bun -y glintline@latest` as your `statusLine.command`.
6
+
7
+ If you are an agent: a user has handed you this URL and asked you to install glintline.
8
+ Work through the steps below in order. They tell you what to probe, what to ask, and how
9
+ to verify. Do not skip the verification step — a broken status line fails silently.
10
+
11
+ glintline is a status line for Claude Code. Claude Code runs the configured command on
12
+ every render, pipes a JSON blob into its stdin, and prints whatever comes back on stdout.
13
+
14
+ ---
15
+
16
+ ## Step 1 — Choose the runtime
17
+
18
+ ```bash
19
+ bun --version 2>/dev/null || echo "no bun"
20
+ node --version 2>/dev/null || echo "no node"
21
+ ```
22
+
23
+ Pick the first row that matches:
24
+
25
+ | Found | `statusLine.command` to use | Notes |
26
+ |---|---|---|
27
+ | Bun ≥ 1.1 | `bunx --bun -y glintline@latest` | Fastest (~75ms). `--bun` matters — see below. |
28
+ | Node ≥ 22, no Bun | `glintline`, after `npm install -g glintline` | ~100ms per render. |
29
+ | Node ≥ 22, global install refused | `npx -y glintline@latest` | Works, but `npx` re-resolves the package every render and adds ~200ms. Use only if a global install is not an option. |
30
+ | Neither | **Stop.** | Tell the user glintline needs Bun ≥ 1.1 or Node ≥ 22 and let them install one. |
31
+
32
+ Node 18 and 20 are past end-of-life; the package declares `engines.node: >=22`. An older
33
+ Node will still run the bundle (it needs nothing newer than `fetch`), but npm will warn
34
+ and you should tell the user they are on an unsupported version.
35
+
36
+ The published binary carries a `#!/usr/bin/env node` shebang, which is what makes the
37
+ Node path work at all. It also means plain `bunx glintline` honours that shebang and
38
+ hands the script to Node — so keep `--bun` in the Bun command, or the user silently pays
39
+ the Node startup cost.
40
+
41
+ ## Step 2 — Probe the environment
42
+
43
+ These probes decide which widgets are worth proposing. Run them before asking anything.
44
+
45
+ **Existing status line** — never clobber it blindly:
46
+
47
+ ```bash
48
+ cat ~/.claude/settings.json 2>/dev/null | grep -A3 statusLine || echo "no statusLine configured"
49
+ ```
50
+
51
+ If one is already configured, show the user what it is and ask whether to replace it
52
+ before touching the file.
53
+
54
+ **OAuth token** — gates the `extra` widget and `limit7d.perModel`:
55
+
56
+ ```bash
57
+ # macOS
58
+ security find-generic-password -s "Claude Code-credentials" -w >/dev/null 2>&1 && echo "keychain token: yes" || echo "keychain token: no"
59
+ # any platform
60
+ test -f ~/.claude/.credentials.json && echo "file token: yes" || echo "file token: no"
61
+ ```
62
+
63
+ If neither exists, do **not** propose `extra` or `limit7d.perModel` — they render nothing
64
+ without a token, and a blank segment reads as a bug.
65
+
66
+ **Terminal width** — a two-line layout is a better default on narrow terminals:
67
+
68
+ ```bash
69
+ tput cols
70
+ ```
71
+
72
+ Below ~100 columns, prefer splitting the widgets across two lines.
73
+
74
+ Git needs no probe: `git.worktree`, `git.branch` and `git.diff` hide themselves when
75
+ there is nothing to show, so they are safe to include unconditionally.
76
+
77
+ ## Step 3 — Propose a widget set
78
+
79
+ Ask the user which preset they want, and mention that any of it can be changed later by
80
+ editing one JSON file. Show them what each preset actually renders.
81
+
82
+ **Minimal** — model, effort and the two usage windows:
83
+
84
+ ```json
85
+ { "widgets": [["model", "effort", "limit5h", "limit7d"]] }
86
+ ```
87
+
88
+ **Default** — what glintline ships with; drop `extra` if Step 2 found no token:
89
+
90
+ ```json
91
+ {
92
+ "widgets": [
93
+ ["model", "effort", "context", "limit5h", "limit7d", "extra", "git.worktree", "git.branch", "git.diff"]
94
+ ]
95
+ }
96
+ ```
97
+
98
+ **Two-line** — better under ~100 columns:
99
+
100
+ ```json
101
+ {
102
+ "widgets": [
103
+ ["model", "effort", "context", "limit5h", "limit7d"],
104
+ ["cwd", "git.worktree", "git.branch", "git.diff"]
105
+ ]
106
+ }
107
+ ```
108
+
109
+ Every available widget:
110
+
111
+ | Name | Renders | Needs |
112
+ |---|---|---|
113
+ | `model` | `✳ opus 5 1M ⁖` | — |
114
+ | `effort` | `∼ xhigh`, plus ` fast` in fast mode | — |
115
+ | `context` | `⊠ ■■■□□□□□□■ 153K/450K` | — |
116
+ | `limit5h` / `limit7d` | `5h 22% ↑ ⟳ 2.4h` | stdin `rate_limits` |
117
+ | `extra` | `extra: $8.47/$40 (21%)` | OAuth token |
118
+ | `cache` | `cache 87%`, or `cache 87% ⟳ 14:49` with `showExpiry: true` — when the prompt cache goes cold | transcript; the time needs Claude Code ≥ 2.1.251 |
119
+ | `cache.tokens` | `↓340K ↑12K` | transcript |
120
+ | `cost` | `$0.05` — hidden unless fast mode, or `cost.onlyWhenFast: false` | — |
121
+ | `lines` | `+150/-30` | — |
122
+ | `session` | `⏱ 12m` | — |
123
+ | `session.id` | `# abc12345` | — |
124
+ | `version` | `v2.1.109` | — |
125
+ | `cwd` | `⊕ ~/Work/projects/glintline` | — |
126
+ | `git.worktree` | `⎘ feature-xyz` | a linked git worktree |
127
+ | `git.branch` / `git.diff` | `⎇ main` / `(+10,-2)` | a git repo |
128
+ | `sep` / `space` | literal separator / single space | — |
129
+
130
+ `limit7d` also takes `perModel: true`, which shows the active model's own weekly cap
131
+ (`7d-fable 42% ↓ (3%)`) instead of only the general one. It needs the OAuth token.
132
+
133
+ ## Step 4 — Write the Claude Code settings
134
+
135
+ `~/.claude/settings.json` holds unrelated user settings. Merge, never overwrite, and back
136
+ it up first:
137
+
138
+ ```bash
139
+ mkdir -p ~/.claude
140
+ cp ~/.claude/settings.json ~/.claude/settings.json.bak 2>/dev/null || true
141
+ ```
142
+
143
+ Then merge the one key, substituting the command chosen in Step 1:
144
+
145
+ ```bash
146
+ node -e '
147
+ const fs = require("fs"), os = require("os"), path = require("path");
148
+ const dir = path.join(os.homedir(), ".claude"), p = path.join(dir, "settings.json");
149
+ let s = {}, raw = null;
150
+ try { raw = fs.readFileSync(p, "utf8"); }
151
+ catch (e) { if (e.code !== "ENOENT") throw e; }
152
+ if (raw !== null && raw.trim()) {
153
+ try { s = JSON.parse(raw); }
154
+ catch { console.error("settings.json exists but is not valid JSON — aborting, fix it first"); process.exit(1); }
155
+ }
156
+ s.statusLine = { type: "command", command: "bunx --bun -y glintline@latest" };
157
+ fs.mkdirSync(dir, { recursive: true });
158
+ fs.writeFileSync(p, JSON.stringify(s, null, 2) + "\n");
159
+ console.log("statusLine set to:", s.statusLine.command);
160
+ '
161
+ ```
162
+
163
+ It refuses to run rather than discard a file it cannot parse — an unparseable
164
+ `settings.json` still holds the user's settings. If it aborts, show them the parse error
165
+ and let them repair the file before retrying.
166
+
167
+ ## Step 5 — Write the glintline config
168
+
169
+ Only needed if the user picked something other than the default widget set. First
170
+ existing path wins:
171
+
172
+ 1. `$GLINTLINE_CONFIG`
173
+ 2. `~/.config/glintline/settings.json`
174
+ 3. `~/.config/glintline.json`
175
+ 4. `~/.claude/glintline.json`
176
+
177
+ Use `~/.config/glintline/settings.json` unless the user prefers otherwise. All fields are
178
+ optional and merge over the defaults, so write only what differs — a `widgets` array is
179
+ usually the whole file. Other common knobs: `separator` (default `" │ "`), `calmColors`
180
+ (mute the whole palette), and per-widget blocks like `{ "cache": { "window": "last" } }`.
181
+ `README.md` in the repo documents every field.
182
+
183
+ ## Step 6 — Verify
184
+
185
+ Claude Code will not tell the user if the command fails — glintline exits 0 and prints
186
+ nothing on error, so a mistake looks like an empty status line. Run it yourself with a
187
+ representative payload:
188
+
189
+ ```bash
190
+ echo '{
191
+ "model": { "id": "claude-opus-5", "display_name": "Opus 5" },
192
+ "workspace": { "current_dir": "'"$PWD"'" },
193
+ "session_id": "abc12345-0000-0000-0000-000000000000",
194
+ "version": "2.1.109",
195
+ "cost": { "total_cost_usd": 0.05, "total_duration_ms": 720000 },
196
+ "context_window": { "context_window_size": 200000,
197
+ "current_usage": { "input_tokens": 120000, "cache_read_input_tokens": 30000 } },
198
+ "rate_limits": { "five_hour": { "used_percentage": 22, "resets_at": '"$(($(date +%s)+7200))"' },
199
+ "seven_day": { "used_percentage": 61, "resets_at": '"$(($(date +%s)+259200))"' } }
200
+ }' | bunx --bun -y glintline@latest
201
+ ```
202
+
203
+ Replace the trailing command with whichever one Step 1 selected. You should get one or
204
+ two colored lines. Then confirm:
205
+
206
+ - **Empty output** — rerun with `GLINTLINE_DEBUG=1` prepended; diagnostics go to stderr.
207
+ - **Widgets missing** — expected for ones whose data is absent. `extra` is blank without a
208
+ token, `cost` is hidden unless fast mode is on, `git.*` is blank outside a repo, and
209
+ `cache`/`session` read the transcript, which this synthetic payload has no path to.
210
+ - **Boxes or blanks instead of glyphs** — the terminal font lacks the symbols. Every label
211
+ is configurable, e.g. `{ "model": { "label": "*" }, "cwd": { "label": "" } }`.
212
+
213
+ Finally, tell the user to start a new Claude Code session (or `/config` in a running one)
214
+ to see the result, and where their config file lives so they can tune it.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ivan Lagunovsky
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.