ccstatusline-usage 2.0.25 → 2.0.27

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 CHANGED
@@ -42,7 +42,7 @@ Session: [████░░░░░░░░░░░] 27.0% | Weekly: [██
42
42
 
43
43
  To use the enhanced configuration, copy `defaults/settings-enhanced.json` to your config directory.
44
44
 
45
- ![Demo](https://raw.githubusercontent.com/sirmalloc/ccstatusline/main/screenshots/demo.gif)
45
+ ![Status Bar Demo](screenshots/status-bar-demo.png)
46
46
 
47
47
  </div>
48
48
 
@@ -77,7 +77,7 @@ To use the enhanced configuration, copy `defaults/settings-enhanced.json` to you
77
77
 
78
78
  - **👾 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:
79
79
 
80
- ![Emoji Support](https://raw.githubusercontent.com/sirmalloc/ccstatusline/main/screenshots/emojiSupport.png)
80
+ ![Emoji Support](screenshots/emojiSupport.png)
81
81
 
82
82
  ### v2.0.11 - Unlimited Status Lines
83
83
 
@@ -90,13 +90,13 @@ To use the enhanced configuration, copy `defaults/settings-enhanced.json` to you
90
90
 
91
91
  ### v2.0.8 - Powerline Auto-Alignment
92
92
 
93
- ![Powerline Auto-Alignment](https://raw.githubusercontent.com/sirmalloc/ccstatusline/main/screenshots/autoAlign.png)
93
+ ![Powerline Auto-Alignment](screenshots/autoAlign.png)
94
94
 
95
95
  - **🎯 Widget Alignment** - Auto-align widgets across multiple status lines in Powerline mode for a clean, columnar layout (toggle with 'a' in Powerline Setup)
96
96
 
97
97
  ### v2.0.7 - Current Working Directory & Session Cost
98
98
 
99
- ![Current Working Directory and Session Cost](https://raw.githubusercontent.com/sirmalloc/ccstatusline/main/screenshots/cwdAndSessionCost.png)
99
+ ![Current Working Directory and Session Cost](screenshots/cwdAndSessionCost.png)
100
100
 
101
101
  - **📁 Current Working Directory** - Display the current working directory with configurable segment display
102
102
  - Set the number of path segments to show (e.g., show only last 2 segments: `.../Personal/ccstatusline`)
@@ -114,7 +114,7 @@ To use the enhanced configuration, copy `defaults/settings-enhanced.json` to you
114
114
 
115
115
  ### v2.0.2 - Block Timer Widget
116
116
 
117
- ![Block Timer](https://raw.githubusercontent.com/sirmalloc/ccstatusline/main/screenshots/blockTimerSmall.png)
117
+ ![Block Timer](screenshots/blockTimerSmall.png)
118
118
 
119
119
  - **⏱️ Block Timer** - Track your progress through 5-hour Claude Code blocks
120
120
  - Displays time elapsed in current block as hours/minutes (e.g., "3hr 45m")
@@ -136,6 +136,8 @@ To use the enhanced configuration, copy `defaults/settings-enhanced.json` to you
136
136
  ## ✨ Features
137
137
 
138
138
  - **📊 Real-time Metrics** - Display model name, git branch, token usage, session duration, block timer, and more
139
+ - **📈 API Usage Tracking** - Real-time 5-hour session and weekly utilization from Anthropic API with progress bars
140
+ - **⏱️ Reset Timer** - Countdown to when your 5-hour session window resets
139
141
  - **🎨 Fully Customizable** - Choose what to display and customize colors for each element
140
142
  - **⚡ Powerline Support** - Beautiful Powerline-style rendering with arrow separators, caps, and custom fonts
141
143
  - **📐 Multi-line Support** - Configure multiple independent status lines
@@ -366,7 +368,15 @@ Once configured, ccstatusline automatically formats your Claude Code status line
366
368
 
367
369
  ### 📊 Available Widgets
368
370
 
371
+ #### API Usage Widgets (Fork Enhancement)
372
+ - **Session Usage** - 5-hour session utilization with progress bar (e.g., "Session: [████░░░░░░░░░░░] 29.0%")
373
+ - **Weekly Usage** - 7-day utilization with progress bar (e.g., "Weekly: [█░░░░░░░░░░░░░░] 7.0%")
374
+ - **Reset Timer** - Time until 5-hour session window resets (e.g., "2:59 hr")
375
+ - **Context Bar** - Visual context window usage with bar (e.g., "Context: [███████░░░░░░░░] 103k/200k (51%)")
376
+
377
+ #### Standard Widgets
369
378
  - **Model Name** - Shows the current Claude model (e.g., "Claude 3.5 Sonnet")
379
+ - **Claude Session ID** - Shows the current session UUID
370
380
  - **Git Branch** - Displays current git branch name
371
381
  - **Git Changes** - Shows uncommitted insertions/deletions (e.g., "+42,-10")
372
382
  - **Git Worktree** - Shows the name of the current git worktree
@@ -403,7 +413,7 @@ These settings affect where long lines are truncated, and where right-alignment
403
413
 
404
414
  Configure global formatting preferences that apply to all widgets:
405
415
 
406
- ![Global Options](https://raw.githubusercontent.com/sirmalloc/ccstatusline/main/screenshots/global.png)
416
+ ![Global Options](screenshots/global.png)
407
417
 
408
418
  #### Default Padding & Separators
409
419
  - **Default Padding** - Add consistent padding to the left and right of each widget
@@ -435,7 +445,7 @@ Configure global formatting preferences that apply to all widgets:
435
445
 
436
446
  The Block Timer widget helps you track your progress through Claude Code's 5-hour conversation blocks:
437
447
 
438
- ![Block Timer](https://raw.githubusercontent.com/sirmalloc/ccstatusline/main/screenshots/blockTimer.png)
448
+ ![Block Timer](screenshots/blockTimer.png)
439
449
 
440
450
  **Display Modes:**
441
451
  - **Time Display** - Shows elapsed time as "3hr 45m" (default)
@@ -496,7 +506,7 @@ Execute shell commands and display their output dynamically:
496
506
  3. Set timeout: `5000` (5 seconds for initial download)
497
507
  4. Enable "preserve colors" to keep ccusage's color formatting
498
508
 
499
- ![ccusage integration](https://raw.githubusercontent.com/sirmalloc/ccstatusline/main/screenshots/ccusage.png)
509
+ ![ccusage integration](screenshots/ccusage.png)
500
510
 
501
511
  > 📄 **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.
502
512
 
@@ -51444,7 +51444,7 @@ import { execSync as execSync3 } from "child_process";
51444
51444
  import * as fs5 from "fs";
51445
51445
  import * as path4 from "path";
51446
51446
  var __dirname = "/Users/peter/Documents/Code/ccstatusline-usage/src/utils";
51447
- var PACKAGE_VERSION = "2.0.25";
51447
+ var PACKAGE_VERSION = "2.0.27";
51448
51448
  function getPackageVersion() {
51449
51449
  if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
51450
51450
  return PACKAGE_VERSION;
@@ -53445,12 +53445,18 @@ class ContextPercentageWidget {
53445
53445
  const usedPercentage = Math.min(100, context.tokenMetrics.contextLength / contextConfig.maxTokens * 100);
53446
53446
  const displayPercentage = isInverse ? 100 - usedPercentage : usedPercentage;
53447
53447
  return item.rawValue ? `${displayPercentage.toFixed(1)}%` : `Ctx: ${displayPercentage.toFixed(1)}%`;
53448
- } else if (context.data?.context_window?.context_window_size && context.data?.context_window?.current_usage !== undefined) {
53449
- const maxTokens = context.data.context_window.context_window_size;
53450
- const currentUsage = context.data.context_window.current_usage;
53451
- const usedPercentage = Math.min(100, currentUsage / maxTokens * 100);
53452
- const displayPercentage = isInverse ? 100 - usedPercentage : usedPercentage;
53453
- return item.rawValue ? `${displayPercentage.toFixed(1)}%` : `Ctx: ${displayPercentage.toFixed(1)}%`;
53448
+ } else if (context.data?.context_window) {
53449
+ const ctxWindow = context.data.context_window;
53450
+ let usedPercentage = null;
53451
+ if (typeof ctxWindow.used_percentage === "number") {
53452
+ usedPercentage = ctxWindow.used_percentage;
53453
+ } else if (typeof ctxWindow.current_usage === "number" && ctxWindow.context_window_size) {
53454
+ usedPercentage = Math.min(100, ctxWindow.current_usage / ctxWindow.context_window_size * 100);
53455
+ }
53456
+ if (usedPercentage !== null) {
53457
+ const displayPercentage = isInverse ? 100 - usedPercentage : usedPercentage;
53458
+ return item.rawValue ? `${displayPercentage.toFixed(1)}%` : `Ctx: ${displayPercentage.toFixed(1)}%`;
53459
+ }
53454
53460
  }
53455
53461
  return null;
53456
53462
  }
@@ -58208,9 +58214,21 @@ var StatusJSONSchema = exports_external.looseObject({
58208
58214
  total_lines_removed: exports_external.number().optional()
58209
58215
  }).optional(),
58210
58216
  context_window: exports_external.object({
58211
- context_window_size: exports_external.number().optional(),
58212
- current_usage: exports_external.number().optional()
58213
- }).optional()
58217
+ context_window_size: exports_external.number().nullable().optional(),
58218
+ total_input_tokens: exports_external.number().nullable().optional(),
58219
+ total_output_tokens: exports_external.number().nullable().optional(),
58220
+ current_usage: exports_external.union([
58221
+ exports_external.number(),
58222
+ exports_external.object({
58223
+ input_tokens: exports_external.number().optional(),
58224
+ output_tokens: exports_external.number().optional(),
58225
+ cache_creation_input_tokens: exports_external.number().optional(),
58226
+ cache_read_input_tokens: exports_external.number().optional()
58227
+ })
58228
+ ]).nullable().optional(),
58229
+ used_percentage: exports_external.number().nullable().optional(),
58230
+ remaining_percentage: exports_external.number().nullable().optional()
58231
+ }).nullable().optional()
58214
58232
  });
58215
58233
 
58216
58234
  // src/utils/jsonl.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccstatusline-usage",
3
- "version": "2.0.25",
3
+ "version": "2.0.27",
4
4
  "description": "A customizable status line formatter for Claude Code CLI",
5
5
  "module": "src/ccstatusline.ts",
6
6
  "type": "module",
@@ -70,4 +70,4 @@
70
70
  "patchedDependencies": {
71
71
  "ink@6.2.0": "patches/ink@6.2.0.patch"
72
72
  }
73
- }
73
+ }