@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.
Files changed (3) hide show
  1. package/README.md +158 -62
  2. package/bin/install.js +318 -39
  3. package/package.json +15 -3
package/README.md CHANGED
@@ -1,6 +1,75 @@
1
1
  # @buckits/claude-statusline
2
2
 
3
- A beautiful 2-line dashboard statusline for Claude Code with gradient progress bar, compact threshold marker, git status indicators, cost tracking, and GSD (Get Shit Done) update notifications.
3
+ <div align="center">
4
+
5
+ **The statusline Claude Code deserves.**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@buckits/claude-statusline.svg)](https://www.npmjs.com/package/@buckits/claude-statusline)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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
- ## Features
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
- - **2-Line Dashboard Layout** - Clean separation of AI info and project info
14
- - **Gradient Progress Bar** - 50 segments (4k tokens each) that smoothly transition green โ†’ yellow โ†’ orange โ†’ red
15
- - **โšก Compact Threshold Marker** - Red lightning bolt shows exactly where auto-compact triggers (78%)
16
- - **Session Cost Tracking** - See your running cost in real-time
17
- - **Git Status Indicators**:
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
- ## Screenshot
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 ($14.61) โ”‚ [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โšกโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 80k/200k
30
- ๐Ÿ“ trellis POC โœ“ โ†’ origin/POC โ†‘15
114
+ ๐Ÿค– Opus 4.5 ($8.42) โ”‚ [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โšกโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 52k/200k
115
+ ๐Ÿ“ my-app feature/api โ— โ†’ origin/feature/api โ†‘5
31
116
  ```
32
117
 
33
- With GSD update available:
118
+ ### Approaching Limit (Orange/Red Zone)
34
119
  ```
35
- ๐Ÿค– Opus 4.5 ($14.61) โ”‚ [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โšกโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 80k/200k
36
- ๐Ÿ“ trellis POC โœ“ โ†’ origin/POC โ†‘15 | GSD 1.5.0>1.6.4
120
+ ๐Ÿค– Opus 4.5 ($14.61) โ”‚ [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโšกโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 80k/200k
121
+ ๐Ÿ“ my-app main โœš โ†’ origin/main โ†‘2 โ†“1
37
122
  ```
38
123
 
39
- ## What Each Element Means
124
+ ## ๐Ÿค GSD Compatible
40
125
 
41
- ### Line 1 - AI Session Info
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
- ### Line 2 - Project Info
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
- ## GSD Integration
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
- If you have [Get Shit Done (GSD)](https://www.npmjs.com/package/get-shit-done-cc) installed, the statusline will automatically detect it and show update notifications when a newer version is available.
136
+ ## Requirements
66
137
 
67
- **How it works:**
68
- 1. Checks for GSD installation in project (`.claude/get-shit-done/VERSION`) or global (`~/.claude/get-shit-done/VERSION`)
69
- 2. Reads the latest version from GSD's update cache (`~/.claude/cache/gsd-update-check.json`)
70
- 3. If versions differ, shows the update notification on line 2
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
- **Note:** The cache is populated by GSD's SessionStart hook. If you see no notification, you're either on the latest version or GSD hasn't checked for updates yet.
143
+ ### Installing jq
73
144
 
74
- ## Progress Bar Colors
145
+ ```bash
146
+ # macOS
147
+ brew install jq
75
148
 
76
- The bar gradient is calculated relative to the โšก threshold (not total capacity):
149
+ # Ubuntu/Debian
150
+ sudo apt install jq
77
151
 
78
- | Distance to โšก | Color |
79
- |---------------|-------|
80
- | Far (safe) | Bright green |
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
- ## Requirements
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
- - Claude Code CLI
103
- - `jq` (for JSON parsing)
104
- - Bash
105
- - Git (for git status features)
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
- const CLAUDE_DIR = path.join(os.homedir(), '.claude');
8
- const SETTINGS_FILE = path.join(CLAUDE_DIR, 'settings.json');
9
- const STATUSLINE_DEST = path.join(CLAUDE_DIR, 'statusline.sh');
10
- const STATUSLINE_SRC = path.join(__dirname, '..', 'statusline.sh');
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
- console.log('\n๐ŸŽจ Installing @buckits/claude-statusline...\n');
18
+ // Get version from package.json
19
+ const pkg = require('../package.json');
13
20
 
14
- // Ensure ~/.claude directory exists
15
- if (!fs.existsSync(CLAUDE_DIR)) {
16
- console.log('๐Ÿ“ Creating ~/.claude directory...');
17
- fs.mkdirSync(CLAUDE_DIR, { recursive: true });
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
- // Copy statusline.sh
21
- console.log('๐Ÿ“„ Copying statusline.sh...');
22
- fs.copyFileSync(STATUSLINE_SRC, STATUSLINE_DEST);
23
- fs.chmodSync(STATUSLINE_DEST, '755');
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
- // Update settings.json
26
- console.log('โš™๏ธ Updating settings.json...');
27
- let settings = {};
105
+ ${yellow}Examples:${reset}
106
+ ${dim}# Interactive install (prompts for location)${reset}
107
+ npx @buckits/claude-statusline
28
108
 
29
- if (fs.existsSync(SETTINGS_FILE)) {
30
- try {
31
- const content = fs.readFileSync(SETTINGS_FILE, 'utf8');
32
- settings = JSON.parse(content);
33
- } catch (e) {
34
- console.warn('โš ๏ธ Could not parse existing settings.json, creating new one');
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
- // Remove old format if present
39
- if (settings.status_line) {
40
- delete settings.status_line;
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
- // Set the statusLine configuration (correct camelCase format)
44
- settings.statusLine = {
45
- type: "command",
46
- command: STATUSLINE_DEST
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
- fs.writeFileSync(SETTINGS_FILE, JSON.stringify(settings, null, 2));
153
+ console.log(` Uninstalling from ${cyan}${locationLabel}${reset}\n`);
50
154
 
51
- console.log('\nโœ… Installation complete!\n');
52
- console.log('Your Claude Code statusline now features:');
53
- console.log(' โ€ข Gradient progress bar (green โ†’ yellow โ†’ orange โ†’ red)');
54
- console.log(' โ€ข โšก Compact threshold marker at 78%');
55
- console.log(' โ€ข Git branch, status, and ahead/behind tracking');
56
- console.log(' โ€ข Session cost display');
57
- console.log(' โ€ข GSD update notifications (if installed)');
58
- console.log('\nRestart Claude Code to see the new statusline.\n');
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.2.0",
4
- "description": "A beautiful 2-line dashboard statusline for Claude Code with gradient progress bar, compact threshold marker, git status indicators, cost tracking, and GSD update notifications",
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
  }