ccstatusline 1.1.7 โ†’ 2.0.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +142 -57
  3. package/dist/ccstatusline.js +18255 -3199
  4. package/package.json +26 -14
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 ccstatusline contributors
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.
package/README.md CHANGED
@@ -1,20 +1,63 @@
1
+ <div align="center">
2
+
3
+ <pre>
4
+ _ _ _ _
5
+ ___ ___ ___| |_ __ _| |_ _ _ ___| (_)_ __ ___
6
+ / __/ __/ __| __/ _` | __| | | / __| | | '_ \ / _ \
7
+ | (_| (__\__ \ || (_| | |_| |_| \__ \ | | | | | __/
8
+ \___\___|___/\__\__,_|\__|\__,_|___/_|_|_| |_|\___|
9
+
10
+ </pre>
11
+
1
12
  # ccstatusline
2
13
 
3
- > ๐ŸŽจ A highly customizable status line formatter for Claude Code CLI that displays model info, git branch, token usage, and other metrics in your terminal.
14
+ **๐ŸŽจ A highly customizable status line formatter for Claude Code CLI**
15
+ *Display model info, git branch, token usage, and other metrics in your terminal*
16
+
17
+ [![npm version](https://img.shields.io/npm/v/ccstatusline.svg)](https://www.npmjs.com/package/ccstatusline)
18
+ [![npm downloads](https://img.shields.io/npm/dm/ccstatusline.svg)](https://www.npmjs.com/package/ccstatusline)
19
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/sirmalloc/ccstatusline/blob/main/LICENSE)
20
+ [![Node.js Version](https://img.shields.io/node/v/ccstatusline.svg)](https://nodejs.org)
21
+ [![install size](https://packagephobia.com/badge?p=ccstatusline)](https://packagephobia.com/result?p=ccstatusline)
22
+ [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/sirmalloc/ccstatusline/graphs/commit-activity)
23
+
24
+ [![Mentioned in Awesome Claude Code](https://awesome.re/mentioned-badge.svg)](https://github.com/hesreallyhim/awesome-claude-code)
4
25
 
5
26
  ![Demo](https://raw.githubusercontent.com/sirmalloc/ccstatusline/main/screenshots/demo.gif)
6
27
 
28
+ </div>
29
+
30
+ ## ๐Ÿ“š Table of Contents
31
+
32
+ - [Recent Updates](#-recent-updates)
33
+ - [Features](#-features)
34
+ - [Quick Start](#-quick-start)
35
+ - [Usage](#-usage)
36
+ - [Development](#๏ธ-development)
37
+ - [Contributing](#-contributing)
38
+ - [License](#-license)
39
+ - [Related Projects](#-related-projects)
40
+
41
+ ---
42
+
7
43
  ## ๐Ÿ†• Recent Updates
8
44
 
9
- ### v1.1.0 - Enhanced Customization
10
- - **๐ŸŽจ Background Colors** - Set background colors for individual status items in Color Configuration menu
11
- - **๐Ÿ”ค Bold Text Styling** - Toggle bold formatting for individual items in Color Configuration menu
12
- - **โš™๏ธ Global Options Menu** - New menu for global formatting preferences including padding, separators, color inheritance, and overrides
45
+ ### v2.0.0 - Powerline Support & Enhanced Themes
46
+ - **โšก Powerline Mode** - Beautiful Powerline-style status lines with arrow separators and customizable caps
47
+ - **๐ŸŽจ Built-in Themes** - Multiple pre-configured themes that you can copy and customize
48
+ - **๐ŸŒˆ Advanced Color Support** - Basic (16), 256-color (with custom ANSI codes), and truecolor (with hex codes) modes
49
+ - **๐Ÿ”— Widget Merging** - Merge multiple widgets together with or without padding for seamless designs
50
+ - **๐Ÿ“ฆ Easy Installation** - Install directly with `npx` or `bunx` - no global package needed
51
+ - **๐Ÿ”ค Custom Separators** - Add multiple Powerline separators with custom hex codes for font support
52
+ - **๐Ÿš€ Auto Font Install** - Automatic Powerline font installation with user consent
53
+
54
+ ---
13
55
 
14
56
  ## โœจ Features
15
57
 
16
58
  - **๐Ÿ“Š Real-time Metrics** - Display model name, git branch, token usage, session duration, and more
17
59
  - **๐ŸŽจ Fully Customizable** - Choose what to display and customize colors for each element
60
+ - **โšก Powerline Support** - Beautiful Powerline-style rendering with arrow separators, caps, and custom fonts
18
61
  - **๐Ÿ“ Multi-line Support** - Configure up to 3 independent status lines
19
62
  - **๐Ÿ–ฅ๏ธ Interactive TUI** - Built-in configuration interface using React/Ink
20
63
  - **โš™๏ธ Global Options** - Apply consistent formatting across all items (padding, separators, bold, background)
@@ -22,13 +65,18 @@
22
65
  - **๐Ÿ“ Smart Width Detection** - Automatically adapts to terminal width with flex separators
23
66
  - **โšก Zero Config** - Sensible defaults that work out of the box
24
67
 
68
+ ---
69
+
25
70
  ## ๐Ÿš€ Quick Start
26
71
 
27
- ### No installation needed! Use directly with npx:
72
+ ### No installation needed! Use directly with npx or bunx:
28
73
 
29
74
  ```bash
