@buckits/claude-statusline 2.2.0 โ 2.3.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.
- package/README.md +158 -62
- package/bin/install.js +318 -39
- package/package.json +15 -3
package/README.md
CHANGED
|
@@ -1,6 +1,75 @@
|
|
|
1
1
|
# @buckits/claude-statusline
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
**The statusline Claude Code deserves.**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@buckits/claude-statusline)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
๐ค Opus 4.5 ($12.41) โ [โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโกโโโโโโโโโโโ] 80k/200k
|
|
12
|
+
๐ my-project main โ โ origin/main โ15
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
[Features](#features) โข [Installation](#installation) โข [Screenshots](#what-it-looks-like) โข [GSD Compatible](#-gsd-compatible)
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Why This Statusline?
|
|
22
|
+
|
|
23
|
+
Claude Code's default statusline is... minimal. You deserve better.
|
|
24
|
+
|
|
25
|
+
**This statusline shows you everything you need at a glance:**
|
|
26
|
+
|
|
27
|
+
- ๐จ **Gradient progress bar** that flows green โ yellow โ red as you approach the limit
|
|
28
|
+
- โก **Auto-compact threshold marker** so you know exactly when Claude will summarize
|
|
29
|
+
- ๐ฐ **Session cost tracking** in real-time
|
|
30
|
+
- ๐ **Full git integration** with branch, status, and ahead/behind tracking
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
### ๐จ Gradient Progress Bar
|
|
35
|
+
|
|
36
|
+
50 segments that smoothly transition through colors as your context fills up:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
[โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโกโโโโโโโโโโโ]
|
|
40
|
+
โ green โ yellow โ orange โ threshold
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### โก Auto-Compact Threshold
|
|
44
|
+
|
|
45
|
+
A red lightning bolt marks exactly where Claude will auto-summarize (78%). No more surprises.
|
|
46
|
+
|
|
47
|
+
### ๐ฐ Real-Time Cost
|
|
48
|
+
|
|
49
|
+
See your session cost update as you work: `($12.41)`
|
|
50
|
+
|
|
51
|
+
### ๐ Git Status at a Glance
|
|
52
|
+
|
|
53
|
+
| Symbol | Meaning |
|
|
54
|
+
|--------|---------|
|
|
55
|
+
| `โ` | Clean - all committed |
|
|
56
|
+
| `โ` | Unstaged changes |
|
|
57
|
+
| `โ` | Staged and ready |
|
|
58
|
+
| `โโ` | Both staged and unstaged |
|
|
59
|
+
| `โ5` | 5 commits ahead of remote |
|
|
60
|
+
| `โ2` | 2 commits behind remote |
|
|
61
|
+
|
|
62
|
+
### ๐ 2-Line Dashboard
|
|
63
|
+
|
|
64
|
+
**Line 1:** AI Session Info
|
|
65
|
+
```
|
|
66
|
+
๐ค Opus 4.5 ($12.41) โ [โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโกโโโโโโโโโโโ] 52k/200k
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Line 2:** Project & Git Info
|
|
70
|
+
```
|
|
71
|
+
๐ my-project feature/auth โโ โ origin/feature/auth โ3 โ1
|
|
72
|
+
```
|
|
4
73
|
|
|
5
74
|
## Installation
|
|
6
75
|
|
|
@@ -8,82 +77,86 @@ A beautiful 2-line dashboard statusline for Claude Code with gradient progress b
|
|
|
8
77
|
npx @buckits/claude-statusline
|
|
9
78
|
```
|
|
10
79
|
|
|
11
|
-
|
|
80
|
+
That's it. The installer will:
|
|
81
|
+
1. Ask where to install (global or local)
|
|
82
|
+
2. Copy the statusline script
|
|
83
|
+
3. Configure your settings
|
|
84
|
+
|
|
85
|
+
### Options
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Interactive (recommended)
|
|
89
|
+
npx @buckits/claude-statusline
|
|
90
|
+
|
|
91
|
+
# Install globally for all projects
|
|
92
|
+
npx @buckits/claude-statusline --global
|
|
93
|
+
|
|
94
|
+
# Install for current project only
|
|
95
|
+
npx @buckits/claude-statusline --local
|
|
96
|
+
|
|
97
|
+
# Replace existing statusline
|
|
98
|
+
npx @buckits/claude-statusline --global --force
|
|
12
99
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- `โ` Green checkmark = clean (all committed)
|
|
19
|
-
- `โ` Yellow dot = unstaged changes
|
|
20
|
-
- `โ` Green plus = staged changes ready to commit
|
|
21
|
-
- `โโ` Both = partial commit state
|
|
22
|
-
- **Ahead/Behind Tracking** - `โ5 โ2` shows commits ahead/behind remote
|
|
23
|
-
- **Visual Icons** - ๐ค for AI line, ๐ for project line
|
|
24
|
-
- **GSD Update Notifications** - Automatically detects [Get Shit Done](https://www.npmjs.com/package/get-shit-done-cc) installations and shows available updates
|
|
100
|
+
# Uninstall
|
|
101
|
+
npx @buckits/claude-statusline --global --uninstall
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## What It Looks Like
|
|
25
105
|
|
|
26
|
-
|
|
106
|
+
### Normal Usage (Green Zone)
|
|
107
|
+
```
|
|
108
|
+
๐ค Opus 4.5 ($2.15) โ [โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโกโโโโโโโโโโโ] 20k/200k
|
|
109
|
+
๐ my-app main โ โ origin/main
|
|
110
|
+
```
|
|
27
111
|
|
|
112
|
+
### Getting Busy (Yellow Zone)
|
|
28
113
|
```
|
|
29
|
-
๐ค Opus 4.5 ($
|
|
30
|
-
๐
|
|
114
|
+
๐ค Opus 4.5 ($8.42) โ [โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโกโโโโโโโโโโโ] 52k/200k
|
|
115
|
+
๐ my-app feature/api โ โ origin/feature/api โ5
|
|
31
116
|
```
|
|
32
117
|
|
|
33
|
-
|
|
118
|
+
### Approaching Limit (Orange/Red Zone)
|
|
34
119
|
```
|
|
35
|
-
๐ค Opus 4.5 ($14.61) โ [
|
|
36
|
-
๐
|
|
120
|
+
๐ค Opus 4.5 ($14.61) โ [โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโกโโโโโโโโโโโ] 80k/200k
|
|
121
|
+
๐ my-app main โ โ origin/main โ2 โ1
|
|
37
122
|
```
|
|
38
123
|
|
|
39
|
-
##
|
|
124
|
+
## ๐ค GSD Compatible
|
|
40
125
|
|
|
41
|
-
|
|
42
|
-
| Element | Description |
|
|
43
|
-
|---------|-------------|
|
|
44
|
-
| ๐ค | AI indicator |
|
|
45
|
-
| `Opus 4.5` | Current model (cyan) |
|
|
46
|
-
| `($14.61)` | Session cost (green) |
|
|
47
|
-
| `โ` | Separator |
|
|
48
|
-
| `[โโโโโโโกโโโ]` | Context usage with compact threshold |
|
|
49
|
-
| `80k/200k` | Tokens used / total |
|
|
126
|
+
This statusline works perfectly alongside [Get Shit Done (GSD)](https://www.npmjs.com/package/get-shit-done-cc)!
|
|
50
127
|
|
|
51
|
-
|
|
52
|
-
| Element | Description |
|
|
53
|
-
|---------|-------------|
|
|
54
|
-
| ๐ | Project indicator |
|
|
55
|
-
| `trellis` | Project name (cyan) |
|
|
56
|
-
| `POC` | Current branch (magenta) |
|
|
57
|
-
| `โโโ` | Git status (clean/unstaged/staged) |
|
|
58
|
-
| `โ` | Points to tracking branch |
|
|
59
|
-
| `origin/POC` | Remote tracking branch (blue) |
|
|
60
|
-
| `โ15` | Commits ahead (green) |
|
|
61
|
-
| `โ3` | Commits behind (red) |
|
|
128
|
+
If you have GSD installed, the statusline will automatically show update notifications when a new GSD version is available.
|
|
62
129
|
|
|
63
|
-
|
|
130
|
+
```bash
|
|
131
|
+
# Install both for the ultimate Claude Code setup
|
|
132
|
+
npx @buckits/claude-statusline
|
|
133
|
+
npx get-shit-done-cc
|
|
134
|
+
```
|
|
64
135
|
|
|
65
|
-
|
|
136
|
+
## Requirements
|
|
66
137
|
|
|
67
|
-
**
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
138
|
+
- **Claude Code CLI** (obviously)
|
|
139
|
+
- **jq** - for JSON parsing ([install guide](https://stedolan.github.io/jq/download/))
|
|
140
|
+
- **Bash** - ships with macOS/Linux
|
|
141
|
+
- **Git** - for git status features (optional)
|
|
71
142
|
|
|
72
|
-
|
|
143
|
+
### Installing jq
|
|
73
144
|
|
|
74
|
-
|
|
145
|
+
```bash
|
|
146
|
+
# macOS
|
|
147
|
+
brew install jq
|
|
75
148
|
|
|
76
|
-
|
|
149
|
+
# Ubuntu/Debian
|
|
150
|
+
sudo apt install jq
|
|
77
151
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
| Approaching | Yellow |
|
|
82
|
-
| Close | Orange |
|
|
83
|
-
| At threshold | Red |
|
|
152
|
+
# Windows (via chocolatey)
|
|
153
|
+
choco install jq
|
|
154
|
+
```
|
|
84
155
|
|
|
85
156
|
## Manual Installation
|
|
86
157
|
|
|
158
|
+
If you prefer to install manually:
|
|
159
|
+
|
|
87
160
|
1. Copy `statusline.sh` to `~/.claude/statusline.sh`
|
|
88
161
|
2. Make it executable: `chmod +x ~/.claude/statusline.sh`
|
|
89
162
|
3. Add to `~/.claude/settings.json`:
|
|
@@ -97,13 +170,36 @@ The bar gradient is calculated relative to the โก threshold (not total capacity
|
|
|
97
170
|
}
|
|
98
171
|
```
|
|
99
172
|
|
|
100
|
-
##
|
|
173
|
+
## Troubleshooting
|
|
174
|
+
|
|
175
|
+
### Statusline not showing?
|
|
176
|
+
|
|
177
|
+
1. Make sure you restarted Claude Code after installation
|
|
178
|
+
2. Check that `jq` is installed: `which jq`
|
|
179
|
+
3. Verify the script is executable: `ls -la ~/.claude/statusline.sh`
|
|
180
|
+
|
|
181
|
+
### Wrong colors?
|
|
182
|
+
|
|
183
|
+
Your terminal needs to support 256 colors. Most modern terminals do.
|
|
101
184
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
185
|
+
### Git status not showing?
|
|
186
|
+
|
|
187
|
+
Make sure you're in a git repository with at least one commit.
|
|
188
|
+
|
|
189
|
+
## Contributing
|
|
190
|
+
|
|
191
|
+
Issues and PRs welcome at [github.com/Buckits/claude-statusline](https://github.com/Buckits/claude-statusline)
|
|
106
192
|
|
|
107
193
|
## License
|
|
108
194
|
|
|
109
|
-
MIT
|
|
195
|
+
MIT ยฉ [Buckits](https://github.com/Buckits)
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
<div align="center">
|
|
200
|
+
|
|
201
|
+
**Made for the Claude Code community** ๐ค
|
|
202
|
+
|
|
203
|
+
*Star this repo if you find it useful!*
|
|
204
|
+
|
|
205
|
+
</div>
|
package/bin/install.js
CHANGED
|
@@ -3,56 +3,335 @@
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const os = require('os');
|
|
6
|
+
const readline = require('readline');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
8
|
+
// Colors
|
|
9
|
+
const cyan = '\x1b[36m';
|
|
10
|
+
const green = '\x1b[32m';
|
|
11
|
+
const yellow = '\x1b[33m';
|
|
12
|
+
const red = '\x1b[31m';
|
|
13
|
+
const magenta = '\x1b[35m';
|
|
14
|
+
const dim = '\x1b[2m';
|
|
15
|
+
const bold = '\x1b[1m';
|
|
16
|
+
const reset = '\x1b[0m';
|
|
11
17
|
|
|
12
|
-
|
|
18
|
+
// Get version from package.json
|
|
19
|
+
const pkg = require('../package.json');
|
|
13
20
|
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
// Parse args
|
|
22
|
+
const args = process.argv.slice(2);
|
|
23
|
+
const hasGlobal = args.includes('--global') || args.includes('-g');
|
|
24
|
+
const hasLocal = args.includes('--local') || args.includes('-l');
|
|
25
|
+
const hasHelp = args.includes('--help') || args.includes('-h');
|
|
26
|
+
const hasUninstall = args.includes('--uninstall') || args.includes('-u');
|
|
27
|
+
const hasForce = args.includes('--force') || args.includes('-f');
|
|
28
|
+
|
|
29
|
+
// Directory constants
|
|
30
|
+
const CLAUDE_DIR_NAME = '.claude';
|
|
31
|
+
|
|
32
|
+
function getGlobalDir() {
|
|
33
|
+
if (process.env.CLAUDE_CONFIG_DIR) {
|
|
34
|
+
return expandTilde(process.env.CLAUDE_CONFIG_DIR);
|
|
35
|
+
}
|
|
36
|
+
return path.join(os.homedir(), CLAUDE_DIR_NAME);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function getLocalDir() {
|
|
40
|
+
return path.join(process.cwd(), CLAUDE_DIR_NAME);
|
|
18
41
|
}
|
|
19
42
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
43
|
+
function expandTilde(filePath) {
|
|
44
|
+
if (filePath && filePath.startsWith('~/')) {
|
|
45
|
+
return path.join(os.homedir(), filePath.slice(2));
|
|
46
|
+
}
|
|
47
|
+
return filePath;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// ASCII Art Banner
|
|
51
|
+
const banner = `
|
|
52
|
+
${cyan} โโโโฆ โโโโฆ โฆโโฆโโโโ
|
|
53
|
+
โ โ โ โโฃโ โ โโโโฃ
|
|
54
|
+
โโโโฉโโโฉ โฉโโโโโฉโโโโ${reset}
|
|
55
|
+
${magenta}โโโโโฆโโโโโโฆโโฆ โฆโโโโฆ โฆโโโโโโ
|
|
56
|
+
โโโ โ โ โโฃ โ โ โโโโโ โโโโโโฃ
|
|
57
|
+
โโโ โฉ โฉ โฉ โฉ โโโโโโโฉโโโฉโโโโโโ${reset}
|
|
58
|
+
|
|
59
|
+
${bold}The statusline Claude Code deserves${reset} ${dim}v${pkg.version}${reset}
|
|
60
|
+
|
|
61
|
+
${dim}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${reset}
|
|
62
|
+
${green}โ${reset}${green}โ${reset}${yellow}โ${reset}${yellow}โ${reset}${red}โ${reset}${red}โ${reset}โโโโโกโโโ ${dim}Gradient progress โข Git status${reset}
|
|
63
|
+
${dim}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${reset}
|
|
64
|
+
`;
|
|
65
|
+
|
|
66
|
+
const features = `
|
|
67
|
+
${cyan}โฆ${reset} ${bold}Gradient Progress Bar${reset}
|
|
68
|
+
50 segments that flow ${green}green${reset} โ ${yellow}yellow${reset} โ ${red}red${reset}
|
|
69
|
+
as you approach the context limit
|
|
70
|
+
|
|
71
|
+
${cyan}โฆ${reset} ${bold}โก Auto-Compact Threshold${reset}
|
|
72
|
+
Red lightning bolt shows exactly where
|
|
73
|
+
Claude will auto-summarize (78%)
|
|
74
|
+
|
|
75
|
+
${cyan}โฆ${reset} ${bold}Git Integration${reset}
|
|
76
|
+
Branch โข ${green}โ${reset}/${yellow}โ${reset}/${green}โ${reset} status โข ${green}โ${reset}ahead ${red}โ${reset}behind
|
|
77
|
+
|
|
78
|
+
${cyan}โฆ${reset} ${bold}Session Cost Tracking${reset}
|
|
79
|
+
See your running \$ cost in real-time
|
|
80
|
+
|
|
81
|
+
${cyan}โฆ${reset} ${bold}2-Line Dashboard${reset}
|
|
82
|
+
Line 1: ๐ค Model โข Cost โข Context
|
|
83
|
+
Line 2: ๐ Project โข Branch โข Status
|
|
84
|
+
`;
|
|
85
|
+
|
|
86
|
+
const example = `
|
|
87
|
+
${dim}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${reset}
|
|
88
|
+
${dim}โ${reset} ๐ค ${cyan}Opus 4.5${reset} ${green}(\$12.41)${reset} โ [${green}โโโโโโโโ${yellow}โโโโ${red}โโ${reset}โโโโโโโโกโโโโโ] ${yellow}62k${reset}/${cyan}200k${reset} ${dim}โ${reset}
|
|
89
|
+
${dim}โ${reset} ๐ ${cyan}my-project${reset} ${magenta}main${reset} ${green}โ${reset} โ ${cyan}origin/main${reset} ${green}โ2${reset} ${dim}โ${reset}
|
|
90
|
+
${dim}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${reset}
|
|
91
|
+
`;
|
|
92
|
+
|
|
93
|
+
// Help text
|
|
94
|
+
if (hasHelp) {
|
|
95
|
+
console.log(banner);
|
|
96
|
+
console.log(` ${yellow}Usage:${reset} npx @buckits/claude-statusline [options]
|
|
97
|
+
|
|
98
|
+
${yellow}Options:${reset}
|
|
99
|
+
${cyan}-g, --global${reset} Install globally (${dim}~/.claude${reset})
|
|
100
|
+
${cyan}-l, --local${reset} Install locally (${dim}./.claude${reset})
|
|
101
|
+
${cyan}-u, --uninstall${reset} Remove statusline configuration
|
|
102
|
+
${cyan}-f, --force${reset} Replace existing statusline config
|
|
103
|
+
${cyan}-h, --help${reset} Show this help message
|
|
24
104
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
105
|
+
${yellow}Examples:${reset}
|
|
106
|
+
${dim}# Interactive install (prompts for location)${reset}
|
|
107
|
+
npx @buckits/claude-statusline
|
|
28
108
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
109
|
+
${dim}# Install globally for all projects${reset}
|
|
110
|
+
npx @buckits/claude-statusline --global
|
|
111
|
+
|
|
112
|
+
${dim}# Install for current project only${reset}
|
|
113
|
+
npx @buckits/claude-statusline --local
|
|
114
|
+
|
|
115
|
+
${dim}# Replace existing statusline${reset}
|
|
116
|
+
npx @buckits/claude-statusline --global --force
|
|
117
|
+
`);
|
|
118
|
+
process.exit(0);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
console.log(banner);
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Read and parse settings.json
|
|
125
|
+
*/
|
|
126
|
+
function readSettings(settingsPath) {
|
|
127
|
+
if (fs.existsSync(settingsPath)) {
|
|
128
|
+
try {
|
|
129
|
+
return JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
|
|
130
|
+
} catch (e) {
|
|
131
|
+
return {};
|
|
132
|
+
}
|
|
35
133
|
}
|
|
134
|
+
return {};
|
|
36
135
|
}
|
|
37
136
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
137
|
+
/**
|
|
138
|
+
* Write settings.json with proper formatting
|
|
139
|
+
*/
|
|
140
|
+
function writeSettings(settingsPath, settings) {
|
|
141
|
+
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
|
|
41
142
|
}
|
|
42
143
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
144
|
+
/**
|
|
145
|
+
* Uninstall statusline
|
|
146
|
+
*/
|
|
147
|
+
function uninstall(isGlobal) {
|
|
148
|
+
const targetDir = isGlobal ? getGlobalDir() : getLocalDir();
|
|
149
|
+
const locationLabel = isGlobal
|
|
150
|
+
? targetDir.replace(os.homedir(), '~')
|
|
151
|
+
: targetDir.replace(process.cwd(), '.');
|
|
48
152
|
|
|
49
|
-
|
|
153
|
+
console.log(` Uninstalling from ${cyan}${locationLabel}${reset}\n`);
|
|
50
154
|
|
|
51
|
-
|
|
52
|
-
console.log(
|
|
53
|
-
console.log(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
155
|
+
if (!fs.existsSync(targetDir)) {
|
|
156
|
+
console.log(` ${yellow}โ ${reset} Directory does not exist: ${locationLabel}`);
|
|
157
|
+
console.log(` Nothing to uninstall.\n`);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
let removed = false;
|
|
162
|
+
|
|
163
|
+
// Remove statusline.sh
|
|
164
|
+
const statuslinePath = path.join(targetDir, 'statusline.sh');
|
|
165
|
+
if (fs.existsSync(statuslinePath)) {
|
|
166
|
+
fs.unlinkSync(statuslinePath);
|
|
167
|
+
console.log(` ${green}โ${reset} Removed statusline.sh`);
|
|
168
|
+
removed = true;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Clean up settings.json
|
|
172
|
+
const settingsPath = path.join(targetDir, 'settings.json');
|
|
173
|
+
if (fs.existsSync(settingsPath)) {
|
|
174
|
+
const settings = readSettings(settingsPath);
|
|
175
|
+
|
|
176
|
+
if (settings.statusLine && settings.statusLine.command &&
|
|
177
|
+
settings.statusLine.command.includes('statusline.sh')) {
|
|
178
|
+
delete settings.statusLine;
|
|
179
|
+
writeSettings(settingsPath, settings);
|
|
180
|
+
console.log(` ${green}โ${reset} Removed statusline from settings.json`);
|
|
181
|
+
removed = true;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// Also clean up old format
|
|
185
|
+
if (settings.status_line) {
|
|
186
|
+
delete settings.status_line;
|
|
187
|
+
writeSettings(settingsPath, settings);
|
|
188
|
+
removed = true;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (!removed) {
|
|
193
|
+
console.log(` ${yellow}โ ${reset} No statusline configuration found.`);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
console.log(`
|
|
197
|
+
${green}Done!${reset} Statusline has been removed.
|
|
198
|
+
Restart Claude Code to see the change.
|
|
199
|
+
`);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Install statusline
|
|
204
|
+
*/
|
|
205
|
+
function install(isGlobal) {
|
|
206
|
+
const targetDir = isGlobal ? getGlobalDir() : getLocalDir();
|
|
207
|
+
const locationLabel = isGlobal
|
|
208
|
+
? targetDir.replace(os.homedir(), '~')
|
|
209
|
+
: targetDir.replace(process.cwd(), '.');
|
|
210
|
+
|
|
211
|
+
console.log(` Installing to ${cyan}${locationLabel}${reset}\n`);
|
|
212
|
+
|
|
213
|
+
// Ensure directory exists
|
|
214
|
+
if (!fs.existsSync(targetDir)) {
|
|
215
|
+
console.log(` ${dim}Creating ${locationLabel}...${reset}`);
|
|
216
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Copy statusline.sh
|
|
220
|
+
const statuslineSrc = path.join(__dirname, '..', 'statusline.sh');
|
|
221
|
+
const statuslineDest = path.join(targetDir, 'statusline.sh');
|
|
222
|
+
fs.copyFileSync(statuslineSrc, statuslineDest);
|
|
223
|
+
fs.chmodSync(statuslineDest, '755');
|
|
224
|
+
console.log(` ${green}โ${reset} Installed statusline.sh`);
|
|
225
|
+
|
|
226
|
+
// Update settings.json
|
|
227
|
+
const settingsPath = path.join(targetDir, 'settings.json');
|
|
228
|
+
const settings = readSettings(settingsPath);
|
|
229
|
+
|
|
230
|
+
// Check for existing statusline
|
|
231
|
+
const hasExisting = settings.statusLine != null || settings.status_line != null;
|
|
232
|
+
|
|
233
|
+
if (hasExisting && !hasForce) {
|
|
234
|
+
const existingCmd = settings.statusLine?.command || settings.status_line?.script || '(custom)';
|
|
235
|
+
console.log(`
|
|
236
|
+
${yellow}โ ${reset} Existing statusline detected
|
|
237
|
+
${dim}Current: ${existingCmd}${reset}
|
|
238
|
+
|
|
239
|
+
Use ${cyan}--force${reset} to replace it, or keep your current config.
|
|
240
|
+
${dim}The statusline.sh file has been installed - you can switch anytime.${reset}
|
|
241
|
+
`);
|
|
242
|
+
} else {
|
|
243
|
+
// Remove old format if present
|
|
244
|
+
if (settings.status_line) {
|
|
245
|
+
delete settings.status_line;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Set new format
|
|
249
|
+
settings.statusLine = {
|
|
250
|
+
type: 'command',
|
|
251
|
+
command: statuslineDest
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
writeSettings(settingsPath, settings);
|
|
255
|
+
console.log(` ${green}โ${reset} Configured settings.json`);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Success message
|
|
259
|
+
console.log(`
|
|
260
|
+
${green}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${reset}
|
|
261
|
+
${green}โ${reset} ${bold}Installation complete!${reset}
|
|
262
|
+
${green}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${reset}
|
|
263
|
+
|
|
264
|
+
${cyan}Restart Claude Code${reset} to see your new statusline.
|
|
265
|
+
|
|
266
|
+
${dim}Tip: Works great with GSD (Get Shit Done)!${reset}
|
|
267
|
+
${dim} npx get-shit-done-cc${reset}
|
|
268
|
+
|
|
269
|
+
${dim}Issues? ${reset}${cyan}github.com/Buckits/claude-statusline${reset}
|
|
270
|
+
`);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Interactive prompt for install location
|
|
275
|
+
*/
|
|
276
|
+
function promptLocation() {
|
|
277
|
+
if (!process.stdin.isTTY) {
|
|
278
|
+
console.log(` ${dim}Non-interactive mode, defaulting to global install${reset}\n`);
|
|
279
|
+
install(true);
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
console.log(features);
|
|
284
|
+
console.log(example);
|
|
285
|
+
|
|
286
|
+
const rl = readline.createInterface({
|
|
287
|
+
input: process.stdin,
|
|
288
|
+
output: process.stdout
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
let answered = false;
|
|
292
|
+
|
|
293
|
+
rl.on('close', () => {
|
|
294
|
+
if (!answered) {
|
|
295
|
+
console.log(`\n ${yellow}Installation cancelled${reset}\n`);
|
|
296
|
+
process.exit(0);
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
const globalPath = getGlobalDir().replace(os.homedir(), '~');
|
|
301
|
+
|
|
302
|
+
console.log(`
|
|
303
|
+
${yellow}Where would you like to install?${reset}
|
|
304
|
+
|
|
305
|
+
${cyan}1${reset}) ${bold}Global${reset} ${dim}(${globalPath})${reset}
|
|
306
|
+
Available in all your projects
|
|
307
|
+
|
|
308
|
+
${cyan}2${reset}) ${bold}Local${reset} ${dim}(./.claude)${reset}
|
|
309
|
+
This project only
|
|
310
|
+
`);
|
|
311
|
+
|
|
312
|
+
rl.question(` Choice ${dim}[1]${reset}: `, (answer) => {
|
|
313
|
+
answered = true;
|
|
314
|
+
rl.close();
|
|
315
|
+
console.log('');
|
|
316
|
+
const choice = answer.trim() || '1';
|
|
317
|
+
install(choice !== '2');
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// Main logic
|
|
322
|
+
if (hasGlobal && hasLocal) {
|
|
323
|
+
console.log(` ${red}โ${reset} Cannot specify both --global and --local\n`);
|
|
324
|
+
process.exit(1);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
if (hasUninstall) {
|
|
328
|
+
if (!hasGlobal && !hasLocal) {
|
|
329
|
+
console.log(` ${red}โ${reset} --uninstall requires --global or --local\n`);
|
|
330
|
+
process.exit(1);
|
|
331
|
+
}
|
|
332
|
+
uninstall(hasGlobal);
|
|
333
|
+
} else if (hasGlobal || hasLocal) {
|
|
334
|
+
install(hasGlobal);
|
|
335
|
+
} else {
|
|
336
|
+
promptLocation();
|
|
337
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buckits/claude-statusline",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.3.0",
|
|
4
|
+
"description": "The statusline Claude Code deserves - gradient progress bar, auto-compact threshold marker, git status, cost tracking, 2-line dashboard",
|
|
5
5
|
"bin": {
|
|
6
6
|
"claude-statusline": "./bin/install.js"
|
|
7
7
|
},
|
|
@@ -14,7 +14,15 @@
|
|
|
14
14
|
"claude-code",
|
|
15
15
|
"statusline",
|
|
16
16
|
"cli",
|
|
17
|
-
"terminal"
|
|
17
|
+
"terminal",
|
|
18
|
+
"progress-bar",
|
|
19
|
+
"git-status",
|
|
20
|
+
"context-window",
|
|
21
|
+
"anthropic",
|
|
22
|
+
"ai",
|
|
23
|
+
"developer-tools",
|
|
24
|
+
"gsd",
|
|
25
|
+
"get-shit-done"
|
|
18
26
|
],
|
|
19
27
|
"author": "Buckits",
|
|
20
28
|
"license": "MIT",
|
|
@@ -22,6 +30,10 @@
|
|
|
22
30
|
"type": "git",
|
|
23
31
|
"url": "https://github.com/Buckits/claude-statusline"
|
|
24
32
|
},
|
|
33
|
+
"homepage": "https://github.com/Buckits/claude-statusline#readme",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/Buckits/claude-statusline/issues"
|
|
36
|
+
},
|
|
25
37
|
"engines": {
|
|
26
38
|
"node": ">=14"
|
|
27
39
|
}
|