@chongdashu/cc-statusline 1.2.7 โ 1.3.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/CHANGELOG.md +157 -110
- package/CLAUDE.md +76 -61
- package/CONTRIBUTING.md +207 -207
- package/LICENSE +20 -20
- package/README.md +373 -305
- package/dist/index.js +206 -22
- package/dist/index.js.map +1 -1
- package/package.json +57 -57
- package/test/test-concurrent-locking.sh +54 -54
- package/test/test-installation.sh +335 -335
- package/test/test-statusline-with-lock.sh +67 -67
package/README.md
CHANGED
|
@@ -1,306 +1,374 @@
|
|
|
1
|
-
# cc-statusline
|
|
2
|
-
|
|
3
|
-
<div align="center">
|
|
4
|
-
|
|
5
|
-
**A beautiful, informative statusline for Claude Code**
|
|
6
|
-
|
|
7
|
-
<img src="docs/images/cc-statusline.png" alt="cc-statusline in action" width="600">
|
|
8
|
-
|
|
9
|
-
*Real-time directory, git branch, model info, costs, and session time tracking*
|
|
10
|
-
|
|
11
|
-
[](https://www.npmjs.com/package/@chongdashu/cc-statusline)
|
|
12
|
-
[](https://opensource.org/licenses/MIT)
|
|
13
|
-
[](https://nodejs.org/)
|
|
14
|
-
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
**
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
**
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
##
|
|
118
|
-
|
|
119
|
-
###
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
###
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
git
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
**
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
-
|
|
250
|
-
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
##
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
1
|
+
# cc-statusline
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
**A beautiful, informative statusline for Claude Code**
|
|
6
|
+
|
|
7
|
+
<img src="docs/images/cc-statusline.png" alt="cc-statusline in action" width="600">
|
|
8
|
+
|
|
9
|
+
*Real-time directory, git branch, model info, costs, and session time tracking*
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/@chongdashu/cc-statusline)
|
|
12
|
+
[](https://opensource.org/licenses/MIT)
|
|
13
|
+
[](https://nodejs.org/)
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
## โ ๏ธ IMPORTANT: Install jq First!
|
|
18
|
+
|
|
19
|
+
> **Without jq, your statusline will have LIMITED functionality:**
|
|
20
|
+
> - โ No context remaining percentage
|
|
21
|
+
> - โ No token statistics from ccusage
|
|
22
|
+
> - โ Slower performance
|
|
23
|
+
> - โ Less reliable JSON parsing
|
|
24
|
+
|
|
25
|
+
### Install jq (takes 30 seconds):
|
|
26
|
+
|
|
27
|
+
#### macOS
|
|
28
|
+
```bash
|
|
29
|
+
brew install jq
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
#### Linux
|
|
33
|
+
```bash
|
|
34
|
+
# Ubuntu/Debian
|
|
35
|
+
sudo apt-get install jq
|
|
36
|
+
|
|
37
|
+
# CentOS/RHEL
|
|
38
|
+
sudo yum install jq
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
#### Windows 10/11 Users
|
|
42
|
+
|
|
43
|
+
**Option 1: Package Manager (Easiest)**
|
|
44
|
+
```bash
|
|
45
|
+
# If you have Chocolatey
|
|
46
|
+
choco install jq
|
|
47
|
+
|
|
48
|
+
# If you have Scoop
|
|
49
|
+
scoop install jq
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Option 2: Manual Download (No admin required)**
|
|
53
|
+
1. Go to https://github.com/jqlang/jq/releases/latest
|
|
54
|
+
2. Download the right file for your system:
|
|
55
|
+
- **64-bit Windows** (most common): Download `jq-windows-amd64.exe`
|
|
56
|
+
- **32-bit Windows** (older systems): Download `jq-windows-i386.exe`
|
|
57
|
+
3. Rename the downloaded file to just `jq.exe`
|
|
58
|
+
4. Move `jq.exe` to one of these locations:
|
|
59
|
+
- `C:\Windows\System32\` (requires admin) - works everywhere
|
|
60
|
+
- Or create `C:\tools\` and add it to your PATH
|
|
61
|
+
5. **Add to PATH** (if not in System32):
|
|
62
|
+
- Press `Win + X`, select "System"
|
|
63
|
+
- Click "Advanced system settings"
|
|
64
|
+
- Click "Environment Variables"
|
|
65
|
+
- Under "User variables", select "Path" and click "Edit"
|
|
66
|
+
- Click "New" and add `C:\tools\` (or wherever you put jq.exe)
|
|
67
|
+
- Click OK on all windows
|
|
68
|
+
6. **Test it**: Open a new Command Prompt or PowerShell and type `jq --version`
|
|
69
|
+
|
|
70
|
+
๐ฆ **Direct downloads:** https://github.com/jqlang/jq/releases
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## โก Quick Start
|
|
75
|
+
|
|
76
|
+
**After installing jq, one command. Three questions. Custom statusline.**
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npx @chongdashu/cc-statusline@latest init
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
That's it! Answer a few simple questions, restart Claude Code, and enjoy your new statusline.
|
|
83
|
+
|
|
84
|
+
### ๐ Prerequisites
|
|
85
|
+
- **Node.js 16+** (required)
|
|
86
|
+
- **jq** (STRONGLY recommended) - Required for context tracking, token stats, and reliable performance
|
|
87
|
+
|
|
88
|
+
### ๐ Installation Options (v1.2.4+)
|
|
89
|
+
- **๐ Global Installation** (`~/.claude/`) - Use across all your projects
|
|
90
|
+
- **๐ Project Installation** (`./.claude/`) - Keep settings project-specific
|
|
91
|
+
|
|
92
|
+
### ๐ What's New in v1.3.0
|
|
93
|
+
- **๐ฅ Improved Burn Rate** - Now calculates $/hour directly from Claude Code data (no ccusage dependency)
|
|
94
|
+
- **๐ Smart Logging** - Logs are created relative to statusline installation location
|
|
95
|
+
- **โจ Version Headers** - Generated statuslines now include the cc-statusline version
|
|
96
|
+
|
|
97
|
+
## ๐ฏ Simple Setup
|
|
98
|
+
|
|
99
|
+
<img src="docs/images/cc-statusline-init.gif" alt="Demo of cc-statusline setup" width="500">
|
|
100
|
+
|
|
101
|
+
## โจ What You Get
|
|
102
|
+
|
|
103
|
+
โ ๏ธ **Note: Most features require jq to be installed!**
|
|
104
|
+
|
|
105
|
+
Enhance your Claude Code terminal with useful information:
|
|
106
|
+
|
|
107
|
+
- **๐ Directory Display** - Current folder with `~` abbreviation
|
|
108
|
+
- **๐ฟ Git Integration** - Current branch name
|
|
109
|
+
- **๐ค Model Info** - Shows which Claude model you're using plus Claude Code version
|
|
110
|
+
- **๐ง Context Usage** - Real-time context window usage with progress bars **(requires jq)**
|
|
111
|
+
- **๐ฐ Cost Tracking** - Live cost monitoring with burn rates via ccusage **(partial without jq)**
|
|
112
|
+
- **โ Session Timer** - Time remaining until usage limit resets **(requires jq)**
|
|
113
|
+
- **๐ Token Analytics** - Token consumption and burn rate metrics **(requires jq)**
|
|
114
|
+
- **๐จ Color Support** - 256-color palette for Claude Code terminals
|
|
115
|
+
- **โก Fast Execution** - Optimized bash script with <100ms execution time
|
|
116
|
+
|
|
117
|
+
## ๐๏ธ Features Overview
|
|
118
|
+
|
|
119
|
+
### ๐ฅ Default Features (All Pre-selected in v1.2.2+)
|
|
120
|
+
| Feature | Description | Example |
|
|
121
|
+
|---------|-------------|---------|
|
|
122
|
+
| ๐ **Directory** | Current working directory | `~/my-project` |
|
|
123
|
+
| ๐ฟ **Git Branch** | Active git branch | `feature/statusline` |
|
|
124
|
+
| ๐ค **Model** | Claude model name & version | `Sonnet 4` |
|
|
125
|
+
| ๐ **Claude Code** | Claude Code version | `v1.0.85` |
|
|
126
|
+
| ๐จ **Output Style** | Current output style setting | `default` |
|
|
127
|
+
| ๐ง **Context** | Remaining context with progress bar | `83% [========--]` |
|
|
128
|
+
| ๐ฐ **Cost** | Live costs with highlighted burn rate | `$49.00 ($16.55/h)` |
|
|
129
|
+
| โ **Session** | Time until reset with progress | `3h 7m until reset at 01:00 (37%) [===-------]` |
|
|
130
|
+
|
|
131
|
+
### ๐ Power Features (Also Pre-selected)
|
|
132
|
+
| Feature | Description | Example |
|
|
133
|
+
|---------|-------------|---------|
|
|
134
|
+
| ๐ **Tokens** | Token consumption with burn rate | `14638846 tok (279900 tpm)` |
|
|
135
|
+
|
|
136
|
+
### ๐จ Example Outputs
|
|
137
|
+
|
|
138
|
+
**New 3-Line Modern Layout (v1.2.2+):**
|
|
139
|
+
```
|
|
140
|
+
๐ ~/Projects/cc-statusline ๐ฟ feature/context-usage-output-styles ๐ค Sonnet 4 ๐ v1.0.85 ๐จ default
|
|
141
|
+
๐ง Context Remaining: 83% [========--] โ 3h 7m until reset at 01:00 (37%) [===-------]
|
|
142
|
+
๐ฐ $49.00 ($16.55/h) ๐ 14638846 tok (279900 tpm)
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Compact Mode:**
|
|
146
|
+
```
|
|
147
|
+
๐ ~/my-app ๐ฟ main ๐ค Claude Sonnet ๐ v1.0.85
|
|
148
|
+
๐ง Context Remaining: 95% [=========-]
|
|
149
|
+
๐ฐ $2.48 ($12.50/h)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## ๐ ๏ธ Advanced Usage
|
|
153
|
+
|
|
154
|
+
### Preview Your Statusline
|
|
155
|
+
Test your statusline before restarting Claude Code:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
cc-statusline preview .claude/statusline.sh
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**What preview does:**
|
|
162
|
+
1. ๐ **Loads** your actual statusline script
|
|
163
|
+
2. ๐งช **Runs** it with realistic mock data
|
|
164
|
+
3. ๐ **Shows** exactly what the output will look like
|
|
165
|
+
4. โก **Reports** performance metrics and functionality
|
|
166
|
+
|
|
167
|
+
### Installation Safety Features (v1.2.4+)
|
|
168
|
+
- ๐ **Safe Updates** - Never overwrites existing statuslines without confirmation
|
|
169
|
+
- ๐ก๏ธ **Settings Protection** - Preserves your existing settings.json configurations
|
|
170
|
+
- โ ๏ธ **Conflict Detection** - Warns when other statuslines are configured
|
|
171
|
+
- โ
**Smart Defaults** - Project-level installation by default for safety
|
|
172
|
+
|
|
173
|
+
### Custom Installation
|
|
174
|
+
```bash
|
|
175
|
+
# Generate to custom location
|
|
176
|
+
cc-statusline init --output ./my-statusline.sh
|
|
177
|
+
|
|
178
|
+
# Skip auto-installation (manual setup)
|
|
179
|
+
cc-statusline init --no-install
|
|
180
|
+
|
|
181
|
+
# Global installation for convenience
|
|
182
|
+
npm install -g @chongdashu/cc-statusline
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## ๐ง How It Works
|
|
186
|
+
|
|
187
|
+
### How It Works
|
|
188
|
+
|
|
189
|
+
1. **๐ฏ Configuration** - Two questions configure your preferences
|
|
190
|
+
2. **๐๏ธ Generation** - Creates optimized bash script tailored to your needs
|
|
191
|
+
3. **โ๏ธ Installation** - Integrates with Claude Code settings
|
|
192
|
+
4. **๐ Updates** - Connects to ccusage for live usage statistics
|
|
193
|
+
|
|
194
|
+
### Technical Architecture
|
|
195
|
+
|
|
196
|
+
- **โก Bash-First** - Native shell execution for maximum speed
|
|
197
|
+
- **๐จ Claude Code Optimized** - Forces colors for Claude Code terminals (respects NO_COLOR)
|
|
198
|
+
- **๐ Environment Respect** - Honors `NO_COLOR` and other terminal conventions
|
|
199
|
+
- **๐ฆ Zero Dependencies** - Self-contained script with graceful fallbacks
|
|
200
|
+
- **๐ Secure** - No network requests except ccusage integration
|
|
201
|
+
|
|
202
|
+
## ๐ Requirements
|
|
203
|
+
|
|
204
|
+
### โ
Required (You Already Have These!)
|
|
205
|
+
- **Claude Code** - The tool you're already using
|
|
206
|
+
- **jq** - JSON processing (pre-installed on most systems)
|
|
207
|
+
|
|
208
|
+
### ๐ Optional Enhancements
|
|
209
|
+
- **git** - For branch display (you probably have this)
|
|
210
|
+
- **ccusage** - For usage stats (works via `npx` - no install needed)
|
|
211
|
+
|
|
212
|
+
### Quick Compatibility Check
|
|
213
|
+
```bash
|
|
214
|
+
command -v jq && echo "โ
Ready to go!"
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## ๐ File Structure
|
|
218
|
+
|
|
219
|
+
After installation, you'll have a clean setup:
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
.claude/
|
|
223
|
+
โโโ statusline.sh # ๐ฏ Your generated statusline script
|
|
224
|
+
โโโ settings.json # โ๏ธ Auto-updated Claude Code configuration
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Manual Configuration (Backup Plan)
|
|
228
|
+
|
|
229
|
+
If auto-configuration fails, simply add this to `.claude/settings.json`:
|
|
230
|
+
|
|
231
|
+
```json
|
|
232
|
+
{
|
|
233
|
+
"statusLine": {
|
|
234
|
+
"type": "command",
|
|
235
|
+
"command": ".claude/statusline.sh",
|
|
236
|
+
"padding": 0
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## ๐ง Troubleshooting
|
|
242
|
+
|
|
243
|
+
### ๐ซ Statusline Not Showing
|
|
244
|
+
1. **Restart Claude Code** after installation
|
|
245
|
+
2. **Verify settings** - Check `.claude/settings.json` contains the configuration above
|
|
246
|
+
3. **Check permissions** - Ensure script is executable: `chmod +x .claude/statusline.sh`
|
|
247
|
+
|
|
248
|
+
### ๐ Performance Issues
|
|
249
|
+
- **Test performance**: `cc-statusline preview .claude/statusline.sh`
|
|
250
|
+
- **Optimize features**: Disable heavy features if execution > 500ms
|
|
251
|
+
- **Disable ccusage**: Remove usage tracking if not needed
|
|
252
|
+
|
|
253
|
+
### ๐งฉ Missing Features
|
|
254
|
+
- **Install jq**: `brew install jq` (macOS) or `apt install jq` (Ubuntu)
|
|
255
|
+
- **ccusage setup**: Works automatically via `npx ccusage@latest`
|
|
256
|
+
- **Git not found**: Install git for branch display
|
|
257
|
+
- **Context not showing**: Ensure you're in an active Claude Code session with context usage
|
|
258
|
+
- **Colors not working**: Check that NO_COLOR environment variable is not set
|
|
259
|
+
|
|
260
|
+
## ๐ Performance
|
|
261
|
+
|
|
262
|
+
| Metric | Target | Typical |
|
|
263
|
+
|--------|--------|---------|
|
|
264
|
+
| **Execution Time** | <100ms | 45-80ms |
|
|
265
|
+
| **Memory Usage** | <5MB | ~2MB |
|
|
266
|
+
| **CPU Impact** | Negligible | <1% |
|
|
267
|
+
| **Dependencies** | Minimal | jq only |
|
|
268
|
+
|
|
269
|
+
*Benchmarked on macOS with all features enabled*
|
|
270
|
+
|
|
271
|
+
## ๐ค Contributing
|
|
272
|
+
|
|
273
|
+
Contributions are welcome!
|
|
274
|
+
|
|
275
|
+
**Quick Start:**
|
|
276
|
+
```bash
|
|
277
|
+
git clone https://github.com/chongdashu/cc-statusline
|
|
278
|
+
cd cc-statusline
|
|
279
|
+
npm install && npm run build
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**Contribution Areas:**
|
|
283
|
+
- ๐ **Bug Fixes** - Help make it more robust
|
|
284
|
+
- โจ **New Features** - Add support for more runtimes/features
|
|
285
|
+
- ๐ **Documentation** - Improve guides and examples
|
|
286
|
+
- ๐งช **Testing** - Add test coverage and edge cases
|
|
287
|
+
|
|
288
|
+
See our [Contributing Guide](CONTRIBUTING.md) for detailed information.
|
|
289
|
+
|
|
290
|
+
## ๐งช Testing
|
|
291
|
+
|
|
292
|
+
### Locking Mechanism Tests
|
|
293
|
+
|
|
294
|
+
The ccusage integration includes a robust file-based locking mechanism to prevent concurrent process spawning. Test this functionality:
|
|
295
|
+
|
|
296
|
+
**Single Test:**
|
|
297
|
+
```bash
|
|
298
|
+
echo '{}' | ./test/test-statusline-with-lock.sh
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
**Concurrent Test:**
|
|
302
|
+
```bash
|
|
303
|
+
./test/test-concurrent-locking.sh
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
**Manual Concurrent Test:**
|
|
307
|
+
```bash
|
|
308
|
+
# Spawn 10 concurrent processes
|
|
309
|
+
for i in {1..10}; do
|
|
310
|
+
echo '{}' | ./test/test-statusline-with-lock.sh &
|
|
311
|
+
done
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
**Expected Behavior:**
|
|
315
|
+
- โ
Only 1 process runs ccusage at a time
|
|
316
|
+
- โ
Other processes skip gracefully (no pile-up)
|
|
317
|
+
- โ
Lock files are properly cleaned up
|
|
318
|
+
- โ
No hanging processes remain
|
|
319
|
+
|
|
320
|
+
**Verification Commands:**
|
|
321
|
+
```bash
|
|
322
|
+
# Check for stale locks
|
|
323
|
+
ls /tmp/ccusage_statusline.* 2>/dev/null || echo "โ
No locks remain"
|
|
324
|
+
|
|
325
|
+
# Monitor running processes
|
|
326
|
+
ps aux | grep ccusage | grep -v grep
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## ๐ Stats
|
|
330
|
+
|
|
331
|
+
<div align="center">
|
|
332
|
+
|
|
333
|
+

|
|
334
|
+

|
|
335
|
+

|
|
336
|
+
|
|
337
|
+
</div>
|
|
338
|
+
|
|
339
|
+
## ๐ Related Projects
|
|
340
|
+
|
|
341
|
+
- **[ccusage](https://github.com/ryoppippi/ccusage)** - Claude Code usage analytics (would not be possible with it!)
|
|
342
|
+
- **[Claude Code](https://docs.anthropic.com/en/docs/claude-code)** - Official documentation
|
|
343
|
+
|
|
344
|
+
## ๐ฅ Contributors
|
|
345
|
+
|
|
346
|
+
We're grateful for all contributions that make cc-statusline better!
|
|
347
|
+
|
|
348
|
+
- **[Jonathan Borgwing (@DevVig)](https://github.com/DevVig)** - Critical performance fix for infinite ccusage process spawning ([#4](https://github.com/chongdashu/cc-statusline/pull/4))
|
|
349
|
+
|
|
350
|
+
### How to Contribute
|
|
351
|
+
|
|
352
|
+
Want to see your name here? Check out our [Contributing Guide](CONTRIBUTING.md) and help make cc-statusline even better!
|
|
353
|
+
|
|
354
|
+
We welcome:
|
|
355
|
+
- ๐ Bug fixes and performance improvements
|
|
356
|
+
- โจ New features and enhancements
|
|
357
|
+
- ๐ Documentation improvements
|
|
358
|
+
- ๐งช Test coverage and quality assurance
|
|
359
|
+
|
|
360
|
+
## ๐ Changelog
|
|
361
|
+
|
|
362
|
+
See [CHANGELOG.md](CHANGELOG.md) for detailed release history.
|
|
363
|
+
|
|
364
|
+
## ๐ License
|
|
365
|
+
|
|
366
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
<div align="center">
|
|
371
|
+
|
|
372
|
+
**Made by [Chong-U](https://github.com/chongdashu) @ [AIOriented](https://aioriented.dev)**
|
|
373
|
+
|
|
306
374
|
</div>
|