30
- # Run the configuration TUI
75
+ # Run the configuration TUI with npm
31
76
  npx ccstatusline@latest
77
+
78
+ # Or with Bun (faster)
79
+ bunx ccstatusline@latest
32
80
  ```
33
81
 
34
82
  ### Configure ccstatusline
@@ -44,6 +92,8 @@ The interactive configuration tool provides a terminal UI where you can:
44
92
 
45
93
  > ๐Ÿ’ก **Tip:** Your settings are automatically saved to `~/.config/ccstatusline/settings.json`
46
94
 
95
+ ---
96
+
47
97
  ## ๐Ÿ“– Usage
48
98
 
49
99
  Once configured, ccstatusline automatically formats your Claude Code status line. The status line appears at the bottom of your terminal during Claude Code sessions.
@@ -55,6 +105,7 @@ Once configured, ccstatusline automatically formats your Claude Code status line
55
105
  - **Git Changes** - Shows uncommitted insertions/deletions (e.g., "+42,-10")
56
106
  - **Session Clock** - Shows elapsed time since session start (e.g., "2hr 15m")
57
107
  - **Version** - Shows Claude Code version
108
+ - **Output Style** - Shows the currently set output style in Claude Code
58
109
  - **Tokens Input** - Shows input tokens used
59
110
  - **Tokens Output** - Shows output tokens used
60
111
  - **Tokens Cached** - Shows cached tokens used
@@ -68,40 +119,15 @@ Once configured, ccstatusline automatically formats your Claude Code status line
68
119
  - **Separator** - Visual divider between items (customizable: |, -, comma, space)
69
120
  - **Flex Separator** - Expands to fill available space
70
121
 
71
- ### โŒจ๏ธ TUI Controls
72
-
73
- #### Main Menu
74
- - **โ†‘โ†“** - Navigate menu items
75
- - **Enter** - Select item
76
- - **Ctrl+C** - Exit
77
-
78
- #### Line Editor
79
- - **โ†‘โ†“** - Select item
80
- - **โ†โ†’** - Change item type
81
- - **Enter** - Enter move mode (reorder items)
82
- - **a** - Add item at end
83
- - **i** - Insert item before selected
84
- - **d** - Delete selected item
85
- - **c** - Clear entire line
86
- - **r** - Toggle raw value mode (no labels)
87
- - **b** - Toggle bold text for this item
88
- - **e** - Edit value (for custom-text and custom-command items)
89
- - **w** - Set max width (for custom-command items)
90
- - **t** - Set timeout in milliseconds (for custom-command items)
91
- - **p** - Toggle preserve colors (for custom-command items)
92
- - **Space** - Change separator character (for separator items)
93
- - **ESC** - Go back
94
-
95
- #### Color Configuration
96
- - **โ†‘โ†“** - Select item
97
- - **Enter** - Cycle through colors
98
- - **ESC** - Go back
99
-
100
- #### Flex Options
101
- Configure how flex separators calculate available width:
102
- - **Full width always** - Uses full terminal width (may wrap with auto-compact message)
103
- - **Full width minus 40** - Leaves space for auto-compact message (default)
104
- - **Full width until compact** - Switches based on context percentage threshold
122
+ ---
123
+
124
+ ### Terminal Width Options
125
+ These settings affect where long lines are truncated, and where right-alignment occurs when using flex separators:
126
+ - **Full width always** - Uses full terminal width (may wrap if auto-compact message appears or IDE integration adds text)
127
+ - **Full width minus 40** - Reserves 40 characters for auto-compact message to prevent wrapping (default)
128
+ - **Full width until compact** - Dynamically switches between full width and minus 40 based on context percentage threshold (configurable, default 60%)
129
+
130
+ ---
105
131
 
106
132
  ### โš™๏ธ Global Options
107
133
 
@@ -115,7 +141,9 @@ Configure global formatting preferences that apply to all status items:
115
141
  - Press **(p)** to edit padding
116
142
  - Press **(s)** to edit separator
117
143
 
118
- #### Global Formatting
144
+ <details>
145
+ <summary><b>Global Formatting Options</b></summary>
146
+
119
147
  - **Inherit Colors** - Default separators inherit foreground and background colors from the preceding widget
120
148
  - Press **(i)** to toggle
121
149
  - **Global Bold** - Apply bold formatting to all text regardless of individual item settings
@@ -127,6 +155,8 @@ Configure global formatting preferences that apply to all status items:
127
155
  - Press **(b)** to cycle through colors
128
156
  - Press **(c)** to clear override
129
157
 
158
+ </details>
159
+
130
160
  > ๐Ÿ’ก **Note:** These settings are applied during rendering and don't add items to your widget list. They provide a consistent look across your entire status line without modifying individual item configurations.
131
161
 
132
162
  > โš ๏ธ **VSCode Users:** If colors appear incorrect in the VSCode integrated terminal, the "Terminal โ€บ Integrated: Minimum Contrast Ratio" (`terminal.integrated.minimumContrastRatio`) setting is forcing a minimum contrast between foreground and background colors. You can adjust this setting to 1 to disable the contrast enforcement, or use a standalone terminal for accurate colors.
@@ -138,6 +168,8 @@ Some items support "raw value" mode which displays just the value without a labe
138
168
  - Normal: `Session: 2hr 15m` โ†’ Raw: `2hr 15m`
139
169
  - Normal: `Ctx: 18.6k` โ†’ Raw: `18.6k`
140
170
 
171
+ ---
172
+
141
173
  ### ๐Ÿ”ง Custom Widgets
142
174
 
143
175
  #### Custom Text Widget
@@ -160,10 +192,12 @@ Execute shell commands and display their output dynamically:
160
192
  - `curl -s wttr.in?format="%t"` - Show current temperature
161
193
  - `npx -y ccusage statusline` - Display Claude usage metrics (set timeout: 5000ms)
162
194
 
163
- > โš ๏ธ **Note:** Commands should complete quickly to avoid delays. Long-running commands will be killed after the configured timeout. If you're not seeing output from your custom command, try increasing the timeout value (press 't' in the editor).
195
+ > โš ๏ธ **Important:** Commands should complete quickly to avoid delays. Long-running commands will be killed after the configured timeout. If you're not seeing output from your custom command, try increasing the timeout value (press 't' in the editor).
164
196
 
165
197
  > ๐Ÿ’ก **Tip:** Custom commands can be other Claude Code compatible status line formatters! They receive the same JSON via stdin that ccstatusline receives from Claude Code, allowing you to chain or combine multiple status line tools.
166
198
 
199
+ ---
200
+
167
201
  ### ๐Ÿ”— Integration Example: ccusage
168
202
 
169
203
  [ccusage](https://github.com/samuelint/ccusage) is a tool that tracks and displays Claude Code usage metrics. You can integrate it directly into your status line:
@@ -175,12 +209,14 @@ Execute shell commands and display their output dynamically:
175
209
 
176
210
  ![ccusage integration](https://raw.githubusercontent.com/sirmalloc/ccstatusline/main/screenshots/ccusage.png)
177
211
 
178
- 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.
212
+ > ๐Ÿ“„ **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.
179
213
 
180
214
  ### โœ‚๏ธ Smart Truncation
181
215
 
182
216
  When terminal width is detected, status lines automatically truncate with ellipsis (...) if they exceed the available width, preventing line wrapping.
183
217
 
218
+ ---
219
+
184
220
  ## ๐Ÿ› ๏ธ Development
185
221
 
186
222
  ### Prerequisites
@@ -215,11 +251,35 @@ bun run build
215
251
  ```
