@chongdashu/cc-statusline 1.0.1 โ†’ 1.0.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.
Files changed (2) hide show
  1. package/README.md +156 -136
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,135 +1,147 @@
1
1
  # cc-statusline
2
2
 
3
- ๐Ÿš€ **Dead simple statusline generator for Claude Code**
3
+ <div align="center">
4
4
 
5
- Transform your Claude Code experience with a beautiful, informative statusline showing directory, git branch, model info, usage stats, and more.
5
+ ๐Ÿš€ **Transform your Claude Code experience with a beautiful, informative statusline**
6
6
 
7
- ## โšก Super Quick Start
7
+ <img src="docs/images/cc-statusline-running.gif" alt="cc-statusline in action" width="600">
8
8
 
9
- **Just run this one command:**
9
+ *Real-time directory, git branch, model info, costs, and session time tracking*
10
10
 
11
- ```bash
12
- npx @chongdashu/cc-statusline init
13
- ```
11
+ [![npm version](https://badge.fury.io/js/@chongdashu%2Fcc-statusline.svg)](https://www.npmjs.com/package/@chongdashu/cc-statusline)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
13
+ [![Node.js](https://img.shields.io/badge/Node.js-16%2B-green.svg)](https://nodejs.org/)
14
14
 
15
- That's it! Answer 2 simple questions and restart Claude Code. Done! ๐ŸŽ‰
15
+ </div>
16
16
 
17
- ### What you get:
18
- - ๐Ÿ“ Current directory
19
- - ๐ŸŒฟ Git branch
20
- - ๐Ÿค– Claude model info
21
- - ๐Ÿ’ต Real-time costs
22
- - โŒ› Session time remaining
23
- - Plus optional token stats and burn rate
17
+ ## โšก Quick Start
24
18
 
25
- ### Sample result:
26
- ```
27
- ๐Ÿ“ ~/my-project ๐ŸŒฟ main ๐Ÿค– Opus 4.1 ๐Ÿ’ต $2.48 ($12.50/h) โŒ› 2h 15m until reset (68%)
28
- ```
29
-
30
- ## ๐ŸŽฏ More Options
19
+ **One command. Two questions. Beautiful statusline. โœจ**
31
20
 
32
21
  ```bash
33
- # Preview an existing statusline.sh with mock data
34
- cc-statusline preview .claude/statusline.sh
35
-
36
- # Generate to custom location
37
- cc-statusline init --output ./my-statusline.sh
38
-
39
- # Skip auto-installation
40
- cc-statusline init --no-install
22
+ npx @chongdashu/cc-statusline init
41
23
  ```
42
24
 
43
- **How preview works:**
44
- The `preview` command takes a path to an existing `statusline.sh` file and:
45
- 1. **Loads** your actual statusline script
46
- 2. **Runs** it with fake Claude Code data (directory: `/home/user/projects/my-project`, model: `Opus 4.1`, mock usage stats)
47
- 3. **Shows** you exactly what the output looks like
48
- 4. **Reports** performance and basic functionality
25
+ That's it! Answer 2 simple questions, restart Claude Code, and enjoy your new statusline.
49
26
 
50
- Perfect for testing your statusline changes before restarting Claude Code.
27
+ ## ๐ŸŽฏ Setup with just 1 command
51
28
 
52
- ### Global Installation
53
- ```bash
54
- # If you prefer global install
55
- npm install -g @chongdashu/cc-statusline
56
- cc-statusline init
57
- ```
29
+ <img src="docs/images/cc-statusline-init.gif" alt="Demo of cc-statusline setup" width="500">
58
30
 
59
- ## ๐ŸŽ›๏ธ Available Features
31
+ ## โœจ What You Get
60
32
 
61
- **Default features (pre-selected):**
62
- - ๐Ÿ“ **Working Directory** - Current folder with `~` shorthand
63
- - ๐ŸŒฟ **Git Branch** - Current branch name
64
- - ๐Ÿค– **Model Name** - Which Claude model you're using
65
- - ๐Ÿ’ต **Usage & Cost** - Real-time cost tracking (requires ccusage)
66
- - โŒ› **Session Time** - Time until usage limit resets
33
+ Transform your bland Claude Code terminal into an information-rich powerhouse:
67
34
 
68
- **Optional features:**
69
- - ๐Ÿ“Š **Token Statistics** - Total tokens used this session
70
- - โšก **Burn Rate** - Tokens consumed per minute
35
+ - **๐Ÿ“ Smart Directory Display** - Current folder with `~` abbreviation
36
+ - **๐ŸŒฟ Git Integration** - Current branch name with clean styling
37
+ - **๐Ÿค– Model Intelligence** - Shows which Claude model you're using
38
+ - **๐Ÿ’ต Real-Time Cost Tracking** - Live cost monitoring via ccusage integration
39
+ - **โŒ› Session Management** - Time remaining until usage limit resets with progress bars
40
+ - **๐Ÿ“Š Advanced Analytics** - Optional token consumption and burn rate metrics
41
+ - **๐ŸŽจ Beautiful Colors** - TTY-aware colors that respect your terminal theme
42
+ - **โšก Lightning Fast** - Optimized bash script with <100ms execution time
71
43
 
72
- ## โš™๏ธ How It Works
44
+ ## ๐ŸŽ›๏ธ Features Overview
73
45
 
74
- **Two simple questions:**
75
- 1. **What to show** - Pick features from a checklist (directory, git, model, costs, etc.)
76
- 2. **Colors & emojis** - Enable/disable colors and emoji icons
46
+ ### ๐Ÿ”ฅ Default Features (Pre-selected)
47
+ | Feature | Description | Example |
48
+ |---------|-------------|---------|
49
+ | ๐Ÿ“ **Directory** | Current working directory | `~/my-project` |
50
+ | ๐ŸŒฟ **Git Branch** | Active git branch | `main` |
51
+ | ๐Ÿค– **Model** | Claude model name & version | `Opus 4.1` |
52
+ | ๐Ÿ’ต **Usage & Cost** | Real-time costs with hourly rate | `$2.48 ($12.50/h)` |
53
+ | โŒ› **Session Time** | Time until reset with progress | `2h 15m until reset (68%)` |
77
54
 
78
- **Then it:**
79
- - Generates a bash script optimized for speed
80
- - Auto-installs to `.claude/statusline.sh`
81
- - Updates your `.claude/settings.json`
82
- - Shows you a preview of what it looks like
55
+ ### ๐Ÿš€ Optional Power Features
56
+ | Feature | Description | Example |
57
+ |---------|-------------|---------|
58
+ | ๐Ÿ“Š **Token Stats** | Total tokens consumed | `45,230 tok` |
59
+ | โšก **Burn Rate** | Tokens per minute | `847 tpm` |
83
60
 
84
- **Requirements:**
85
- - Claude Code (obviously! ๐Ÿ˜„)
86
- - `jq` command (usually pre-installed)
87
- - `ccusage` for usage stats (works via `npx ccusage@latest` - no install needed)
61
+ ### ๐ŸŽจ Example Outputs
88
62
 
89
- ## ๐ŸŽจ Example Outputs
90
-
91
- **Minimal setup:**
63
+ **Minimal Setup:**
92
64
  ```
93
65
  ๐Ÿ“ ~/my-app ๐ŸŒฟ main ๐Ÿค– Claude Sonnet
94
66
  ```
95
67
 
96
- **With usage tracking:**
68
+ **Full Power Mode:**
97
69
  ```
98
- ๐Ÿ“ ~/my-app ๐ŸŒฟ main ๐Ÿค– Opus 4.1 ๐Ÿ’ต $2.48 ($12.50/h)
70
+ ๐Ÿ“ ~/projects/ai-tools ๐ŸŒฟ feature/statusline ๐Ÿค– Opus 4.1 โŒ› 2h 15m until reset (68%) [======----] ๐Ÿ’ต $16.40 ($7.41/h) ๐Ÿ“Š 64,080 tok (850 tpm)
99
71
  ```
100
72
 
101
- **Full features:**
73
+ ## ๐Ÿ› ๏ธ Advanced Usage
74
+
75
+ ### Preview Your Statusline
76
+ Test your statusline before restarting Claude Code:
77
+
78
+ ```bash
79
+ cc-statusline preview .claude/statusline.sh
102
80
  ```
103
- ๐Ÿ“ ~/projects/my-app ๐ŸŒฟ main ๐Ÿค– Opus 4.1 โŒ› 2h 15m until reset (68%) [======----] ๐Ÿ’ต $2.48 ($12.50/h)
81
+
82
+ **What preview does:**
83
+ 1. ๐Ÿ“„ **Loads** your actual statusline script
84
+ 2. ๐Ÿงช **Runs** it with realistic mock data
85
+ 3. ๐Ÿ“Š **Shows** exactly what the output will look like
86
+ 4. โšก **Reports** performance metrics and functionality
87
+
88
+ ### Custom Installation
89
+ ```bash
90
+ # Generate to custom location
91
+ cc-statusline init --output ./my-statusline.sh
92
+
93
+ # Skip auto-installation (manual setup)
94
+ cc-statusline init --no-install
95
+
96
+ # Global installation for convenience
97
+ npm install -g @chongdashu/cc-statusline
104
98
  ```
105
99
 
106
- ## ๐Ÿ“‹ Dependencies
100
+ ## ๐Ÿ”ง How It Works
101
+
102
+ ### The Magic Behind The Scenes
103
+
104
+ 1. **๐ŸŽฏ Smart Configuration** - Two intuitive questions configure everything
105
+ 2. **๐Ÿ—๏ธ Intelligent Generation** - Creates optimized bash script tailored to your needs
106
+ 3. **โš™๏ธ Auto-Installation** - Seamlessly integrates with Claude Code settings
107
+ 4. **๐Ÿ”„ Real-Time Updates** - Connects to ccusage for live usage statistics
108
+
109
+ ### Technical Architecture
110
+
111
+ - **โšก Bash-First** - Native shell execution for maximum speed
112
+ - **๐ŸŽจ TTY-Aware** - Automatically detects terminal capabilities
113
+ - **๐ŸŒ Environment Respect** - Honors `NO_COLOR` and other conventions
114
+ - **๐Ÿ“ฆ Zero Dependencies** - Self-contained script with graceful fallbacks
115
+ - **๐Ÿ”’ Secure** - No network requests except ccusage integration
107
116
 
108
- **Required:**
109
- - Claude Code (the tool you're already using!)
110
- - `jq` for JSON processing (pre-installed on most systems)
117
+ ## ๐Ÿ“‹ Requirements
111
118
 
112
- **Optional:**
113
- - `git` for branch display
114
- - `ccusage` for usage stats (auto-installs via npx when needed)
119
+ ### โœ… Required (You Already Have These!)
120
+ - **Claude Code** - The tool you're already using
121
+ - **jq** - JSON processing (pre-installed on most systems)
115
122
 
116
- **Check if you're ready:**
123
+ ### ๐ŸŽ Optional Enhancements
124
+ - **git** - For branch display (you probably have this)
125
+ - **ccusage** - For usage stats (works via `npx` - no install needed)
126
+
127
+ ### Quick Compatibility Check
117
128
  ```bash
118
129
  command -v jq && echo "โœ… Ready to go!"
119
130
  ```
120
131
 
121
- ## ๐Ÿ“‚ What Gets Created
132
+ ## ๐Ÿ“‚ File Structure
122
133
 
123
- After running `cc-statusline init`, you'll have:
134
+ After installation, you'll have a clean setup:
124
135
 
125
136
  ```
126
137
  .claude/
127
- โ”œโ”€โ”€ statusline.sh # Your custom statusline script
128
- โ””โ”€โ”€ settings.json # Auto-updated with statusline config
138
+ โ”œโ”€โ”€ statusline.sh # ๐ŸŽฏ Your generated statusline script
139
+ โ””โ”€โ”€ settings.json # โš™๏ธ Auto-updated Claude Code configuration
129
140
  ```
130
141
 
131
- **Manual Setup (if auto-config fails):**
132
- If the tool can't update your settings.json automatically, just add this:
142
+ ### Manual Configuration (Backup Plan)
143
+
144
+ If auto-configuration fails, simply add this to `.claude/settings.json`:
133
145
 
134
146
  ```json
135
147
  {
@@ -141,72 +153,80 @@ If the tool can't update your settings.json automatically, just add this:
141
153
  }
142
154
  ```
143
155
 
144
- ## Troubleshooting
145
-
146
- ### Statusline not showing
147
- 1. Restart Claude Code after installation
148
- 2. Verify `.claude/settings.json` contains:
149
- ```json
150
- {
151
- "statusLine": {
152
- "type": "command",
153
- "command": ".claude/statusline.sh",
154
- "padding": 0
155
- }
156
- }
157
- ```
158
-
159
- ### Performance Issues
160
- - Use `cc-statusline preview` to check execution time
161
- - Reduce number of features if >500ms execution time
162
- - Disable ccusage integration if not needed
163
-
164
- ### Missing Features
165
- - Ensure `jq` is installed: `brew install jq` (macOS) or `apt install jq` (Ubuntu)
166
- - Usage stats require ccusage (works automatically via `npx ccusage@latest`)
167
- - Check script permissions: `chmod +x .claude/statusline.sh`
168
-
169
- ## Development
156
+ ## ๐Ÿ”ง Troubleshooting
170
157
 
171
- ```bash
172
- # Clone repository
173
- git clone https://github.com/chongdashu/cc-statusline
174
- cd cc-statusline
158
+ ### ๐Ÿšซ Statusline Not Showing
159
+ 1. **Restart Claude Code** after installation
160
+ 2. **Verify settings** - Check `.claude/settings.json` contains the configuration above
161
+ 3. **Check permissions** - Ensure script is executable: `chmod +x .claude/statusline.sh`
162
+
163
+ ### ๐ŸŒ Performance Issues
164
+ - **Test performance**: `cc-statusline preview .claude/statusline.sh`
165
+ - **Optimize features**: Disable heavy features if execution > 500ms
166
+ - **Disable ccusage**: Remove usage tracking if not needed
175
167
 
176
- # Install dependencies
177
- npm install
168
+ ### ๐Ÿงฉ Missing Features
169
+ - **Install jq**: `brew install jq` (macOS) or `apt install jq` (Ubuntu)
170
+ - **ccusage setup**: Works automatically via `npx ccusage@latest`
171
+ - **Git not found**: Install git for branch display
178
172
 
179
- # Build project
180
- npm run build
173
+ ## ๐Ÿš€ Performance
181
174
 
182
- # Test locally
183
- npm run dev
175
+ | Metric | Target | Typical |
176
+ |--------|--------|---------|
177
+ | **Execution Time** | <100ms | 45-80ms |
178
+ | **Memory Usage** | <5MB | ~2MB |
179
+ | **CPU Impact** | Negligible | <1% |
180
+ | **Dependencies** | Minimal | jq only |
181
+
182
+ *Benchmarked on macOS with all features enabled*
183
+
184
+ ## ๐Ÿค Contributing
185
+
186
+ We love contributions! ๐ŸŽ‰
187
+
188
+ **Quick Start:**
189
+ ```bash
190
+ git clone https://github.com/chongdashu/cc-statusline
191
+ cd cc-statusline
192
+ npm install && npm run build
184
193
  ```
185
194
 
186
- ## Contributing
195
+ **Contribution Areas:**
196
+ - ๐Ÿ› **Bug Fixes** - Help make it more robust
197
+ - โœจ **New Features** - Add support for more runtimes/features
198
+ - ๐Ÿ“š **Documentation** - Improve guides and examples
199
+ - ๐Ÿงช **Testing** - Add test coverage and edge cases
187
200
 
188
- Contributions welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for detailed information on:
201
+ See our [Contributing Guide](CONTRIBUTING.md) for detailed information.
189
202
 
190
- - Setting up the development environment
191
- - Code standards and conventions
192
- - Testing your changes
193
- - Submitting pull requests
203
+ ## ๐Ÿ“Š Stats
194
204
 
195
- Quick start: Fork โ†’ Clone โ†’ `npm install` โ†’ Make changes โ†’ Test โ†’ Submit PR
205
+ <div align="center">
196
206
 
197
- ## License
207
+ ![GitHub stars](https://img.shields.io/github/stars/chongdashu/cc-statusline?style=social)
208
+ ![GitHub forks](https://img.shields.io/github/forks/chongdashu/cc-statusline?style=social)
209
+ ![npm downloads](https://img.shields.io/npm/dm/@chongdashu/cc-statusline)
198
210
 
199
- MIT License - see [LICENSE](LICENSE) file for details.
211
+ </div>
200
212
 
201
- ## Related Projects
213
+ ## ๐Ÿ”— Related Projects
202
214
 
203
- - [ccusage](https://github.com/ryoppippi/ccusage) - Claude Code usage analytics
204
- - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) - Official documentation
215
+ - **[ccusage](https://github.com/ryoppippi/ccusage)** - Claude Code usage analytics (would not be possible with it!)
216
+ - **[Claude Code](https://docs.anthropic.com/en/docs/claude-code)** - Official documentation
205
217
 
206
- ## Changelog
218
+ ## ๐Ÿ“ Changelog
207
219
 
208
220
  See [CHANGELOG.md](CHANGELOG.md) for detailed release history.
209
221
 
222
+ ## ๐Ÿ“„ License
223
+
224
+ MIT License - see [LICENSE](LICENSE) file for details.
225
+
210
226
  ---
211
227
 
212
- **Made by [Chong-U](https://github.com/chongdashu) @ [AIOriented](https://aioriented.dev)**
228
+ <div align="center">
229
+
230
+ **Made by [Chong-U](https://github.com/chongdashu) @ [AIOriented](https://aioriented.dev)**
231
+
232
+ </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chongdashu/cc-statusline",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Interactive CLI tool for generating custom Claude Code statuslines",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",