@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.
- package/README.md +156 -136
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,135 +1,147 @@
|
|
|
1
1
|
# cc-statusline
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<div align="center">
|
|
4
4
|
|
|
5
|
-
Transform your Claude Code experience with a beautiful, informative statusline
|
|
5
|
+
๐ **Transform your Claude Code experience with a beautiful, informative statusline**
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
<img src="docs/images/cc-statusline-running.gif" alt="cc-statusline in action" width="600">
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
*Real-time directory, git branch, model info, costs, and session time tracking*
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
[](https://www.npmjs.com/package/@chongdashu/cc-statusline)
|
|
12
|
+
[](https://opensource.org/licenses/MIT)
|
|
13
|
+
[](https://nodejs.org/)
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
</div>
|
|
16
16
|
|
|
17
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
27
|
+
## ๐ฏ Setup with just 1 command
|
|
51
28
|
|
|
52
|
-
|
|
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
|
-
##
|
|
31
|
+
## โจ What You Get
|
|
60
32
|
|
|
61
|
-
|
|
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
|
-
**
|
|
69
|
-
-
|
|
70
|
-
-
|
|
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
|
-
##
|
|
44
|
+
## ๐๏ธ Features Overview
|
|
73
45
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
**Minimal setup:**
|
|
63
|
+
**Minimal Setup:**
|
|
92
64
|
```
|
|
93
65
|
๐ ~/my-app ๐ฟ main ๐ค Claude Sonnet
|
|
94
66
|
```
|
|
95
67
|
|
|
96
|
-
**
|
|
68
|
+
**Full Power Mode:**
|
|
97
69
|
```
|
|
98
|
-
๐ ~/
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
109
|
-
- Claude Code (the tool you're already using!)
|
|
110
|
-
- `jq` for JSON processing (pre-installed on most systems)
|
|
117
|
+
## ๐ Requirements
|
|
111
118
|
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
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
|
-
|
|
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
|
-
## ๐
|
|
132
|
+
## ๐ File Structure
|
|
122
133
|
|
|
123
|
-
After
|
|
134
|
+
After installation, you'll have a clean setup:
|
|
124
135
|
|
|
125
136
|
```
|
|
126
137
|
.claude/
|
|
127
|
-
โโโ statusline.sh # Your
|
|
128
|
-
โโโ settings.json # Auto-updated
|
|
138
|
+
โโโ statusline.sh # ๐ฏ Your generated statusline script
|
|
139
|
+
โโโ settings.json # โ๏ธ Auto-updated Claude Code configuration
|
|
129
140
|
```
|
|
130
141
|
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
-
|
|
177
|
-
|
|
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
|
-
|
|
180
|
-
npm run build
|
|
173
|
+
## ๐ Performance
|
|
181
174
|
|
|
182
|
-
|
|
183
|
-
|
|
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
|
-
|
|
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
|
-
|
|
201
|
+
See our [Contributing Guide](CONTRIBUTING.md) for detailed information.
|
|
189
202
|
|
|
190
|
-
|
|
191
|
-
- Code standards and conventions
|
|
192
|
-
- Testing your changes
|
|
193
|
-
- Submitting pull requests
|
|
203
|
+
## ๐ Stats
|
|
194
204
|
|
|
195
|
-
|
|
205
|
+
<div align="center">
|
|
196
206
|
|
|
197
|
-
|
|
207
|
+

|
|
208
|
+

|
|
209
|
+

|
|
198
210
|
|
|
199
|
-
|
|
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
|
-
|
|
228
|
+
<div align="center">
|
|
229
|
+
|
|
230
|
+
**Made by [Chong-U](https://github.com/chongdashu) @ [AIOriented](https://aioriented.dev)**
|
|
231
|
+
|
|
232
|
+
</div>
|