216
252
  ccstatusline/
217
253
  โ”œโ”€โ”€ src/
218
- โ”‚ โ”œโ”€โ”€ ccstatusline.ts # Main entry point
219
- โ”‚ โ”œโ”€โ”€ tui.tsx # React/Ink configuration UI
220
- โ”‚ โ”œโ”€โ”€ config.ts # Settings management
221
- โ”‚ โ””โ”€โ”€ claude-settings.ts # Claude Code settings integration
222
- โ”œโ”€โ”€ dist/ # Built files (generated)
254
+ โ”‚ โ”œโ”€โ”€ ccstatusline.ts # Main entry point
255
+ โ”‚ โ”œโ”€โ”€ tui/ # React/Ink configuration UI
256
+ โ”‚ โ”‚ โ”œโ”€โ”€ App.tsx # Root TUI component
257
+ โ”‚ โ”‚ โ”œโ”€โ”€ index.tsx # TUI entry point
258
+ โ”‚ โ”‚ โ””โ”€โ”€ components/ # UI components
259
+ โ”‚ โ”‚ โ”œโ”€โ”€ MainMenu.tsx
260
+ โ”‚ โ”‚ โ”œโ”€โ”€ LineSelector.tsx
261
+ โ”‚ โ”‚ โ”œโ”€โ”€ ItemsEditor.tsx
262
+ โ”‚ โ”‚ โ”œโ”€โ”€ ColorMenu.tsx
263
+ โ”‚ โ”‚ โ”œโ”€โ”€ PowerlineSetup.tsx
264
+ โ”‚ โ”‚ โ””โ”€โ”€ ...
265
+ โ”‚ โ”œโ”€โ”€ widgets/ # Status line widget implementations
266
+ โ”‚ โ”‚ โ”œโ”€โ”€ Model.ts
267
+ โ”‚ โ”‚ โ”œโ”€โ”€ GitBranch.ts
268
+ โ”‚ โ”‚ โ”œโ”€โ”€ TokensTotal.ts
269
+ โ”‚ โ”‚ โ”œโ”€โ”€ OutputStyle.ts
270
+ โ”‚ โ”‚ โ””โ”€โ”€ ...
271
+ โ”‚ โ”œโ”€โ”€ utils/ # Utility functions
272
+ โ”‚ โ”‚ โ”œโ”€โ”€ config.ts # Settings management
273
+ โ”‚ โ”‚ โ”œโ”€โ”€ renderer.ts # Core rendering logic
274
+ โ”‚ โ”‚ โ”œโ”€โ”€ powerline.ts # Powerline font utilities
275
+ โ”‚ โ”‚ โ”œโ”€โ”€ colors.ts # Color definitions
276
+ โ”‚ โ”‚ โ””โ”€โ”€ claude-settings.ts # Claude Code integration
277
+ โ”‚ โ””โ”€โ”€ types/ # TypeScript type definitions
278
+ โ”‚ โ”œโ”€โ”€ Settings.ts
279
+ โ”‚ โ”œโ”€โ”€ Widget.ts
280
+ โ”‚ โ”œโ”€โ”€ PowerlineConfig.ts
281
+ โ”‚ โ””โ”€โ”€ ...
282
+ โ”œโ”€โ”€ dist/ # Built files (generated)
223
283
  โ”œโ”€โ”€ package.json
