ccstatusline 2.0.0 → 2.0.1
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 +11 -1
- package/dist/ccstatusline.js +40 -15
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -200,7 +200,7 @@ Execute shell commands and display their output dynamically:
|
|
|
200
200
|
|
|
201
201
|
### 🔗 Integration Example: ccusage
|
|
202
202
|
|
|
203
|
-
[ccusage](https://github.com/
|
|
203
|
+
[ccusage](https://github.com/ryoppippi/ccusage) is a tool that tracks and displays Claude Code usage metrics. You can integrate it directly into your status line:
|
|
204
204
|
|
|
205
205
|
1. Add a Custom Command widget
|
|
206
206
|
2. Set command: `npx -y ccusage statusline`
|
|
@@ -325,6 +325,16 @@ Contributions are welcome! Please feel free to submit a Pull Request.
|
|
|
325
325
|
|
|
326
326
|
---
|
|
327
327
|
|
|
328
|
+
## Star History
|
|
329
|
+
|
|
330
|
+
<a href="https://www.star-history.com/#sirmalloc/ccstatusline&Timeline">
|
|
331
|
+
<picture>
|
|
332
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=sirmalloc/ccstatusline&type=Timeline&theme=dark" />
|
|
333
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=sirmalloc/ccstatusline&type=Timeline" />
|
|
334
|
+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=sirmalloc/ccstatusline&type=Timeline" />
|
|
335
|
+
</picture>
|
|
336
|
+
</a>
|
|
337
|
+
|
|
328
338
|
<div align="center">
|
|
329
339
|
|
|
330
340
|
### 🌟 Show Your Support
|
package/dist/ccstatusline.js
CHANGED
|
@@ -49573,14 +49573,24 @@ import { execSync as execSync3 } from "child_process";
|
|
|
49573
49573
|
import * as fs5 from "fs";
|
|
49574
49574
|
import * as path4 from "path";
|
|
49575
49575
|
var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils";
|
|
49576
|
+
var PACKAGE_VERSION = "2.0.1";
|
|
49576
49577
|
function getPackageVersion() {
|
|
49577
|
-
|
|
49578
|
-
|
|
49579
|
-
|
|
49580
|
-
|
|
49581
|
-
|
|
49582
|
-
|
|
49578
|
+
if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
|
|
49579
|
+
return PACKAGE_VERSION;
|
|
49580
|
+
}
|
|
49581
|
+
const possiblePaths = [
|
|
49582
|
+
path4.join(__dirname, "..", "..", "package.json"),
|
|
49583
|
+
path4.join(__dirname, "..", "package.json")
|
|
49584
|
+
];
|
|
49585
|
+
for (const packageJsonPath of possiblePaths) {
|
|
49586
|
+
try {
|
|
49587
|
+
if (fs5.existsSync(packageJsonPath)) {
|
|
49588
|
+
const packageJson = JSON.parse(fs5.readFileSync(packageJsonPath, "utf-8"));
|
|
49589
|
+
return packageJson.version ?? "";
|
|
49590
|
+
}
|
|
49591
|
+
} catch {}
|
|
49583
49592
|
}
|
|
49593
|
+
return "";
|
|
49584
49594
|
}
|
|
49585
49595
|
function getTerminalWidth() {
|
|
49586
49596
|
try {
|
|
@@ -51583,7 +51593,8 @@ class CustomCommandWidget {
|
|
|
51583
51593
|
encoding: "utf8",
|
|
51584
51594
|
input: jsonInput,
|
|
51585
51595
|
timeout,
|
|
51586
|
-
stdio: ["pipe", "pipe", "ignore"]
|
|
51596
|
+
stdio: ["pipe", "pipe", "ignore"],
|
|
51597
|
+
env: process.env
|
|
51587
51598
|
}).trim();
|
|
51588
51599
|
if (!item.preserveColors) {
|
|
51589
51600
|
output = output.replace(/\x1b\[[0-9;]*m/g, "");
|
|
@@ -51592,7 +51603,21 @@ class CustomCommandWidget {
|
|
|
51592
51603
|
output = output.substring(0, item.maxWidth - 3) + "...";
|
|
51593
51604
|
}
|
|
51594
51605
|
return output || null;
|
|
51595
|
-
} catch {
|
|
51606
|
+
} catch (error43) {
|
|
51607
|
+
if (error43 instanceof Error) {
|
|
51608
|
+
const execError = error43;
|
|
51609
|
+
if (execError.code === "ENOENT") {
|
|
51610
|
+
return "[Cmd not found]";
|
|
51611
|
+
} else if (execError.code === "ETIMEDOUT") {
|
|
51612
|
+
return "[Timeout]";
|
|
51613
|
+
} else if (execError.code === "EACCES") {
|
|
51614
|
+
return "[Permission denied]";
|
|
51615
|
+
} else if (execError.signal) {
|
|
51616
|
+
return `[Signal: ${execError.signal}]`;
|
|
51617
|
+
} else if (execError.status !== undefined) {
|
|
51618
|
+
return `[Exit: ${execError.status}]`;
|
|
51619
|
+
}
|
|
51620
|
+
}
|
|
51596
51621
|
return "[Error]";
|
|
51597
51622
|
}
|
|
51598
51623
|
}
|
|
@@ -53174,13 +53199,13 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
53174
53199
|
"Edit Line",
|
|
53175
53200
|
" ",
|
|
53176
53201
|
lineNumber,
|
|
53177
|
-
" "
|
|
53178
|
-
moveMode && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
|
|
53179
|
-
color: "yellow",
|
|
53180
|
-
children: "[MOVE MODE]"
|
|
53181
|
-
}, undefined, false, undefined, this)
|
|
53202
|
+
" "
|
|
53182
53203
|
]
|
|
53183
53204
|
}, undefined, true, undefined, this),
|
|
53205
|
+
moveMode && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
|
|
53206
|
+
color: "blue",
|
|
53207
|
+
children: "[MOVE MODE]"
|
|
53208
|
+
}, undefined, false, undefined, this),
|
|
53184
53209
|
(settings.powerline.enabled || Boolean(settings.defaultSeparator)) && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
|
|
53185
53210
|
marginLeft: 2,
|
|
53186
53211
|
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
|
|
@@ -53237,7 +53262,7 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
53237
53262
|
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
|
|
53238
53263
|
children: [
|
|
53239
53264
|
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
|
|
53240
|
-
color: isSelected ? moveMode ? "
|
|
53265
|
+
color: isSelected ? moveMode ? "blue" : "green" : undefined,
|
|
53241
53266
|
children: [
|
|
53242
53267
|
isSelected ? moveMode ? "◆ " : "▶ " : " ",
|
|
53243
53268
|
` ${index + 1}. ${displayText || getWidgetDisplay(widget)}`
|
|
@@ -53422,7 +53447,7 @@ var MainMenu = ({ onSelect, isClaudeInstalled, hasChanges, initialSelection = 0,
|
|
|
53422
53447
|
{ label: "\uD83D\uDCBB Terminal Options", value: "terminalConfig", selectable: true },
|
|
53423
53448
|
{ label: "\uD83C\uDF10 Global Overrides", value: "globalOverrides", selectable: true },
|
|
53424
53449
|
{ label: "", value: "_gap2", selectable: false },
|
|
53425
|
-
{ label: isClaudeInstalled ? "\uD83D\
|
|
53450
|
+
{ label: isClaudeInstalled ? "\uD83D\uDD0C Uninstall from Claude Code" : "\uD83D\uDCE6 Install to Claude Code", value: "install", selectable: true }
|
|
53426
53451
|
];
|
|
53427
53452
|
if (hasChanges) {
|
|
53428
53453
|
menuItems.push({ label: "\uD83D\uDCBE Save & Exit", value: "save", selectable: true }, { label: "❌ Exit without saving", value: "exit", selectable: true });
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccstatusline",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "A customizable status line formatter for Claude Code CLI",
|
|
5
5
|
"module": "src/ccstatusline.ts",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"bin":
|
|
7
|
+
"bin": {
|
|
8
|
+
"ccstatusline": "dist/ccstatusline.js"
|
|
9
|
+
},
|
|
8
10
|
"files": [
|
|
9
11
|
"dist/"
|
|
10
12
|
],
|
|
@@ -13,6 +15,7 @@
|
|
|
13
15
|
"statusline": "bun run src/ccstatusline.ts",
|
|
14
16
|
"patch": "patch-package",
|
|
15
17
|
"build": "bun run patch && rm -rf dist/* && bun build src/ccstatusline.ts --target=node --outfile=dist/ccstatusline.js --target-version=14",
|
|
18
|
+
"postbuild": "bun run scripts/replace-version.ts",
|
|
16
19
|
"prepublishOnly": "bun run build",
|
|
17
20
|
"lint": "bun tsc --noEmit; eslint . --config eslint.config.js --max-warnings=999999 --fix"
|
|
18
21
|
},
|