@owloops/claude-powerline 1.22.1 → 1.23.1
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/README.md +215 -189
- package/package.json +2 -1
- package/plugin/.claude-plugin/plugin.json +11 -0
- package/plugin/bin/preview.sh +199 -0
- package/plugin/commands/powerline.md +322 -0
- package/plugin/templates/config-essential.json +36 -0
- package/plugin/templates/config-full.json +55 -0
- package/plugin/templates/config-standard.json +39 -0
- package/plugin/templates/config-tui.json +18 -0
- package/plugin/templates/nerd-fonts-sample.txt +5 -0
package/README.md
CHANGED
|
@@ -107,11 +107,24 @@ Lightweight and fast with no external dependencies to install.
|
|
|
107
107
|
|
|
108
108
|
## Installation
|
|
109
109
|
|
|
110
|
-
### Setup
|
|
111
|
-
|
|
112
110
|
Requires Node.js 18+, Claude Code, and Git 2.0+. For best display, install a [Nerd Font](https://www.nerdfonts.com/) or use `--charset=text` for ASCII-only symbols.
|
|
113
111
|
|
|
114
|
-
|
|
112
|
+
### Setup Wizard (Recommended)
|
|
113
|
+
|
|
114
|
+
The interactive wizard walks you through theme, style, font, segment, and budget selection.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# run inside Claude Code (pick one install method)
|
|
118
|
+
/plugin marketplace add Owloops/claude-powerline # from GitHub
|
|
119
|
+
/plugin install @owloops/claude-powerline@claude-powerline # or from npm
|
|
120
|
+
/powerline
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
The wizard writes `~/.claude/claude-powerline.json` and updates your `settings.json` automatically. Run `/powerline` again any time to reconfigure.
|
|
124
|
+
|
|
125
|
+
### Manual Setup
|
|
126
|
+
|
|
127
|
+
Add to your Claude Code `settings.json`:
|
|
115
128
|
|
|
116
129
|
```json
|
|
117
130
|
{
|
|
@@ -122,15 +135,42 @@ Requires Node.js 18+, Claude Code, and Git 2.0+. For best display, install a [Ne
|
|
|
122
135
|
}
|
|
123
136
|
```
|
|
124
137
|
|
|
125
|
-
|
|
138
|
+
Start a Claude session and the statusline appears at the bottom.
|
|
126
139
|
|
|
127
140
|

|
|
128
141
|
|
|
129
142
|
Using `npx` automatically downloads and runs the latest version without manual updates.
|
|
130
143
|
|
|
131
|
-
##
|
|
144
|
+
## Styles
|
|
145
|
+
|
|
146
|
+
<img src="images/claude-powerline-styles.png" alt="Claude Powerline Styles" width="600">
|
|
147
|
+
|
|
148
|
+
- **minimal** -- Segments separated by spaces, no decorations
|
|
149
|
+
- **powerline** -- Arrow-shaped separators between segments (best with Nerd Font)
|
|
150
|
+
- **capsule** -- Rounded pill-shaped segments (best with Nerd Font)
|
|
151
|
+
- **tui** -- Bordered panel with responsive multi-line layout. TUI mode is **opinionated**: it always displays all data regardless of segment configuration. Only theme, charset, and budget thresholds are respected.
|
|
152
|
+
|
|
153
|
+
<details>
|
|
154
|
+
<summary><h2>Configuration</h2></summary>
|
|
155
|
+
|
|
156
|
+
**Config locations** (in priority order):
|
|
157
|
+
|
|
158
|
+
- `./.claude-powerline.json` - Project-specific
|
|
159
|
+
- `~/.claude/claude-powerline.json` - User config
|
|
160
|
+
- `~/.config/claude-powerline/config.json` - XDG standard
|
|
161
|
+
|
|
162
|
+
**Override priority:** CLI flags > Environment variables > Config files > Defaults
|
|
163
|
+
|
|
164
|
+
Config files reload automatically, no restart needed.
|
|
165
|
+
|
|
166
|
+
**Get example config:**
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
curl -o ~/.claude/claude-powerline.json https://raw.githubusercontent.com/Owloops/claude-powerline/main/.claude-powerline.json
|
|
170
|
+
```
|
|
132
171
|
|
|
133
|
-
|
|
172
|
+
<details>
|
|
173
|
+
<summary><strong>CLI Options and Environment Variables</strong></summary>
|
|
134
174
|
|
|
135
175
|
**CLI Options** (both `--arg value` and `--arg=value` syntax supported):
|
|
136
176
|
|
|
@@ -157,49 +197,7 @@ export CLAUDE_POWERLINE_CONFIG=/path/to/config.json
|
|
|
157
197
|
export CLAUDE_POWERLINE_DEBUG=1 # Enable debug logging
|
|
158
198
|
```
|
|
159
199
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
<img src="images/claude-powerline-styles.png" alt="Claude Powerline Styles" width="600">
|
|
163
|
-
|
|
164
|
-
### TUI Panel Mode
|
|
165
|
-
|
|
166
|
-
The `tui` style renders a bordered panel with all available data in a responsive layout. Unlike other styles, TUI mode is **opinionated**: it always displays all data regardless of segment enable/disable configuration. Only theme, charset, and budget thresholds are respected.
|
|
167
|
-
|
|
168
|
-
```json
|
|
169
|
-
{
|
|
170
|
-
"statusLine": {
|
|
171
|
-
"type": "command",
|
|
172
|
-
"command": "npx -y @owloops/claude-powerline@latest --style=tui"
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
The panel adapts to terminal width across three breakpoints:
|
|
178
|
-
- **Wide** (80+ cols): metrics on one line, workspace and footer spread across columns
|
|
179
|
-
- **Medium** (55-79 cols): metrics split across two lines, stacked footer
|
|
180
|
-
- **Narrow** (<55 cols): fully stacked layout
|
|
181
|
-
|
|
182
|
-
> [!NOTE]
|
|
183
|
-
> Claude Code's internal progress indicators (spinner, context bar) may briefly overlap the TUI panel during tool calls. This is a limitation of the hook architecture and resolves once the tool call completes.
|
|
184
|
-
|
|
185
|
-
## Configuration
|
|
186
|
-
|
|
187
|
-
**Get example config:**
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
# Download full-featured example config
|
|
191
|
-
curl -o ~/.claude/claude-powerline.json https://raw.githubusercontent.com/Owloops/claude-powerline/main/.claude-powerline.json
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
**Config locations** (in priority order):
|
|
195
|
-
|
|
196
|
-
- `./.claude-powerline.json` - Project-specific
|
|
197
|
-
- `~/.claude/claude-powerline.json` - User config
|
|
198
|
-
- `~/.config/claude-powerline/config.json` - XDG standard
|
|
199
|
-
|
|
200
|
-
**Override priority:** CLI flags → Environment variables → Config files → Defaults
|
|
201
|
-
|
|
202
|
-
Config files reload automatically and no restart needed.
|
|
200
|
+
</details>
|
|
203
201
|
|
|
204
202
|
### Segment Configuration
|
|
205
203
|
|
|
@@ -252,52 +250,59 @@ Config files reload automatically and no restart needed.
|
|
|
252
250
|
|
|
253
251
|
**Symbols:**
|
|
254
252
|
|
|
255
|
-
- Unicode: `⎇` Branch
|
|
256
|
-
- Text: `~` Branch
|
|
253
|
+
- Unicode: `⎇` Branch • `♯` SHA • `⌂` Tag • `⧇` Stash • `✓` Clean • `●` Dirty • `⚠` Conflicts • `↑3` Ahead • `↓2` Behind • `(+1 ~2 ?3)` Staged/Unstaged/Untracked
|
|
254
|
+
- Text: `~` Branch • `#` SHA • `T` Tag • `S` Stash • `=` Clean • `*` Dirty • `!` Conflicts • `^3` Ahead • `v2` Behind • `(+1 ~2 ?3)` Staged/Unstaged/Untracked
|
|
257
255
|
|
|
258
256
|
</details>
|
|
259
257
|
|
|
260
258
|
<details>
|
|
261
|
-
<summary><strong>
|
|
259
|
+
<summary><strong>Model</strong> - Shows current Claude model being used</summary>
|
|
262
260
|
|
|
263
261
|
```json
|
|
264
|
-
"
|
|
262
|
+
"model": {
|
|
263
|
+
"enabled": true
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
**Symbols:** `✱` Model (unicode) • `M` Model (text)
|
|
268
|
+
|
|
269
|
+
</details>
|
|
270
|
+
|
|
271
|
+
<details>
|
|
272
|
+
<summary><strong>Session</strong> - Shows real-time usage for current Claude conversation</summary>
|
|
273
|
+
|
|
274
|
+
```json
|
|
275
|
+
"session": {
|
|
265
276
|
"enabled": true,
|
|
266
|
-
"
|
|
267
|
-
"
|
|
268
|
-
"showDuration": true,
|
|
269
|
-
"showMessageCount": true,
|
|
270
|
-
"showLinesAdded": true,
|
|
271
|
-
"showLinesRemoved": true
|
|
277
|
+
"type": "tokens",
|
|
278
|
+
"costSource": "calculated"
|
|
272
279
|
}
|
|
273
280
|
```
|
|
274
281
|
|
|
275
282
|
**Options:**
|
|
276
283
|
|
|
277
|
-
- `
|
|
278
|
-
- `
|
|
279
|
-
- `showDuration`: Total session duration
|
|
280
|
-
- `showMessageCount`: Number of user messages sent
|
|
281
|
-
- `showLinesAdded`: Lines of code added during session
|
|
282
|
-
- `showLinesRemoved`: Lines of code removed during session
|
|
283
|
-
|
|
284
|
-
**Symbols:**
|
|
284
|
+
- `type`: Display format - `cost` | `tokens` | `both` | `breakdown`
|
|
285
|
+
- `costSource`: Cost calculation method - `calculated` (ccusage-style) | `official` (hook data)
|
|
285
286
|
|
|
286
|
-
|
|
287
|
-
- Text: `R` Total API time • `L` Last response • `T` Session duration • `#` Messages • `+` Lines added • `-` Lines removed
|
|
287
|
+
**Symbols:** `§` Session (unicode) • `S` Session (text)
|
|
288
288
|
|
|
289
289
|
</details>
|
|
290
290
|
|
|
291
291
|
<details>
|
|
292
|
-
<summary><strong>
|
|
292
|
+
<summary><strong>Today</strong> - Shows total daily usage with budget monitoring</summary>
|
|
293
293
|
|
|
294
294
|
```json
|
|
295
|
-
"
|
|
296
|
-
"enabled": true
|
|
295
|
+
"today": {
|
|
296
|
+
"enabled": true,
|
|
297
|
+
"type": "cost"
|
|
297
298
|
}
|
|
298
299
|
```
|
|
299
300
|
|
|
300
|
-
**
|
|
301
|
+
**Options:**
|
|
302
|
+
|
|
303
|
+
- `type`: Display format - `cost` | `tokens` | `both` | `breakdown`
|
|
304
|
+
|
|
305
|
+
**Symbols:** `☉` Today (unicode) • `D` Today (text)
|
|
301
306
|
|
|
302
307
|
</details>
|
|
303
308
|
|
|
@@ -324,7 +329,7 @@ Config files reload automatically and no restart needed.
|
|
|
324
329
|
|
|
325
330
|
| Style | Filled | Empty | Example |
|
|
326
331
|
|-------|--------|-------|---------|
|
|
327
|
-
| `text` |
|
|
332
|
+
| `text` | -- | -- | `◔ 34,040 (79%)` |
|
|
328
333
|
| `ball` | ─ | ─ | `─────●──── 50%` |
|
|
329
334
|
| `bar` | ▓ | ░ | `▓▓▓▓▓░░░░░ 50%` |
|
|
330
335
|
| `blocks` | █ | ░ | `█████░░░░░ 50%` |
|
|
@@ -336,9 +341,9 @@ Config files reload automatically and no restart needed.
|
|
|
336
341
|
| `line` | ━ | ┄ | `━━━━━┄┄┄┄┄ 50%` |
|
|
337
342
|
| `squares` | ◼ | ◻ | `◼◼◼◼◼◻◻◻◻◻ 50%` |
|
|
338
343
|
|
|
339
|
-
**Symbols:** `◔` Context (unicode)
|
|
344
|
+
**Symbols:** `◔` Context (unicode) • `C` Context (text)
|
|
340
345
|
|
|
341
|
-
|
|
346
|
+
#### Model Context Limits
|
|
342
347
|
|
|
343
348
|
Configure context window limits for different model types. Defaults to 200K tokens for all models.
|
|
344
349
|
|
|
@@ -359,74 +364,6 @@ Configure context window limits for different model types. Defaults to 200K toke
|
|
|
359
364
|
|
|
360
365
|
</details>
|
|
361
366
|
|
|
362
|
-
<details>
|
|
363
|
-
<summary><strong>Tmux</strong> - Shows tmux session name and window info when in tmux</summary>
|
|
364
|
-
|
|
365
|
-
```json
|
|
366
|
-
"tmux": {
|
|
367
|
-
"enabled": true
|
|
368
|
-
}
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
**Display:** `tmux:session-name`
|
|
372
|
-
|
|
373
|
-
</details>
|
|
374
|
-
|
|
375
|
-
<details>
|
|
376
|
-
<summary><strong>Session ID</strong> - Shows the current Claude session identifier</summary>
|
|
377
|
-
|
|
378
|
-
```json
|
|
379
|
-
"sessionId": {
|
|
380
|
-
"enabled": false,
|
|
381
|
-
"showIdLabel": true
|
|
382
|
-
}
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
**Options:**
|
|
386
|
-
|
|
387
|
-
- `showIdLabel`: Show the `⌗` icon prefix before the session ID (default: `true`)
|
|
388
|
-
|
|
389
|
-
**Display:** `⌗ a1b2c3d4-...`
|
|
390
|
-
|
|
391
|
-
**Symbols:** `⌗` Session ID (unicode) • `#` Session ID (text)
|
|
392
|
-
|
|
393
|
-
</details>
|
|
394
|
-
|
|
395
|
-
<details>
|
|
396
|
-
<summary><strong>Version</strong> - Shows Claude Code version</summary>
|
|
397
|
-
|
|
398
|
-
```json
|
|
399
|
-
"version": {
|
|
400
|
-
"enabled": true
|
|
401
|
-
}
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
**Display:** `v1.0.81`
|
|
405
|
-
|
|
406
|
-
**Symbols:** `◈` Version (unicode) • `V` Version (text)
|
|
407
|
-
|
|
408
|
-
</details>
|
|
409
|
-
|
|
410
|
-
<details>
|
|
411
|
-
<summary><strong>Session</strong> - Shows real-time usage for current Claude conversation</summary>
|
|
412
|
-
|
|
413
|
-
```json
|
|
414
|
-
"session": {
|
|
415
|
-
"enabled": true,
|
|
416
|
-
"type": "tokens",
|
|
417
|
-
"costSource": "calculated"
|
|
418
|
-
}
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
**Options:**
|
|
422
|
-
|
|
423
|
-
- `type`: Display format - `cost` | `tokens` | `both` | `breakdown`
|
|
424
|
-
- `costSource`: Cost calculation method - `calculated` (ccusage-style) | `official` (hook data)
|
|
425
|
-
|
|
426
|
-
**Symbols:** `§` Session (unicode) • `S` Session (text)
|
|
427
|
-
|
|
428
|
-
</details>
|
|
429
|
-
|
|
430
367
|
<details>
|
|
431
368
|
<summary><strong>Block</strong> - Shows usage within current 5-hour billing window (Claude's rate limit period)</summary>
|
|
432
369
|
|
|
@@ -465,7 +402,7 @@ Configure context window limits for different model types. Defaults to 200K toke
|
|
|
465
402
|
|
|
466
403
|
**Weighted Tokens:** In transcript mode, Opus tokens count 5x toward rate limits compared to Sonnet/Haiku tokens
|
|
467
404
|
|
|
468
|
-
**Symbols:** `◱` Block (unicode)
|
|
405
|
+
**Symbols:** `◱` Block (unicode) • `B` Block (text)
|
|
469
406
|
|
|
470
407
|
</details>
|
|
471
408
|
|
|
@@ -485,25 +422,86 @@ Configure context window limits for different model types. Defaults to 200K toke
|
|
|
485
422
|
|
|
486
423
|
Only visible when Claude Code provides native `rate_limits.seven_day` data (Claude.ai Pro/Max subscribers). Hidden when the data is not available.
|
|
487
424
|
|
|
488
|
-
**Symbols:** `◑` Weekly (unicode)
|
|
425
|
+
**Symbols:** `◑` Weekly (unicode) • `W` Weekly (text)
|
|
489
426
|
|
|
490
427
|
</details>
|
|
491
428
|
|
|
492
429
|
<details>
|
|
493
|
-
<summary><strong>
|
|
430
|
+
<summary><strong>Metrics</strong> - Shows performance analytics from your Claude sessions</summary>
|
|
494
431
|
|
|
495
432
|
```json
|
|
496
|
-
"
|
|
433
|
+
"metrics": {
|
|
497
434
|
"enabled": true,
|
|
498
|
-
"
|
|
435
|
+
"showResponseTime": true,
|
|
436
|
+
"showLastResponseTime": false,
|
|
437
|
+
"showDuration": true,
|
|
438
|
+
"showMessageCount": true,
|
|
439
|
+
"showLinesAdded": true,
|
|
440
|
+
"showLinesRemoved": true
|
|
499
441
|
}
|
|
500
442
|
```
|
|
501
443
|
|
|
502
444
|
**Options:**
|
|
503
445
|
|
|
504
|
-
- `
|
|
446
|
+
- `showResponseTime`: Total API duration across all requests
|
|
447
|
+
- `showLastResponseTime`: Individual response time for most recent query
|
|
448
|
+
- `showDuration`: Total session duration
|
|
449
|
+
- `showMessageCount`: Number of user messages sent
|
|
450
|
+
- `showLinesAdded`: Lines of code added during session
|
|
451
|
+
- `showLinesRemoved`: Lines of code removed during session
|
|
452
|
+
|
|
453
|
+
**Symbols:**
|
|
454
|
+
|
|
455
|
+
- Unicode: `⧖` Total API time • `Δ` Last response • `⧗` Session duration • `⟐` Messages • `+` Lines added • `-` Lines removed
|
|
456
|
+
- Text: `R` Total API time • `L` Last response • `T` Session duration • `#` Messages • `+` Lines added • `-` Lines removed
|
|
457
|
+
|
|
458
|
+
</details>
|
|
459
|
+
|
|
460
|
+
<details>
|
|
461
|
+
<summary><strong>Version</strong> - Shows Claude Code version</summary>
|
|
462
|
+
|
|
463
|
+
```json
|
|
464
|
+
"version": {
|
|
465
|
+
"enabled": true
|
|
466
|
+
}
|
|
467
|
+
```
|
|
505
468
|
|
|
506
|
-
**
|
|
469
|
+
**Display:** `v1.0.81`
|
|
470
|
+
|
|
471
|
+
**Symbols:** `◈` Version (unicode) • `V` Version (text)
|
|
472
|
+
|
|
473
|
+
</details>
|
|
474
|
+
|
|
475
|
+
<details>
|
|
476
|
+
<summary><strong>Tmux</strong> - Shows tmux session name and window info when in tmux</summary>
|
|
477
|
+
|
|
478
|
+
```json
|
|
479
|
+
"tmux": {
|
|
480
|
+
"enabled": true
|
|
481
|
+
}
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
**Display:** `tmux:session-name`
|
|
485
|
+
|
|
486
|
+
</details>
|
|
487
|
+
|
|
488
|
+
<details>
|
|
489
|
+
<summary><strong>Session ID</strong> - Shows the current Claude session identifier</summary>
|
|
490
|
+
|
|
491
|
+
```json
|
|
492
|
+
"sessionId": {
|
|
493
|
+
"enabled": false,
|
|
494
|
+
"showIdLabel": true
|
|
495
|
+
}
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
**Options:**
|
|
499
|
+
|
|
500
|
+
- `showIdLabel`: Show the `⌗` icon prefix before the session ID (default: `true`)
|
|
501
|
+
|
|
502
|
+
**Display:** `⌗ a1b2c3d4-...`
|
|
503
|
+
|
|
504
|
+
**Symbols:** `⌗` Session ID (unicode) • `#` Session ID (text)
|
|
507
505
|
|
|
508
506
|
</details>
|
|
509
507
|
|
|
@@ -525,11 +523,14 @@ Only visible when Claude Code provides native `rate_limits.seven_day` data (Clau
|
|
|
525
523
|
|
|
526
524
|
Hidden when the variable is unset or empty.
|
|
527
525
|
|
|
528
|
-
**Symbols:** `⚙` Env (unicode)
|
|
526
|
+
**Symbols:** `⚙` Env (unicode) • `$` Env (text)
|
|
529
527
|
|
|
530
528
|
</details>
|
|
531
529
|
|
|
532
|
-
###
|
|
530
|
+
### Advanced Configuration
|
|
531
|
+
|
|
532
|
+
<details>
|
|
533
|
+
<summary><strong>Budget Configuration</strong></summary>
|
|
533
534
|
|
|
534
535
|
```json
|
|
535
536
|
"budget": {
|
|
@@ -545,12 +546,15 @@ Hidden when the variable is unset or empty.
|
|
|
545
546
|
- `type`: Budget type - `cost` (USD) | `tokens` (for token-based limits)
|
|
546
547
|
- `warningThreshold`: Warning threshold percentage (default: 80)
|
|
547
548
|
|
|
548
|
-
**Indicators:** `25%` Normal
|
|
549
|
+
**Indicators:** `25%` Normal • `+75%` Moderate (50-79%) • `!85%` Warning (80%+)
|
|
549
550
|
|
|
550
551
|
> [!TIP]
|
|
551
552
|
> Claude's rate limits consider multiple factors beyond tokens (message count, length, attachments, model). See [Anthropic's usage documentation](https://support.anthropic.com/en/articles/11014257-about-claude-s-max-plan-usage) for details.
|
|
552
553
|
|
|
553
|
-
|
|
554
|
+
</details>
|
|
555
|
+
|
|
556
|
+
<details>
|
|
557
|
+
<summary><strong>Character Sets</strong></summary>
|
|
554
558
|
|
|
555
559
|
Choose between Unicode symbols (requires Nerd Font) or ASCII text mode for maximum compatibility.
|
|
556
560
|
|
|
@@ -564,27 +568,22 @@ Choose between Unicode symbols (requires Nerd Font) or ASCII text mode for maxim
|
|
|
564
568
|
|
|
565
569
|
**Options:**
|
|
566
570
|
|
|
567
|
-
- `unicode` (default) - Uses Nerd Font icons and symbols
|
|
568
|
-
- `text` - ASCII-only characters
|
|
569
|
-
|
|
570
|
-
**Combinations with styles:**
|
|
571
|
+
- `unicode` (default) - Uses Nerd Font icons and symbols
|
|
572
|
+
- `text` - ASCII-only characters for terminals without Nerd Font
|
|
571
573
|
|
|
572
574
|
The charset setting works independently from separator styles, giving you 8 possible combinations:
|
|
575
|
+
|
|
573
576
|
- `minimal` + `unicode` / `text` - No separators
|
|
574
577
|
- `powerline` + `unicode` / `text` - Arrow separators (requires Nerd Font for unicode)
|
|
575
578
|
- `capsule` + `unicode` / `text` - Rounded caps (requires Nerd Font for unicode)
|
|
576
579
|
- `tui` + `unicode` / `text` - Bordered panel with rounded or ASCII box characters
|
|
577
580
|
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
```bash
|
|
581
|
-
claude-powerline --charset=text --style=minimal
|
|
582
|
-
claude-powerline --charset=unicode --style=powerline
|
|
583
|
-
```
|
|
581
|
+
</details>
|
|
584
582
|
|
|
585
|
-
|
|
583
|
+
<details>
|
|
584
|
+
<summary><strong>Layout: Auto-Wrap, Multi-line, and Padding</strong></summary>
|
|
586
585
|
|
|
587
|
-
|
|
586
|
+
**Auto-Wrap** (enabled by default):
|
|
588
587
|
|
|
589
588
|
```json
|
|
590
589
|
{
|
|
@@ -594,11 +593,9 @@ Automatically wrap segments to new lines based on terminal width.
|
|
|
594
593
|
}
|
|
595
594
|
```
|
|
596
595
|
|
|
597
|
-
Segments flow naturally and wrap to new lines when they exceed the terminal width.
|
|
596
|
+
Segments flow naturally and wrap to new lines when they exceed the terminal width.
|
|
598
597
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
Alternatively, manually organize segments across multiple lines.
|
|
598
|
+
**Multi-line Layout** for manual control:
|
|
602
599
|
|
|
603
600
|
```json
|
|
604
601
|
{
|
|
@@ -623,12 +620,7 @@ Alternatively, manually organize segments across multiple lines.
|
|
|
623
620
|
}
|
|
624
621
|
```
|
|
625
622
|
|
|
626
|
-
|
|
627
|
-
> Claude Code system messages may truncate long status lines. Use `autoWrap` or manual multi-line layouts to prevent segment cutoff.
|
|
628
|
-
|
|
629
|
-
### Padding
|
|
630
|
-
|
|
631
|
-
Control the spacing inside each segment.
|
|
623
|
+
**Padding** - number of spaces on each side of segment text:
|
|
632
624
|
|
|
633
625
|
```json
|
|
634
626
|
{
|
|
@@ -638,9 +630,15 @@ Control the spacing inside each segment.
|
|
|
638
630
|
}
|
|
639
631
|
```
|
|
640
632
|
|
|
641
|
-
|
|
633
|
+
Set to `0` for compact, `1` (default) for standard spacing.
|
|
642
634
|
|
|
643
|
-
|
|
635
|
+
> [!NOTE]
|
|
636
|
+
> Claude Code system messages may truncate long status lines. Use `autoWrap` or manual multi-line layouts to prevent segment cutoff.
|
|
637
|
+
|
|
638
|
+
</details>
|
|
639
|
+
|
|
640
|
+
<details>
|
|
641
|
+
<summary><strong>Colors and Custom Themes</strong></summary>
|
|
644
642
|
|
|
645
643
|
Create custom themes and configure color compatibility:
|
|
646
644
|
|
|
@@ -660,7 +658,7 @@ Create custom themes and configure color compatibility:
|
|
|
660
658
|
}
|
|
661
659
|
```
|
|
662
660
|
|
|
663
|
-
**Color Options:** `bg` (hex, `transparent`, `none`)
|
|
661
|
+
**Color Options:** `bg` (hex, `transparent`, `none`) • `fg` (hex)
|
|
664
662
|
|
|
665
663
|
**Compatibility Modes:** `auto` (default), `ansi`, `ansi256`, `truecolor`
|
|
666
664
|
|
|
@@ -677,16 +675,39 @@ Create custom themes and configure color compatibility:
|
|
|
677
675
|
|
|
678
676
|
**Priority:** `FORCE_COLOR` overrides `NO_COLOR` (allowing color to be forced on even when NO_COLOR is set)
|
|
679
677
|
|
|
680
|
-
|
|
678
|
+
</details>
|
|
679
|
+
|
|
680
|
+
<details>
|
|
681
|
+
<summary><strong>TUI Panel Mode</strong></summary>
|
|
682
|
+
|
|
683
|
+
```json
|
|
684
|
+
{
|
|
685
|
+
"statusLine": {
|
|
686
|
+
"type": "command",
|
|
687
|
+
"command": "npx -y @owloops/claude-powerline@latest --style=tui"
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
The panel adapts to terminal width across three breakpoints:
|
|
693
|
+
|
|
694
|
+
- **Wide** (80+ cols): metrics on one line, workspace and footer spread across columns
|
|
695
|
+
- **Medium** (55-79 cols): metrics split across two lines, stacked footer
|
|
696
|
+
- **Narrow** (<55 cols): fully stacked layout
|
|
697
|
+
|
|
698
|
+
> [!NOTE]
|
|
699
|
+
> Claude Code's internal progress indicators (spinner, context bar) may briefly overlap the TUI panel during tool calls. This is a limitation of the hook architecture and resolves once the tool call completes.
|
|
700
|
+
|
|
701
|
+
</details>
|
|
702
|
+
|
|
703
|
+
<details>
|
|
704
|
+
<summary><strong>Performance</strong></summary>
|
|
681
705
|
|
|
682
706
|
Execution times for different configurations:
|
|
683
707
|
|
|
684
708
|
- **~80ms** default config (`directory`, `git`, `model`, `session`, `today`, `context`)
|
|
685
709
|
- **~240ms** full-featured (all segments enabled)
|
|
686
710
|
|
|
687
|
-
<details>
|
|
688
|
-
<summary><strong>Detailed Segment Timings</strong></summary>
|
|
689
|
-
|
|
690
711
|
| Segment | Timing | Notes |
|
|
691
712
|
| ----------- | ------ | ------------------------------------------ |
|
|
692
713
|
| `directory` | ~40ms | No external commands |
|
|
@@ -702,15 +723,16 @@ Execution times for different configurations:
|
|
|
702
723
|
|
|
703
724
|
**Benchmark:** `npm run benchmark:timing`
|
|
704
725
|
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
### Optimization Tips
|
|
726
|
+
**Optimization Tips:**
|
|
708
727
|
|
|
709
728
|
- **Global install:** `npm install -g` to avoid npx overhead
|
|
710
729
|
- **Disable unused segments** for faster execution
|
|
711
730
|
- **Cache cleanup:** Remove `~/.claude/powerline/` if needed
|
|
712
731
|
|
|
713
|
-
|
|
732
|
+
</details>
|
|
733
|
+
|
|
734
|
+
<details>
|
|
735
|
+
<summary><strong>Custom Segments (Shell Composition)</strong></summary>
|
|
714
736
|
|
|
715
737
|
Extend the statusline using shell composition:
|
|
716
738
|
|
|
@@ -724,9 +746,13 @@ Extend the statusline using shell composition:
|
|
|
724
746
|
}
|
|
725
747
|
```
|
|
726
748
|
|
|
727
|
-
> [!NOTE]
|
|
749
|
+
> [!NOTE]
|
|
728
750
|
> Use `tput` for colors: `setab <bg>` (background), `setaf <fg>` (foreground), `sgr0` (reset). Example: `echo "$(tput setab 4)$(tput setaf 15) text $(tput sgr0)"`. For complex logic, create a shell script with multiple commands, conditions, and variables.
|
|
729
751
|
|
|
752
|
+
</details>
|
|
753
|
+
|
|
754
|
+
</details>
|
|
755
|
+
|
|
730
756
|
## Contributing
|
|
731
757
|
|
|
732
758
|
Contributions are welcome! Please feel free to submit issues or pull requests.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owloops/claude-powerline",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.1",
|
|
4
4
|
"description": "Beautiful vim-style powerline statusline for Claude Code with real-time usage tracking, git integration, and custom themes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"files": [
|
|
45
45
|
"dist",
|
|
46
46
|
"bin",
|
|
47
|
+
"plugin",
|
|
47
48
|
"README.md",
|
|
48
49
|
"LICENSE"
|
|
49
50
|
],
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "claude-powerline",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Claude Powerline statusline setup wizard",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Owloops"
|
|
7
|
+
},
|
|
8
|
+
"repository": "https://github.com/Owloops/claude-powerline",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"keywords": ["powerline", "statusline", "claude-code", "setup"]
|
|
11
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
|
+
readonly SCRIPT_DIR
|
|
7
|
+
readonly PLUGIN_ROOT="${SCRIPT_DIR}/.."
|
|
8
|
+
|
|
9
|
+
readonly SAMPLE_JSON='{"model":{"id":"claude-sonnet-4-20250514","display_name":"Sonnet 4"},"cost":{"total_cost_usd":0.42,"message_cost_usd":0.03,"duration":"15m"},"context_window":{"context_window_size":200000,"used_percentage":35,"current_usage":{"input_tokens":50000,"cache_creation_input_tokens":10000,"cache_read_input_tokens":5000}},"cwd":"/home/user/my-project","workspace":{"current_dir":"/home/user/my-project"},"session":{"session_id":"abc123"}}'
|
|
10
|
+
|
|
11
|
+
readonly PREVIEW_CONFIG='{
|
|
12
|
+
"theme": "dark",
|
|
13
|
+
"display": {
|
|
14
|
+
"style": "minimal",
|
|
15
|
+
"charset": "unicode",
|
|
16
|
+
"colorCompatibility": "auto",
|
|
17
|
+
"autoWrap": true,
|
|
18
|
+
"padding": 1,
|
|
19
|
+
"lines": [
|
|
20
|
+
{
|
|
21
|
+
"segments": {
|
|
22
|
+
"directory": { "enabled": true, "style": "fish" },
|
|
23
|
+
"git": { "enabled": true },
|
|
24
|
+
"model": { "enabled": true },
|
|
25
|
+
"session": { "enabled": true, "type": "cost", "costSource": "calculated" },
|
|
26
|
+
"today": { "enabled": true, "type": "cost" },
|
|
27
|
+
"context": { "enabled": true, "showPercentageOnly": false, "displayStyle": "text", "autocompactBuffer": 33000 }
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"budget": {
|
|
33
|
+
"session": { "warningThreshold": 80 },
|
|
34
|
+
"today": { "amount": 50, "warningThreshold": 80 }
|
|
35
|
+
}
|
|
36
|
+
}'
|
|
37
|
+
|
|
38
|
+
THEME="dark"
|
|
39
|
+
STYLE="minimal"
|
|
40
|
+
CHARSET="unicode"
|
|
41
|
+
COMPARE_STYLES=false
|
|
42
|
+
COMPARE_THEMES=false
|
|
43
|
+
BIN=""
|
|
44
|
+
TEMP_FILES=()
|
|
45
|
+
|
|
46
|
+
# shellcheck disable=SC2329
|
|
47
|
+
cleanup() {
|
|
48
|
+
for f in "${TEMP_FILES[@]}"; do
|
|
49
|
+
rm -f "${f}"
|
|
50
|
+
done
|
|
51
|
+
}
|
|
52
|
+
trap cleanup EXIT
|
|
53
|
+
|
|
54
|
+
find_binary() {
|
|
55
|
+
local npm_bin="${PLUGIN_ROOT}/../bin/claude-powerline"
|
|
56
|
+
if [[ -f "${npm_bin}" ]]; then
|
|
57
|
+
printf '%s' "${npm_bin}"
|
|
58
|
+
return 0
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
if command -v claude-powerline >/dev/null 2>&1; then
|
|
62
|
+
command -v claude-powerline
|
|
63
|
+
return 0
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
printf 'npx'
|
|
67
|
+
return 0
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
make_temp_config() {
|
|
71
|
+
local preview_theme="$1"
|
|
72
|
+
local preview_style="$2"
|
|
73
|
+
local preview_charset="$3"
|
|
74
|
+
local tmp
|
|
75
|
+
|
|
76
|
+
tmp="$(mktemp)"
|
|
77
|
+
TEMP_FILES+=("${tmp}")
|
|
78
|
+
printf '%s' "${PREVIEW_CONFIG}" |
|
|
79
|
+
sed -e "s/\"theme\": \"dark\"/\"theme\": \"${preview_theme}\"/" \
|
|
80
|
+
-e "s/\"style\": \"minimal\"/\"style\": \"${preview_style}\"/" \
|
|
81
|
+
-e "s/\"charset\": \"unicode\"/\"charset\": \"${preview_charset}\"/" \
|
|
82
|
+
>"${tmp}"
|
|
83
|
+
printf '%s' "${tmp}"
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
run_preview() {
|
|
87
|
+
local preview_theme="$1"
|
|
88
|
+
local preview_style="$2"
|
|
89
|
+
local preview_charset="$3"
|
|
90
|
+
local tmp_config
|
|
91
|
+
|
|
92
|
+
tmp_config="$(make_temp_config "${preview_theme}" "${preview_style}" "${preview_charset}")"
|
|
93
|
+
|
|
94
|
+
if [[ "${BIN}" == "npx" ]]; then
|
|
95
|
+
printf '%s' "${SAMPLE_JSON}" | npx -y @owloops/claude-powerline@latest \
|
|
96
|
+
--config="${tmp_config}"
|
|
97
|
+
else
|
|
98
|
+
printf '%s' "${SAMPLE_JSON}" | "${BIN}" \
|
|
99
|
+
--config="${tmp_config}"
|
|
100
|
+
fi
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
run_compare_styles() {
|
|
104
|
+
local styles=(minimal powerline capsule tui)
|
|
105
|
+
local s
|
|
106
|
+
|
|
107
|
+
for s in "${styles[@]}"; do
|
|
108
|
+
printf '%s:\n' "${s}"
|
|
109
|
+
run_preview "${THEME}" "${s}" "${CHARSET}"
|
|
110
|
+
printf '\n\n'
|
|
111
|
+
done
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
run_compare_themes() {
|
|
115
|
+
local themes=(dark light nord tokyo-night rose-pine gruvbox)
|
|
116
|
+
local t
|
|
117
|
+
|
|
118
|
+
for t in "${themes[@]}"; do
|
|
119
|
+
printf '%s:\n' "${t}"
|
|
120
|
+
run_preview "${t}" "${STYLE}" "${CHARSET}"
|
|
121
|
+
printf '\n\n'
|
|
122
|
+
done
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
parse_args() {
|
|
126
|
+
while [[ $# -gt 0 ]]; do
|
|
127
|
+
case "$1" in
|
|
128
|
+
--theme=*)
|
|
129
|
+
THEME="${1#*=}"
|
|
130
|
+
shift
|
|
131
|
+
;;
|
|
132
|
+
--theme)
|
|
133
|
+
[[ $# -ge 2 ]] || {
|
|
134
|
+
printf 'Missing value for --theme\n' >&2
|
|
135
|
+
exit 1
|
|
136
|
+
}
|
|
137
|
+
THEME="$2"
|
|
138
|
+
shift 2
|
|
139
|
+
;;
|
|
140
|
+
--style=*)
|
|
141
|
+
STYLE="${1#*=}"
|
|
142
|
+
shift
|
|
143
|
+
;;
|
|
144
|
+
--style)
|
|
145
|
+
[[ $# -ge 2 ]] || {
|
|
146
|
+
printf 'Missing value for --style\n' >&2
|
|
147
|
+
exit 1
|
|
148
|
+
}
|
|
149
|
+
STYLE="$2"
|
|
150
|
+
shift 2
|
|
151
|
+
;;
|
|
152
|
+
--charset=*)
|
|
153
|
+
CHARSET="${1#*=}"
|
|
154
|
+
shift
|
|
155
|
+
;;
|
|
156
|
+
--charset)
|
|
157
|
+
[[ $# -ge 2 ]] || {
|
|
158
|
+
printf 'Missing value for --charset\n' >&2
|
|
159
|
+
exit 1
|
|
160
|
+
}
|
|
161
|
+
CHARSET="$2"
|
|
162
|
+
shift 2
|
|
163
|
+
;;
|
|
164
|
+
--compare-styles)
|
|
165
|
+
COMPARE_STYLES=true
|
|
166
|
+
shift
|
|
167
|
+
;;
|
|
168
|
+
--compare-themes)
|
|
169
|
+
COMPARE_THEMES=true
|
|
170
|
+
shift
|
|
171
|
+
;;
|
|
172
|
+
*)
|
|
173
|
+
printf 'Unknown option: %s\n' "$1" >&2
|
|
174
|
+
exit 1
|
|
175
|
+
;;
|
|
176
|
+
esac
|
|
177
|
+
done
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
main() {
|
|
181
|
+
parse_args "$@"
|
|
182
|
+
BIN="$(find_binary)"
|
|
183
|
+
|
|
184
|
+
if [[ "${COMPARE_STYLES}" == "true" ]]; then
|
|
185
|
+
run_compare_styles
|
|
186
|
+
exit 0
|
|
187
|
+
fi
|
|
188
|
+
|
|
189
|
+
if [[ "${COMPARE_THEMES}" == "true" ]]; then
|
|
190
|
+
run_compare_themes
|
|
191
|
+
exit 0
|
|
192
|
+
fi
|
|
193
|
+
|
|
194
|
+
run_preview "${THEME}" "${STYLE}" "${CHARSET}"
|
|
195
|
+
printf '\n'
|
|
196
|
+
exit 0
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
main "$@"
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: powerline
|
|
3
|
+
description: Claude Powerline statusline setup wizard
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- Bash
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- AskUserQuestion
|
|
10
|
+
- Glob
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Claude Powerline Setup Wizard
|
|
14
|
+
|
|
15
|
+
You are running an interactive setup wizard to configure the claude-powerline statusline for Claude Code. Follow these steps in order, using AskUserQuestion for each decision point.
|
|
16
|
+
|
|
17
|
+
## Important Notes
|
|
18
|
+
|
|
19
|
+
- Do not skip steps or combine questions.
|
|
20
|
+
- Always wait for the user's response before moving to the next step.
|
|
21
|
+
- Track the user's choices in variables throughout the wizard.
|
|
22
|
+
- The final config is written as JSON to `~/.claude/claude-powerline.json`.
|
|
23
|
+
- Do NOT use the Agent tool or Explore subagents. All information you need is in this document.
|
|
24
|
+
- Do NOT read source code from the claude-powerline package. Use only the instructions below.
|
|
25
|
+
- IMPORTANT: After running any Bash or Read tool, repeat the key output as text in your response. Some users have a collapsed UI mode where tool outputs require a click to expand. Always relay important results (like version numbers, previews, or file contents) in your text so the user can see them without expanding.
|
|
26
|
+
|
|
27
|
+
## Step 1: Check Node.js
|
|
28
|
+
|
|
29
|
+
Run this command to check if Node.js 18+ is available:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
node --version 2>/dev/null || echo "not_installed"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Tell the user the detected version in your text response.
|
|
36
|
+
|
|
37
|
+
### If Node.js is NOT installed or version is below 18
|
|
38
|
+
|
|
39
|
+
Display:
|
|
40
|
+
|
|
41
|
+
````markdown
|
|
42
|
+
Claude Powerline requires **Node.js 18+** to run.
|
|
43
|
+
|
|
44
|
+
Install it from https://nodejs.org or via your package manager:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# macOS
|
|
48
|
+
brew install node
|
|
49
|
+
|
|
50
|
+
# Ubuntu/Debian
|
|
51
|
+
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
|
|
52
|
+
sudo apt-get install -y nodejs
|
|
53
|
+
```
|
|
54
|
+
````
|
|
55
|
+
|
|
56
|
+
Then ask:
|
|
57
|
+
|
|
58
|
+
- **Question**: "Install Node.js or check again?"
|
|
59
|
+
- **Header**: "Node.js"
|
|
60
|
+
- **Options**:
|
|
61
|
+
- "I installed it, check again" -> Re-run the version check from the top of Step 1
|
|
62
|
+
- "Exit wizard" -> Tell them to install Node.js 18+ and exit
|
|
63
|
+
|
|
64
|
+
### If Node.js 18+ IS installed
|
|
65
|
+
|
|
66
|
+
Continue to the next step.
|
|
67
|
+
|
|
68
|
+
## Step 2: Nerd Font Detection
|
|
69
|
+
|
|
70
|
+
> [!IMPORTANT]
|
|
71
|
+
> You cannot display nerd font glyphs properly in your text output.
|
|
72
|
+
> You MUST run the cat command below and let the terminal render it.
|
|
73
|
+
> After running it, tell the user to expand the bash output if they cannot see the icons.
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
cat ${CLAUDE_PLUGIN_ROOT}/templates/nerd-fonts-sample.txt
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
After running the command, tell the user: "Check the bash output above for Nerd Font icons (folder, code, branch, robot). You may need to click/expand the bash output to see them."
|
|
80
|
+
|
|
81
|
+
Then ask:
|
|
82
|
+
|
|
83
|
+
- **Question**: "Can you see the icons clearly (folder, code, branch, robot)?"
|
|
84
|
+
- **Header**: "Nerd Font"
|
|
85
|
+
- **Options**:
|
|
86
|
+
- "Yes, I can see them" -> Set `charset=unicode`. Continue to Step 3
|
|
87
|
+
- "No, I see boxes or blank spaces" -> Set `charset=text`. Continue to Step 3
|
|
88
|
+
|
|
89
|
+
## Step 3: Theme Selection
|
|
90
|
+
|
|
91
|
+
Display the available themes and tell the user to type their choice:
|
|
92
|
+
|
|
93
|
+
````markdown
|
|
94
|
+
**Available themes:**
|
|
95
|
+
|
|
96
|
+
1. **dark** -- Dark background, high contrast (default)
|
|
97
|
+
2. **light** -- Light background for light terminals
|
|
98
|
+
3. **nord** -- Cool blue palette inspired by Arctic colors
|
|
99
|
+
4. **tokyo-night** -- Modern dark theme with vibrant accents
|
|
100
|
+
5. **rose-pine** -- Soft, muted palette with rose and pine tones
|
|
101
|
+
6. **gruvbox** -- Warm retro colors with earthy tones
|
|
102
|
+
````
|
|
103
|
+
|
|
104
|
+
Then ask:
|
|
105
|
+
|
|
106
|
+
- **Question**: "Which theme? Type a name or pick from the list."
|
|
107
|
+
- **Header**: "Theme"
|
|
108
|
+
- **Options**:
|
|
109
|
+
- "dark" -> Set `chosen_theme=dark`
|
|
110
|
+
- "light" -> Set `chosen_theme=light`
|
|
111
|
+
- "nord" -> Set `chosen_theme=nord`
|
|
112
|
+
- "tokyo-night" -> Set `chosen_theme=tokyo-night`
|
|
113
|
+
|
|
114
|
+
If the user types "rose-pine" or "gruvbox" (or any valid theme name) in the free text field, accept that as their choice. Valid themes: dark, light, nord, tokyo-night, rose-pine, gruvbox.
|
|
115
|
+
|
|
116
|
+
## Step 4: Style Selection
|
|
117
|
+
|
|
118
|
+
Show a preview of all four styles using the bundled preview script.
|
|
119
|
+
|
|
120
|
+
> [!IMPORTANT]
|
|
121
|
+
> You cannot render ANSI escape codes or nerd font glyphs in your text output.
|
|
122
|
+
> You MUST run the preview command below and let the terminal display the result.
|
|
123
|
+
> Do NOT attempt to describe what the styles look like. Let the user see them.
|
|
124
|
+
> After running, tell the user to expand the bash output if they cannot see the previews.
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
${CLAUDE_PLUGIN_ROOT}/bin/preview.sh --compare-styles --theme=${chosen_theme} --charset=${charset}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
After running the command, tell the user: "The four style previews are in the bash output above. Expand it if needed."
|
|
131
|
+
|
|
132
|
+
Then ask:
|
|
133
|
+
|
|
134
|
+
- **Question**: "Which style do you prefer?"
|
|
135
|
+
- **Header**: "Style"
|
|
136
|
+
- **Options**:
|
|
137
|
+
- "minimal" -> Set `chosen_style=minimal`
|
|
138
|
+
- "powerline" -> Set `chosen_style=powerline`
|
|
139
|
+
- "capsule" -> Set `chosen_style=capsule`
|
|
140
|
+
- "tui" -> Set `chosen_style=tui`
|
|
141
|
+
|
|
142
|
+
If the user chose `charset=text`, add a note that powerline and capsule use text fallback separators.
|
|
143
|
+
|
|
144
|
+
**If the user chose "tui":** skip Steps 5 and 6. TUI mode is opinionated and always displays all data regardless of segment configuration. Tell the user: "TUI mode shows all available data automatically. Segment and bar style selection are not needed." Then continue to Step 7.
|
|
145
|
+
|
|
146
|
+
## Step 5: Segment Selection
|
|
147
|
+
|
|
148
|
+
> [!NOTE]
|
|
149
|
+
> Skip this step if the user chose "tui" style.
|
|
150
|
+
|
|
151
|
+
Display the three presets:
|
|
152
|
+
|
|
153
|
+
````markdown
|
|
154
|
+
**Choose a segment preset:**
|
|
155
|
+
|
|
156
|
+
1. **Essential** -- Directory, git, model, context window
|
|
157
|
+
Clean and lightweight. Just the basics.
|
|
158
|
+
|
|
159
|
+
2. **Standard** -- Essential + session cost, daily cost tracking
|
|
160
|
+
Adds cost visibility without clutter. Good default for most users.
|
|
161
|
+
|
|
162
|
+
3. **Full** -- Standard + block usage, metrics, version, weekly usage
|
|
163
|
+
Everything on. For users who want maximum information density.
|
|
164
|
+
````
|
|
165
|
+
|
|
166
|
+
Then ask:
|
|
167
|
+
|
|
168
|
+
- **Question**: "Which segment preset?"
|
|
169
|
+
- **Header**: "Segments"
|
|
170
|
+
- **Options**:
|
|
171
|
+
- "Essential" -> Set `chosen_preset=essential`
|
|
172
|
+
- "Standard" -> Set `chosen_preset=standard`
|
|
173
|
+
- "Full" -> Set `chosen_preset=full`
|
|
174
|
+
|
|
175
|
+
### Preset to template mapping
|
|
176
|
+
|
|
177
|
+
Each preset has a corresponding template config file in `${CLAUDE_PLUGIN_ROOT}/templates/`:
|
|
178
|
+
|
|
179
|
+
- `essential` -> `config-essential.json`
|
|
180
|
+
- `standard` -> `config-standard.json`
|
|
181
|
+
- `full` -> `config-full.json`
|
|
182
|
+
- `tui` (style) -> `config-tui.json`
|
|
183
|
+
|
|
184
|
+
## Step 6: Bar Display Style
|
|
185
|
+
|
|
186
|
+
> [!NOTE]
|
|
187
|
+
> Skip this step if the user chose "tui" style. Default to `text` if skipped.
|
|
188
|
+
|
|
189
|
+
Display the available bar styles for progress indicators (used by context, block, and weekly segments):
|
|
190
|
+
|
|
191
|
+
````markdown
|
|
192
|
+
**Bar display styles** (for context window, block usage, and weekly usage):
|
|
193
|
+
|
|
194
|
+
1. **text** -- Numbers only, no bar (default). Example: `65,000 (61%)`
|
|
195
|
+
2. **bar** -- Classic bar. Example: `▓▓▓▓▓░░░░░ 50%`
|
|
196
|
+
3. **blocks** -- Block fill. Example: `█████░░░░░ 50%`
|
|
197
|
+
4. **dots** -- Dot fill. Example: `●●●●●○○○○○ 50%`
|
|
198
|
+
5. **geometric** -- Geometric. Example: `▰▰▰▰▰▱▱▱▱▱ 50%`
|
|
199
|
+
6. **line** -- Line style. Example: `━━━━━┄┄┄┄┄ 50%`
|
|
200
|
+
````
|
|
201
|
+
|
|
202
|
+
Then ask:
|
|
203
|
+
|
|
204
|
+
- **Question**: "Which bar style for progress indicators?"
|
|
205
|
+
- **Header**: "Display Style"
|
|
206
|
+
- **Options**:
|
|
207
|
+
- "text" -> Set `chosen_bar_style=text`
|
|
208
|
+
- "bar" -> Set `chosen_bar_style=bar`
|
|
209
|
+
- "blocks" -> Set `chosen_bar_style=blocks`
|
|
210
|
+
- "dots" -> Set `chosen_bar_style=dots`
|
|
211
|
+
|
|
212
|
+
If the user types "geometric", "line", "filled", "squares", "capped", "ball", or "blocks-line" in the free text field, accept that as their choice. All valid display styles: text, ball, bar, blocks, blocks-line, capped, dots, filled, geometric, line, squares.
|
|
213
|
+
|
|
214
|
+
Apply `chosen_bar_style` to the `displayStyle` field of context, block, and weekly segments in the config.
|
|
215
|
+
|
|
216
|
+
## Step 7: Budget
|
|
217
|
+
|
|
218
|
+
> [!NOTE]
|
|
219
|
+
> Skip this step if the user chose "Essential" preset or "tui" style. The essential template has no budget placeholder, and TUI uses defaults.
|
|
220
|
+
|
|
221
|
+
Ask the user about their daily budget for cost tracking:
|
|
222
|
+
|
|
223
|
+
- **Question**: "Set a daily spending budget? (used by the today segment for percentage warnings)"
|
|
224
|
+
- **Header**: "Budget"
|
|
225
|
+
- **Options**:
|
|
226
|
+
- "$25/day" -> Set `today_budget=25`
|
|
227
|
+
- "$50/day" -> Set `today_budget=50`
|
|
228
|
+
- "$100/day" -> Set `today_budget=100`
|
|
229
|
+
- "No budget" -> Set `today_budget=null` (omit amount from config)
|
|
230
|
+
|
|
231
|
+
## Step 8: Write Configuration
|
|
232
|
+
|
|
233
|
+
### Check for existing config
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
test -f ~/.claude/claude-powerline.json && echo "exists" || echo "not_found"
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
If it exists, ask:
|
|
240
|
+
|
|
241
|
+
- **Question**: "Found existing ~/.claude/claude-powerline.json. What should I do?"
|
|
242
|
+
- **Header**: "Existing Config"
|
|
243
|
+
- **Options**:
|
|
244
|
+
- "Replace it" -> Continue
|
|
245
|
+
- "Back it up first" -> Run `cp ~/.claude/claude-powerline.json ~/.claude/claude-powerline.json.bak` then continue
|
|
246
|
+
- "Keep it and exit" -> Exit the wizard
|
|
247
|
+
|
|
248
|
+
### Build and write the config
|
|
249
|
+
|
|
250
|
+
1. **Pick the template file.** If the user chose "tui" style, use `config-tui.json`. Otherwise use the preset template: `config-essential.json`, `config-standard.json`, or `config-full.json`.
|
|
251
|
+
|
|
252
|
+
2. **Read the template** using the Read tool:
|
|
253
|
+
|
|
254
|
+
```text
|
|
255
|
+
${CLAUDE_PLUGIN_ROOT}/templates/<template-file>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
1. **Replace placeholders** in the template content:
|
|
259
|
+
|
|
260
|
+
| Placeholder | Replace with |
|
|
261
|
+
|-------------|-------------|
|
|
262
|
+
| `replace:THEME` | The chosen theme (e.g., `tokyo-night`) |
|
|
263
|
+
| `replace:STYLE` | The chosen style (e.g., `capsule`). Not present in tui template. |
|
|
264
|
+
| `replace:CHARSET` | `unicode` or `text` |
|
|
265
|
+
| `replace:BAR_STYLE` | The chosen bar style (e.g., `blocks`). Default `text` if Step 6 was skipped. Not present in tui template. |
|
|
266
|
+
| `replace:TODAY_BUDGET` | The budget number (e.g., `50`). Not present in essential template. **Important:** replace `"replace:TODAY_BUDGET"` (including the surrounding quotes) with the bare number so the result is `"amount": 50` not `"amount": "50"`. |
|
|
267
|
+
|
|
268
|
+
1. **Handle "No budget"**: If the user chose "No budget" in Step 7, remove the entire `"amount": "replace:TODAY_BUDGET",` line (including the trailing comma) from the budget section. If Step 7 was skipped (essential preset), do not modify the budget section.
|
|
269
|
+
|
|
270
|
+
1. **Write the result** to `~/.claude/claude-powerline.json` using the Write tool. Do NOT read or merge with any existing config.
|
|
271
|
+
|
|
272
|
+
## Step 9: Update settings.json
|
|
273
|
+
|
|
274
|
+
Read `~/.claude/settings.json` if it exists. Add or update ONLY the `statusLine` key:
|
|
275
|
+
|
|
276
|
+
```json
|
|
277
|
+
{
|
|
278
|
+
"statusLine": {
|
|
279
|
+
"type": "command",
|
|
280
|
+
"command": "npx -y @owloops/claude-powerline@latest"
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
If the file does not exist, create it with only the statusLine configuration.
|
|
286
|
+
If it exists, preserve ALL other settings (hooks, permissions, plugins, etc.) and only add or update the `statusLine` key.
|
|
287
|
+
|
|
288
|
+
Use the Read tool to load the existing file, merge the statusLine key, and Write to save it back.
|
|
289
|
+
|
|
290
|
+
## Step 10: Test Installation
|
|
291
|
+
|
|
292
|
+
Run a test with sample data to verify the statusline renders:
|
|
293
|
+
|
|
294
|
+
> [!IMPORTANT]
|
|
295
|
+
> You MUST run this command and tell the user to check the output.
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
${CLAUDE_PLUGIN_ROOT}/bin/preview.sh --theme=${chosen_theme} --style=${chosen_style} --charset=${charset}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
Tell the user: "Check the bash output above for your statusline preview. Expand it if needed."
|
|
302
|
+
|
|
303
|
+
If it produced output, tell the user the setup is working.
|
|
304
|
+
|
|
305
|
+
## Step 11: Success Message
|
|
306
|
+
|
|
307
|
+
Display:
|
|
308
|
+
|
|
309
|
+
````markdown
|
|
310
|
+
Setup complete.
|
|
311
|
+
|
|
312
|
+
**Files created/updated:**
|
|
313
|
+
- `~/.claude/claude-powerline.json` (powerline config)
|
|
314
|
+
- `~/.claude/settings.json` (claude settings)
|
|
315
|
+
|
|
316
|
+
**What now:**
|
|
317
|
+
1. Restart Claude Code if the statusline does not appear.
|
|
318
|
+
2. Run `/powerline` any time to reconfigure.
|
|
319
|
+
3. Edit `~/.claude/claude-powerline.json` by hand for advanced options.
|
|
320
|
+
|
|
321
|
+
Documentation: https://github.com/Owloops/claude-powerline
|
|
322
|
+
````
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"theme": "replace:THEME",
|
|
3
|
+
"display": {
|
|
4
|
+
"style": "replace:STYLE",
|
|
5
|
+
"charset": "replace:CHARSET",
|
|
6
|
+
"colorCompatibility": "auto",
|
|
7
|
+
"autoWrap": true,
|
|
8
|
+
"padding": 1,
|
|
9
|
+
"lines": [
|
|
10
|
+
{
|
|
11
|
+
"segments": {
|
|
12
|
+
"directory": { "enabled": true, "style": "fish" },
|
|
13
|
+
"git": { "enabled": true },
|
|
14
|
+
"model": { "enabled": true }
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"segments": {
|
|
19
|
+
"context": {
|
|
20
|
+
"enabled": true,
|
|
21
|
+
"showPercentageOnly": false,
|
|
22
|
+
"displayStyle": "replace:BAR_STYLE",
|
|
23
|
+
"autocompactBuffer": 33000
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"budget": {
|
|
30
|
+
"session": { "warningThreshold": 80 }
|
|
31
|
+
},
|
|
32
|
+
"modelContextLimits": {
|
|
33
|
+
"sonnet": 1000000,
|
|
34
|
+
"opus": 200000
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"theme": "replace:THEME",
|
|
3
|
+
"display": {
|
|
4
|
+
"style": "replace:STYLE",
|
|
5
|
+
"charset": "replace:CHARSET",
|
|
6
|
+
"colorCompatibility": "auto",
|
|
7
|
+
"autoWrap": true,
|
|
8
|
+
"padding": 1,
|
|
9
|
+
"lines": [
|
|
10
|
+
{
|
|
11
|
+
"segments": {
|
|
12
|
+
"directory": { "enabled": true, "style": "fish" },
|
|
13
|
+
"git": { "enabled": true },
|
|
14
|
+
"model": { "enabled": true },
|
|
15
|
+
"session": { "enabled": true, "type": "tokens", "costSource": "calculated" }
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"segments": {
|
|
20
|
+
"today": { "enabled": true, "type": "cost" },
|
|
21
|
+
"block": { "enabled": true, "type": "cost", "burnType": "cost", "displayStyle": "replace:BAR_STYLE" },
|
|
22
|
+
"weekly": { "enabled": true, "displayStyle": "replace:BAR_STYLE" },
|
|
23
|
+
"context": {
|
|
24
|
+
"enabled": true,
|
|
25
|
+
"showPercentageOnly": false,
|
|
26
|
+
"displayStyle": "replace:BAR_STYLE",
|
|
27
|
+
"autocompactBuffer": 33000
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"segments": {
|
|
33
|
+
"metrics": {
|
|
34
|
+
"enabled": true,
|
|
35
|
+
"showResponseTime": false,
|
|
36
|
+
"showLastResponseTime": false,
|
|
37
|
+
"showDuration": true,
|
|
38
|
+
"showMessageCount": true,
|
|
39
|
+
"showLinesAdded": false,
|
|
40
|
+
"showLinesRemoved": false
|
|
41
|
+
},
|
|
42
|
+
"version": { "enabled": true }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"budget": {
|
|
48
|
+
"session": { "warningThreshold": 80 },
|
|
49
|
+
"today": { "amount": "replace:TODAY_BUDGET", "warningThreshold": 80 }
|
|
50
|
+
},
|
|
51
|
+
"modelContextLimits": {
|
|
52
|
+
"sonnet": 1000000,
|
|
53
|
+
"opus": 200000
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"theme": "replace:THEME",
|
|
3
|
+
"display": {
|
|
4
|
+
"style": "replace:STYLE",
|
|
5
|
+
"charset": "replace:CHARSET",
|
|
6
|
+
"colorCompatibility": "auto",
|
|
7
|
+
"autoWrap": true,
|
|
8
|
+
"padding": 1,
|
|
9
|
+
"lines": [
|
|
10
|
+
{
|
|
11
|
+
"segments": {
|
|
12
|
+
"directory": { "enabled": true, "style": "fish" },
|
|
13
|
+
"git": { "enabled": true },
|
|
14
|
+
"model": { "enabled": true },
|
|
15
|
+
"session": { "enabled": true, "type": "tokens", "costSource": "calculated" }
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"segments": {
|
|
20
|
+
"today": { "enabled": true, "type": "cost" },
|
|
21
|
+
"context": {
|
|
22
|
+
"enabled": true,
|
|
23
|
+
"showPercentageOnly": false,
|
|
24
|
+
"displayStyle": "replace:BAR_STYLE",
|
|
25
|
+
"autocompactBuffer": 33000
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"budget": {
|
|
32
|
+
"session": { "warningThreshold": 80 },
|
|
33
|
+
"today": { "amount": "replace:TODAY_BUDGET", "warningThreshold": 80 }
|
|
34
|
+
},
|
|
35
|
+
"modelContextLimits": {
|
|
36
|
+
"sonnet": 1000000,
|
|
37
|
+
"opus": 200000
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"theme": "replace:THEME",
|
|
3
|
+
"display": {
|
|
4
|
+
"style": "tui",
|
|
5
|
+
"charset": "replace:CHARSET",
|
|
6
|
+
"colorCompatibility": "auto",
|
|
7
|
+
"autoWrap": true,
|
|
8
|
+
"padding": 0
|
|
9
|
+
},
|
|
10
|
+
"budget": {
|
|
11
|
+
"session": { "warningThreshold": 80 },
|
|
12
|
+
"today": { "amount": "replace:TODAY_BUDGET", "warningThreshold": 80 }
|
|
13
|
+
},
|
|
14
|
+
"modelContextLimits": {
|
|
15
|
+
"sonnet": 1000000,
|
|
16
|
+
"opus": 200000
|
|
17
|
+
}
|
|
18
|
+
}
|