224
284
  โ”œโ”€โ”€ tsconfig.json
225
285
  โ””โ”€โ”€ README.md
@@ -234,19 +294,28 @@ Contributions are welcome! Please feel free to submit a Pull Request.
234
294
  4. Push to the branch (`git push origin feature/amazing-feature`)
235
295
  5. Open a Pull Request
236
296
 
297
+ ---
298
+
237
299
  ## ๐Ÿ“„ License
238
300
 
239
301
  [MIT](LICENSE) ยฉ Matthew Breedlove
240
302
 
303
+ ---
304
+
241
305
  ## ๐Ÿ‘ค Author
242
306
 
243
307
  **Matthew Breedlove**
244
308
 
245
309
  - GitHub: [@sirmalloc](https://github.com/sirmalloc)
246
310
 
311
+ ---
312
+
247
313
  ## ๐Ÿ”— Related Projects
248
314
 
249
315
  - [tweakcc](https://github.com/Piebald-AI/tweakcc) - Customize Claude Code themes, thinking verbs, and more.
316
+ - [ccusage](https://github.com/samuelint/ccusage) - Track and display Claude Code usage metrics.
317
+
318
+ ---
250
319
 
251
320
  ## ๐Ÿ™ Acknowledgments
252
321
 
@@ -256,11 +325,27 @@ Contributions are welcome! Please feel free to submit a Pull Request.
256
325
 
257
326
  ---
258
327
 
259
- <p align="center">
260
- <a href="https://www.npmjs.com/package/ccstatusline">
261
- <img src="https://img.shields.io/npm/v/ccstatusline.svg" alt="npm version">
262
- </a>
263
- <a href="https://github.com/sirmalloc/ccstatusline/blob/main/LICENSE">
264
- <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License">
265
- </a>
266
- </p>
328
+ <div align="center">
329
+
330
+ ### ๐ŸŒŸ Show Your Support
331
+
332
+ Give a โญ if this project helped you!
333
+
334
+ [![GitHub stars](https://img.shields.io/github/stars/sirmalloc/ccstatusline?style=social)](https://github.com/sirmalloc/ccstatusline/stargazers)
335
+ [![GitHub forks](https://img.shields.io/github/forks/sirmalloc/ccstatusline?style=social)](https://github.com/sirmalloc/ccstatusline/network/members)
336
+ [![GitHub watchers](https://img.shields.io/github/watchers/sirmalloc/ccstatusline?style=social)](https://github.com/sirmalloc/ccstatusline/watchers)
337
+
338
+ [![npm version](https://img.shields.io/npm/v/ccstatusline.svg)](https://www.npmjs.com/package/ccstatusline)
339
+ [![npm downloads](https://img.shields.io/npm/dm/ccstatusline.svg)](https://www.npmjs.com/package/ccstatusline)
340
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/sirmalloc/ccstatusline/blob/main/LICENSE)
341
+ [![Made with Bun](https://img.shields.io/badge/Made%20with-Bun-000000.svg?logo=bun)](https://bun.sh)
342
+
343
+ [![Issues](https://img.shields.io/github/issues/sirmalloc/ccstatusline)](https://github.com/sirmalloc/ccstatusline/issues)
344
+ [![Pull Requests](https://img.shields.io/github/issues-pr/sirmalloc/ccstatusline)](https://github.com/sirmalloc/ccstatusline/pulls)
345
+ [![Contributors](https://img.shields.io/github/contributors/sirmalloc/ccstatusline)](https://github.com/sirmalloc/ccstatusline/graphs/contributors)
346
+
347
+ ### ๐Ÿ’ฌ Connect
348
+
349
+ [Report Bug](https://github.com/sirmalloc/ccstatusline/issues) ยท [Request Feature](https://github.com/sirmalloc/ccstatusline/issues) ยท [Discussions](https://github.com/sirmalloc/ccstatusline/discussions)
350
+
351
+ </div>