claude-simple-status 1.0.0 → 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 +2 -1
- package/package.json +2 -2
- package/statusline.mjs +24 -3
package/README.md
CHANGED
|
@@ -32,9 +32,10 @@ npm install -g claude-simple-status
|
|
|
32
32
|
|
|
33
33
|
That's it — Claude Code is configured automatically. The statusline appears immediately.
|
|
34
34
|
|
|
35
|
-
To uninstall
|
|
35
|
+
To uninstall:
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
+
claude-simple-status --uninstall
|
|
38
39
|
npm uninstall -g claude-simple-status
|
|
39
40
|
```
|
|
40
41
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-simple-status",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A simple statusline for Claude Code — git branch, model, context usage, and quota at a glance",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"claude-simple-status": "
|
|
7
|
+
"claude-simple-status": "statusline.mjs"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"postinstall": "node scripts/setup.mjs install",
|
package/statusline.mjs
CHANGED
|
@@ -8,6 +8,24 @@ import { join } from 'path';
|
|
|
8
8
|
import { spawn, execSync } from 'child_process';
|
|
9
9
|
import { request } from 'https';
|
|
10
10
|
|
|
11
|
+
// Handle --uninstall flag (workaround: npm doesn't run preuninstall for global packages)
|
|
12
|
+
if (process.argv.includes('--uninstall')) {
|
|
13
|
+
const settingsFile = join(homedir(), '.claude', 'settings.json');
|
|
14
|
+
try {
|
|
15
|
+
const settings = JSON.parse(readFileSync(settingsFile, 'utf8'));
|
|
16
|
+
if (settings.statusLine?.command === 'claude-simple-status') {
|
|
17
|
+
delete settings.statusLine;
|
|
18
|
+
writeFileSync(settingsFile, JSON.stringify(settings, null, 2) + '\n');
|
|
19
|
+
console.log('claude-simple-status removed from Claude Code settings.');
|
|
20
|
+
} else {
|
|
21
|
+
console.log('Nothing to remove (statusLine not managed by claude-simple-status).');
|
|
22
|
+
}
|
|
23
|
+
} catch {
|
|
24
|
+
console.log('Nothing to remove (~/.claude/settings.json not found).');
|
|
25
|
+
}
|
|
26
|
+
process.exit(0);
|
|
27
|
+
}
|
|
28
|
+
|
|
11
29
|
// ANSI color codes
|
|
12
30
|
const GREEN = '\x1b[0;32m';
|
|
13
31
|
const ORANGE = '\x1b[0;33m';
|
|
@@ -248,9 +266,12 @@ async function main() {
|
|
|
248
266
|
const branch = getGitBranch();
|
|
249
267
|
|
|
250
268
|
// Build output
|
|
251
|
-
let output = `${branch ? `${YELLOW_BOLD}${branch}${RESET} | ` : ''}${CYAN}${model}${RESET} | ${colorPct(contextUsed)}
|
|
252
|
-
if (
|
|
253
|
-
output += ` | ${
|
|
269
|
+
let output = `${branch ? `${YELLOW_BOLD}${branch}${RESET} | ` : ''}${CYAN}${model}${RESET} | ${colorPct(contextUsed)}`;
|
|
270
|
+
if (token) {
|
|
271
|
+
output += ` | ${resetLocal} | 5h:${colorPct(fiveHourPct)} | 7d:${colorPct(sevenDayPct)}`;
|
|
272
|
+
if (hasError) {
|
|
273
|
+
output += ` | ${RED}ERR${RESET}`;
|
|
274
|
+
}
|
|
254
275
|
}
|
|
255
276
|
|
|
256
277
|
process.stdout.write(output);
|