ccstatusline-usage 2.0.46 → 2.1.2
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 +26 -81
- package/dist/ccstatusline.js +68 -44
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -14,36 +14,18 @@
|
|
|
14
14
|
**🎨 A highly customizable status line formatter for Claude Code CLI**
|
|
15
15
|
*Display model info, git branch, token usage, and other metrics in your terminal*
|
|
16
16
|
|
|
17
|
-
[](https://www.npmjs.com/package/ccstatusline)
|
|
18
|
+
[](https://www.npmjs.com/package/ccstatusline)
|
|
19
19
|
[](https://github.com/sirmalloc/ccstatusline/blob/main/LICENSE)
|
|
20
|
-
[](https://nodejs.org)
|
|
21
|
+
[](https://packagephobia.com/result?p=ccstatusline)
|
|
22
22
|
[](https://github.com/sirmalloc/ccstatusline/graphs/commit-activity)
|
|
23
23
|
|
|
24
24
|
[](https://github.com/hesreallyhim/awesome-claude-code)
|
|
25
25
|
[](https://claudelog.com/)
|
|
26
26
|
|
|
27
|
-
## Fork Enhancements
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- **Session/Weekly Usage** - Real utilization from Anthropic API with progress bars
|
|
32
|
-
- **Extra Usage** - When weekly limit is reached, shows extra usage spending (e.g. `Extra: €41.24/€47.00`)
|
|
33
|
-
- **Reset Timer** - Time until 5-hour session window resets
|
|
34
|
-
- **Context Window Display** - Visual bar showing context usage
|
|
35
|
-
- **Two-line Layout** - Session info on line 1, context on line 2
|
|
36
|
-
|
|
37
|
-
### Enhanced Status Line Preview
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
Session: [████░░░░░░░░░░░] 27.0% | Weekly: [████████████░░░] 86.0% | 1:56 hr | Extra: $41.24/$47.00 | Model: Opus 4.6 | Session ID: 714aa815-8a...
|
|
41
|
-
Context: [███████░░░░░░░░] 103k/200k (51%)
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
These widgets are enabled by default. Just install and run!
|
|
45
|
-
|
|
46
|
-

|
|
28
|
+

|
|
47
29
|
|
|
48
30
|
</div>
|
|
49
31
|
|
|
@@ -57,7 +39,6 @@ These widgets are enabled by default. Just install and run!
|
|
|
57
39
|
- [API Documentation](#-api-documentation)
|
|
58
40
|
- [Development](#️-development)
|
|
59
41
|
- [Contributing](#-contributing)
|
|
60
|
-
- [Uninstall](#️-uninstall)
|
|
61
42
|
- [License](#-license)
|
|
62
43
|
- [Related Projects](#-related-projects)
|
|
63
44
|
|
|
@@ -65,19 +46,11 @@ These widgets are enabled by default. Just install and run!
|
|
|
65
46
|
|
|
66
47
|
## 🆕 Recent Updates
|
|
67
48
|
|
|
68
|
-
### [v2.
|
|
69
|
-
|
|
70
|
-
- Merged 101 upstream commits: line reorder move mode, Claude Session ID widget, `CLAUDE_CONFIG_DIR` support, Windows fixes, Block Timer fixes, model string/object handling fix, and more
|
|
71
|
-
|
|
72
|
-
### [v2.0.45](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.0.45) - Extra usage spending display
|
|
49
|
+
### [v2.1.2](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.1.2) - Token auth fallback and 401 handling
|
|
73
50
|
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
|
|
77
|
-
### [v2.0.42](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.0.42) - Fix reset timer API field
|
|
78
|
-
|
|
79
|
-
- Fixed API field name from `reset_at` to `resets_at` — reset timer now displays correctly
|
|
80
|
-
- Merged latest changes from upstream ccstatusline
|
|
51
|
+
- [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): macOS file credential fallback — reads `~/.claude/.credentials.json` when Keychain entry is missing
|
|
52
|
+
- [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): 401 auth error handling — invalidates cached token so next call re-reads from disk after `/login`
|
|
53
|
+
- Synced with upstream (101 commits)
|
|
81
54
|
|
|
82
55
|
### v2.0.16 - Add fish style path abbreviation toggle to Current Working Directory widget
|
|
83
56
|
|
|
@@ -93,7 +66,7 @@ These widgets are enabled by default. Just install and run!
|
|
|
93
66
|
|
|
94
67
|
- **👾 Emoji Support** - You can now paste emoji into the custom text widget. You can also turn on the merge option to get emoji labels for your widgets like this:
|
|
95
68
|
|
|
96
|
-

|
|
69
|
+

|
|
97
70
|
|
|
98
71
|
### v2.0.11 - Unlimited Status Lines
|
|
99
72
|
|
|
@@ -106,13 +79,13 @@ These widgets are enabled by default. Just install and run!
|
|
|
106
79
|
|
|
107
80
|
### v2.0.8 - Powerline Auto-Alignment
|
|
108
81
|
|
|
109
|
-

|
|
82
|
+

|
|
110
83
|
|
|
111
84
|
- **🎯 Widget Alignment** - Auto-align widgets across multiple status lines in Powerline mode for a clean, columnar layout (toggle with 'a' in Powerline Setup)
|
|
112
85
|
|
|
113
86
|
### v2.0.7 - Current Working Directory & Session Cost
|
|
114
87
|
|
|
115
|
-

|
|
88
|
+

|
|
116
89
|
|
|
117
90
|
- **📁 Current Working Directory** - Display the current working directory with configurable segment display
|
|
118
91
|
- Set the number of path segments to show (e.g., show only last 2 segments: `.../Personal/ccstatusline`)
|
|
@@ -130,7 +103,7 @@ These widgets are enabled by default. Just install and run!
|
|
|
130
103
|
|
|
131
104
|
### v2.0.2 - Block Timer Widget
|
|
132
105
|
|
|
133
|
-

|
|
106
|
+

|
|
134
107
|
|
|
135
108
|
- **⏱️ Block Timer** - Track your progress through 5-hour Claude Code blocks
|
|
136
109
|
- Displays time elapsed in current block as hours/minutes (e.g., "3hr 45m")
|
|
@@ -149,13 +122,9 @@ These widgets are enabled by default. Just install and run!
|
|
|
149
122
|
|
|
150
123
|
---
|
|
151
124
|
|
|
152
|
-
</div>
|
|
153
|
-
|
|
154
125
|
## ✨ Features
|
|
155
126
|
|
|
156
127
|
- **📊 Real-time Metrics** - Display model name, git branch, token usage, session duration, block timer, and more
|
|
157
|
-
- **📈 API Usage Tracking** - Real-time 5-hour session and weekly utilization from Anthropic API with progress bars
|
|
158
|
-
- **⏱️ Reset Timer** - Countdown to when your 5-hour session window resets
|
|
159
128
|
- **🎨 Fully Customizable** - Choose what to display and customize colors for each element
|
|
160
129
|
- **⚡ Powerline Support** - Beautiful Powerline-style rendering with arrow separators, caps, and custom fonts
|
|
161
130
|
- **📐 Multi-line Support** - Configure multiple independent status lines
|
|
@@ -174,10 +143,10 @@ These widgets are enabled by default. Just install and run!
|
|
|
174
143
|
|
|
175
144
|
```bash
|
|
176
145
|
# Run the configuration TUI with npm
|
|
177
|
-
npx ccstatusline
|
|
146
|
+
npx ccstatusline@latest
|
|
178
147
|
|
|
179
148
|
# Or with Bun (faster)
|
|
180
|
-
bunx ccstatusline
|
|
149
|
+
bunx ccstatusline@latest
|
|
181
150
|
```
|
|
182
151
|
|
|
183
152
|
### Configure ccstatusline
|
|
@@ -216,19 +185,19 @@ ccstatusline works seamlessly on Windows with full feature compatibility across
|
|
|
216
185
|
irm bun.sh/install.ps1 | iex
|
|
217
186
|
|
|
218
187
|
# Run ccstatusline
|
|
219
|
-
bunx ccstatusline
|
|
188
|
+
bunx ccstatusline@latest
|
|
220
189
|
```
|
|
221
190
|
|
|
222
191
|
#### Option 2: Using Node.js
|
|
223
192
|
```powershell
|
|
224
193
|
# Using npm
|
|
225
|
-
npx ccstatusline
|
|
194
|
+
npx ccstatusline@latest
|
|
226
195
|
|
|
227
196
|
# Or with Yarn
|
|
228
|
-
yarn dlx ccstatusline
|
|
197
|
+
yarn dlx ccstatusline@latest
|
|
229
198
|
|
|
230
199
|
# Or with pnpm
|
|
231
|
-
pnpm dlx ccstatusline
|
|
200
|
+
pnpm dlx ccstatusline@latest
|
|
232
201
|
```
|
|
233
202
|
|
|
234
203
|
### Windows-Specific Features
|
|
@@ -283,7 +252,7 @@ winget install Git.Git
|
|
|
283
252
|
**Issue**: Permission errors during installation
|
|
284
253
|
```powershell
|
|
285
254
|
# Use non-global installation (recommended)
|
|
286
|
-
npx ccstatusline
|
|
255
|
+
npx ccstatusline@latest
|
|
287
256
|
|
|
288
257
|
# Or run PowerShell as Administrator for global install
|
|
289
258
|
```
|
|
@@ -311,7 +280,7 @@ ccstatusline works perfectly in WSL environments:
|
|
|
311
280
|
# Install in WSL Ubuntu/Debian
|
|
312
281
|
curl -fsSL https://bun.sh/install | bash
|
|
313
282
|
source ~/.bashrc
|
|
314
|
-
bunx ccstatusline
|
|
283
|
+
bunx ccstatusline@latest
|
|
315
284
|
```
|
|
316
285
|
|
|
317
286
|
**WSL Benefits**:
|
|
@@ -348,14 +317,14 @@ Configure ccstatusline in your Claude Code settings:
|
|
|
348
317
|
**For Bun users**:
|
|
349
318
|
```json
|
|
350
319
|
{
|
|
351
|
-
"statusLine": "bunx ccstatusline
|
|
320
|
+
"statusLine": "bunx ccstatusline@latest"
|
|
352
321
|
}
|
|
353
322
|
```
|
|
354
323
|
|
|
355
324
|
**For npm users**:
|
|
356
325
|
```json
|
|
357
326
|
{
|
|
358
|
-
"statusLine": "npx ccstatusline
|
|
327
|
+
"statusLine": "npx ccstatusline@latest"
|
|
359
328
|
}
|
|
360
329
|
```
|
|
361
330
|
|
|
@@ -386,15 +355,7 @@ Once configured, ccstatusline automatically formats your Claude Code status line
|
|
|
386
355
|
|
|
387
356
|
### 📊 Available Widgets
|
|
388
357
|
|
|
389
|
-
#### API Usage Widgets ([pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage))
|
|
390
|
-
- **Session Usage** - 5-hour session utilization with progress bar (e.g., "Session: [████░░░░░░░░░░░] 29.0%")
|
|
391
|
-
- **Weekly Usage** - 7-day utilization with progress bar (e.g., "Weekly: [█░░░░░░░░░░░░░░] 7.0%")
|
|
392
|
-
- **Reset Timer / Extra Usage** - Time until 5-hour session window resets (e.g., "2:59 hr"), or extra usage spending when weekly limit is reached (e.g., "Extra: €41.24/€47.00")
|
|
393
|
-
- **Context Bar** - Visual context window usage with bar (e.g., "Context: [███████░░░░░░░░] 103k/200k (51%)")
|
|
394
|
-
|
|
395
|
-
#### Standard Widgets
|
|
396
358
|
- **Model Name** - Shows the current Claude model (e.g., "Claude 3.5 Sonnet")
|
|
397
|
-
- **Claude Session ID** - Shows the current session UUID
|
|
398
359
|
- **Git Branch** - Displays current git branch name
|
|
399
360
|
- **Git Changes** - Shows uncommitted insertions/deletions (e.g., "+42,-10")
|
|
400
361
|
- **Git Worktree** - Shows the name of the current git worktree
|
|
@@ -524,7 +485,7 @@ Execute shell commands and display their output dynamically:
|
|
|
524
485
|
3. Set timeout: `5000` (5 seconds for initial download)
|
|
525
486
|
4. Enable "preserve colors" to keep ccusage's color formatting
|
|
526
487
|
|
|
527
|
-

|
|
488
|
+

|
|
528
489
|
|
|
529
490
|
> 📄 **How it works:** The command receives Claude Code's JSON data via stdin, allowing ccusage to access session information, model details, and transcript data for accurate usage tracking.
|
|
530
491
|
|
|
@@ -645,17 +606,6 @@ Contributions are welcome! Please feel free to submit a Pull Request.
|
|
|
645
606
|
|
|
646
607
|
---
|
|
647
608
|
|
|
648
|
-
## 🗑️ Uninstall
|
|
649
|
-
|
|
650
|
-
```bash
|
|
651
|
-
npm uninstall -g ccstatusline-usage
|
|
652
|
-
rm -rf ~/.npm/_npx ~/.config/ccstatusline ~/.cache/ccstatusline*
|
|
653
|
-
jq 'del(.statusLine)' ~/.claude/settings.json > /tmp/cs.json && cat /tmp/cs.json > ~/.claude/settings.json
|
|
654
|
-
```
|
|
655
|
-
|
|
656
|
-
---
|
|
657
|
-
|
|
658
|
-
|
|
659
609
|
## 📄 License
|
|
660
610
|
|
|
661
611
|
[MIT](LICENSE) © Matthew Breedlove
|
|
@@ -668,11 +618,6 @@ jq 'del(.statusLine)' ~/.claude/settings.json > /tmp/cs.json && cat /tmp/cs.json
|
|
|
668
618
|
|
|
669
619
|
- GitHub: [@sirmalloc](https://github.com/sirmalloc)
|
|
670
620
|
|
|
671
|
-
**PC van Velzen** ([pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage) fork)
|
|
672
|
-
|
|
673
|
-
- GitHub: [@pcvelz](https://github.com/pcvelz)
|
|
674
|
-
|
|
675
|
-
|
|
676
621
|
---
|
|
677
622
|
|
|
678
623
|
## 🔗 Related Projects
|
|
@@ -710,8 +655,8 @@ Give a ⭐ if this project helped you!
|
|
|
710
655
|
[](https://github.com/sirmalloc/ccstatusline/network/members)
|
|
711
656
|
[](https://github.com/sirmalloc/ccstatusline/watchers)
|
|
712
657
|
|
|
713
|
-
[](https://www.npmjs.com/package/ccstatusline)
|
|
659
|
+
[](https://www.npmjs.com/package/ccstatusline)
|
|
715
660
|
[](https://github.com/sirmalloc/ccstatusline/blob/main/LICENSE)
|
|
716
661
|
[](https://bun.sh)
|
|
717
662
|
|
package/dist/ccstatusline.js
CHANGED
|
@@ -51450,7 +51450,7 @@ import { execSync as execSync3 } from "child_process";
|
|
|
51450
51450
|
import * as fs5 from "fs";
|
|
51451
51451
|
import * as path4 from "path";
|
|
51452
51452
|
var __dirname = "/Users/peter/Documents/Code/ccstatusline-usage/src/utils";
|
|
51453
|
-
var PACKAGE_VERSION = "2.
|
|
51453
|
+
var PACKAGE_VERSION = "2.1.2";
|
|
51454
51454
|
function getPackageVersion() {
|
|
51455
51455
|
if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
|
|
51456
51456
|
return PACKAGE_VERSION;
|
|
@@ -53456,18 +53456,6 @@ class ContextPercentageWidget {
|
|
|
53456
53456
|
const usedPercentage = Math.min(100, context.tokenMetrics.contextLength / contextConfig.maxTokens * 100);
|
|
53457
53457
|
const displayPercentage = isInverse ? 100 - usedPercentage : usedPercentage;
|
|
53458
53458
|
return item.rawValue ? `${displayPercentage.toFixed(1)}%` : `Ctx: ${displayPercentage.toFixed(1)}%`;
|
|
53459
|
-
} else if (context.data?.context_window) {
|
|
53460
|
-
const ctxWindow = context.data.context_window;
|
|
53461
|
-
let usedPercentage = null;
|
|
53462
|
-
if (typeof ctxWindow.used_percentage === "number") {
|
|
53463
|
-
usedPercentage = ctxWindow.used_percentage;
|
|
53464
|
-
} else if (typeof ctxWindow.current_usage === "number" && ctxWindow.context_window_size) {
|
|
53465
|
-
usedPercentage = Math.min(100, ctxWindow.current_usage / ctxWindow.context_window_size * 100);
|
|
53466
|
-
}
|
|
53467
|
-
if (usedPercentage !== null) {
|
|
53468
|
-
const displayPercentage = isInverse ? 100 - usedPercentage : usedPercentage;
|
|
53469
|
-
return item.rawValue ? `${displayPercentage.toFixed(1)}%` : `Ctx: ${displayPercentage.toFixed(1)}%`;
|
|
53470
|
-
}
|
|
53471
53459
|
}
|
|
53472
53460
|
return null;
|
|
53473
53461
|
}
|
|
@@ -54419,35 +54407,43 @@ var cachedData = null;
|
|
|
54419
54407
|
var cacheTime = 0;
|
|
54420
54408
|
var cachedToken = null;
|
|
54421
54409
|
var tokenCacheTime = 0;
|
|
54410
|
+
var CRED_FILE = path5.join(process.env.HOME ?? "", ".claude", ".credentials.json");
|
|
54411
|
+
function readTokenFromFile() {
|
|
54412
|
+
try {
|
|
54413
|
+
const creds = JSON.parse(fs6.readFileSync(CRED_FILE, "utf8"));
|
|
54414
|
+
return creds?.claudeAiOauth?.accessToken ?? null;
|
|
54415
|
+
} catch {
|
|
54416
|
+
return null;
|
|
54417
|
+
}
|
|
54418
|
+
}
|
|
54419
|
+
function readTokenFromKeychain() {
|
|
54420
|
+
try {
|
|
54421
|
+
const result = execSync8('security find-generic-password -s "Claude Code-credentials" -w 2>/dev/null', { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
54422
|
+
const parsed = JSON.parse(result);
|
|
54423
|
+
return parsed?.claudeAiOauth?.accessToken ?? null;
|
|
54424
|
+
} catch {
|
|
54425
|
+
return null;
|
|
54426
|
+
}
|
|
54427
|
+
}
|
|
54428
|
+
function invalidateTokenCache() {
|
|
54429
|
+
cachedToken = null;
|
|
54430
|
+
tokenCacheTime = 0;
|
|
54431
|
+
}
|
|
54422
54432
|
function getToken() {
|
|
54423
54433
|
const now = Math.floor(Date.now() / 1000);
|
|
54424
54434
|
if (cachedToken && now - tokenCacheTime < TOKEN_CACHE_MAX_AGE) {
|
|
54425
54435
|
return cachedToken;
|
|
54426
54436
|
}
|
|
54427
|
-
|
|
54428
|
-
|
|
54429
|
-
|
|
54430
|
-
|
|
54431
|
-
|
|
54432
|
-
|
|
54433
|
-
|
|
54434
|
-
|
|
54435
|
-
tokenCacheTime = now;
|
|
54436
|
-
}
|
|
54437
|
-
return token;
|
|
54438
|
-
} else {
|
|
54439
|
-
const credFile = path5.join(process.env.HOME ?? "", ".claude", ".credentials.json");
|
|
54440
|
-
const creds = JSON.parse(fs6.readFileSync(credFile, "utf8"));
|
|
54441
|
-
const token = creds?.claudeAiOauth?.accessToken ?? null;
|
|
54442
|
-
if (token) {
|
|
54443
|
-
cachedToken = token;
|
|
54444
|
-
tokenCacheTime = now;
|
|
54445
|
-
}
|
|
54446
|
-
return token;
|
|
54447
|
-
}
|
|
54448
|
-
} catch {
|
|
54449
|
-
return null;
|
|
54437
|
+
let token = null;
|
|
54438
|
+
if (process.platform === "darwin")
|
|
54439
|
+
token = readTokenFromKeychain();
|
|
54440
|
+
if (!token)
|
|
54441
|
+
token = readTokenFromFile();
|
|
54442
|
+
if (token) {
|
|
54443
|
+
cachedToken = token;
|
|
54444
|
+
tokenCacheTime = now;
|
|
54450
54445
|
}
|
|
54446
|
+
return token;
|
|
54451
54447
|
}
|
|
54452
54448
|
function readStaleCache() {
|
|
54453
54449
|
try {
|
|
@@ -54475,6 +54471,8 @@ function fetchFromApi(token) {
|
|
|
54475
54471
|
res.on('end', () => {
|
|
54476
54472
|
if (res.statusCode === 200) {
|
|
54477
54473
|
process.stdout.write(data);
|
|
54474
|
+
} else if (res.statusCode === 401) {
|
|
54475
|
+
process.exit(2);
|
|
54478
54476
|
} else {
|
|
54479
54477
|
process.exit(1);
|
|
54480
54478
|
}
|
|
@@ -54489,7 +54487,14 @@ function fetchFromApi(token) {
|
|
|
54489
54487
|
timeout: 6000,
|
|
54490
54488
|
env: { ...process.env, TOKEN: token }
|
|
54491
54489
|
});
|
|
54492
|
-
if (result.error ||
|
|
54490
|
+
if (result.error || !result.stdout) {
|
|
54491
|
+
if (result.status === 2)
|
|
54492
|
+
return "auth-error";
|
|
54493
|
+
return null;
|
|
54494
|
+
}
|
|
54495
|
+
if (result.status !== 0) {
|
|
54496
|
+
if (result.status === 2)
|
|
54497
|
+
return "auth-error";
|
|
54493
54498
|
return null;
|
|
54494
54499
|
}
|
|
54495
54500
|
return result.stdout;
|
|
@@ -54537,6 +54542,13 @@ function fetchApiData() {
|
|
|
54537
54542
|
}
|
|
54538
54543
|
try {
|
|
54539
54544
|
const response = fetchFromApi(token);
|
|
54545
|
+
if (response === "auth-error") {
|
|
54546
|
+
invalidateTokenCache();
|
|
54547
|
+
const stale = readStaleCache();
|
|
54548
|
+
if (stale && !stale.error)
|
|
54549
|
+
return stale;
|
|
54550
|
+
return { error: "api-error" };
|
|
54551
|
+
}
|
|
54540
54552
|
if (!response) {
|
|
54541
54553
|
const stale = readStaleCache();
|
|
54542
54554
|
if (stale && !stale.error)
|
|
@@ -54593,11 +54605,21 @@ function getErrorMessage(error43) {
|
|
|
54593
54605
|
return "[Parse Error]";
|
|
54594
54606
|
}
|
|
54595
54607
|
}
|
|
54596
|
-
|
|
54608
|
+
var MOBILE_THRESHOLD = 80;
|
|
54609
|
+
var MOBILE_BAR_WIDTH = 4;
|
|
54610
|
+
var DEFAULT_BAR_WIDTH = 15;
|
|
54611
|
+
function isMobileWidth(context) {
|
|
54612
|
+
return (context.terminalWidth ?? 0) > 0 && (context.terminalWidth ?? 0) < MOBILE_THRESHOLD;
|
|
54613
|
+
}
|
|
54614
|
+
function makeProgressBar(percent, width = DEFAULT_BAR_WIDTH) {
|
|
54597
54615
|
const filled = Math.round(percent / 100 * width);
|
|
54598
54616
|
const empty = width - filled;
|
|
54599
54617
|
return "[" + "█".repeat(filled) + "░".repeat(empty) + "]";
|
|
54600
54618
|
}
|
|
54619
|
+
function formatUsageBar(label, shortLabel, percent, mobile) {
|
|
54620
|
+
const bar = makeProgressBar(percent, mobile ? MOBILE_BAR_WIDTH : DEFAULT_BAR_WIDTH);
|
|
54621
|
+
return `${mobile ? shortLabel : label}: ${bar} ${percent.toFixed(1)}%`;
|
|
54622
|
+
}
|
|
54601
54623
|
|
|
54602
54624
|
class SessionUsageWidget {
|
|
54603
54625
|
getDefaultColor() {
|
|
@@ -54620,8 +54642,7 @@ class SessionUsageWidget {
|
|
|
54620
54642
|
return getErrorMessage(data.error);
|
|
54621
54643
|
if (data.sessionUsage === undefined)
|
|
54622
54644
|
return null;
|
|
54623
|
-
|
|
54624
|
-
return `Session: ${makeProgressBar(percent)} ${percent.toFixed(1)}%`;
|
|
54645
|
+
return formatUsageBar("Session", "S", data.sessionUsage, isMobileWidth(context));
|
|
54625
54646
|
}
|
|
54626
54647
|
supportsRawValue() {
|
|
54627
54648
|
return false;
|
|
@@ -54652,8 +54673,7 @@ class WeeklyUsageWidget {
|
|
|
54652
54673
|
return getErrorMessage(data.error);
|
|
54653
54674
|
if (data.weeklyUsage === undefined)
|
|
54654
54675
|
return null;
|
|
54655
|
-
|
|
54656
|
-
return `Weekly: ${makeProgressBar(percent)} ${percent.toFixed(1)}%`;
|
|
54676
|
+
return formatUsageBar("Weekly", "W", data.weeklyUsage, isMobileWidth(context));
|
|
54657
54677
|
}
|
|
54658
54678
|
supportsRawValue() {
|
|
54659
54679
|
return false;
|
|
@@ -54754,7 +54774,11 @@ class ContextBarWidget {
|
|
|
54754
54774
|
const percent = total > 0 ? used / total * 100 : 0;
|
|
54755
54775
|
const usedK = Math.round(used / 1000);
|
|
54756
54776
|
const totalK = Math.round(total / 1000);
|
|
54757
|
-
|
|
54777
|
+
const mobile = isMobileWidth(context);
|
|
54778
|
+
const bar = makeProgressBar(percent, mobile ? MOBILE_BAR_WIDTH : DEFAULT_BAR_WIDTH);
|
|
54779
|
+
const label = mobile ? "C" : "Context";
|
|
54780
|
+
const suffix = mobile ? "" : ` (${Math.round(percent)}%)`;
|
|
54781
|
+
return `${label}: ${bar} ${usedK}k/${totalK}k${suffix}`;
|
|
54758
54782
|
}
|
|
54759
54783
|
supportsRawValue() {
|
|
54760
54784
|
return false;
|
|
@@ -58423,7 +58447,7 @@ Continue?`;
|
|
|
58423
58447
|
bold: true,
|
|
58424
58448
|
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(dist_default4, {
|
|
58425
58449
|
name: "retro",
|
|
58426
|
-
children: "CCStatusline
|
|
58450
|
+
children: "CCStatusline Configuration"
|
|
58427
58451
|
}, undefined, false, undefined, this)
|
|
58428
58452
|
}, undefined, false, undefined, this),
|
|
58429
58453
|
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccstatusline-usage",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "A customizable status line formatter for Claude Code CLI",
|
|
5
5
|
"module": "src/ccstatusline.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"prepublishOnly": "bun run build",
|
|
19
19
|
"lint": "bun tsc --noEmit; eslint . --config eslint.config.js --max-warnings=999999 --fix",
|
|
20
20
|
"test": "bun vitest",
|
|
21
|
+
"publish:safe": "bash scripts/safe-publish.sh",
|
|
21
22
|
"docs": "typedoc",
|
|
22
23
|
"docs:clean": "rm -rf docs"
|
|
23
24
|
},
|