@promptctl/cc-candybar 1.25.0 → 1.26.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/dist/index.mjs +86 -80
- package/package.json +5 -5
- package/src/help-text.ts +59 -0
- package/src/index.ts +2 -47
- package/src/install/index.ts +18 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptctl/cc-candybar",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"description": "Statusline renderer for Claude Code — a JSON5-configurable DSL with daemon-cached data sources, byte-clean palette-aware composition, and OSC8 click verbs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -91,9 +91,9 @@
|
|
|
91
91
|
"mobx": "^6.15.0"
|
|
92
92
|
},
|
|
93
93
|
"optionalDependencies": {
|
|
94
|
-
"@promptctl/cc-candybar-darwin-arm64": "1.
|
|
95
|
-
"@promptctl/cc-candybar-darwin-x64": "1.
|
|
96
|
-
"@promptctl/cc-candybar-linux-x64": "1.
|
|
97
|
-
"@promptctl/cc-candybar-linux-arm64": "1.
|
|
94
|
+
"@promptctl/cc-candybar-darwin-arm64": "1.26.0",
|
|
95
|
+
"@promptctl/cc-candybar-darwin-x64": "1.26.0",
|
|
96
|
+
"@promptctl/cc-candybar-linux-x64": "1.26.0",
|
|
97
|
+
"@promptctl/cc-candybar-linux-arm64": "1.26.0"
|
|
98
98
|
}
|
|
99
99
|
}
|
package/src/help-text.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { DISCLOSURE_GLYPH_CLOSED } from "./config/disclosure";
|
|
2
|
+
|
|
3
|
+
// [LAW:effects-at-boundaries] Pure data, no I/O — index.ts owns the console.log
|
|
4
|
+
// effect. Kept as its own module so the text is importable (and testable) without
|
|
5
|
+
// pulling in index.ts's top-level `main()` call.
|
|
6
|
+
// [LAW:one-source-of-truth] The disclosure glyph comes from config/disclosure.ts
|
|
7
|
+
// (the same constant the theme/look picker itself renders with), so this text
|
|
8
|
+
// can't drift from what a user actually sees on the bar.
|
|
9
|
+
export const HELP_TEXT = `
|
|
10
|
+
cc-candybar - Beautiful powerline statusline for Claude Code
|
|
11
|
+
|
|
12
|
+
Usage: cc-candybar [options]
|
|
13
|
+
|
|
14
|
+
Standalone Commands:
|
|
15
|
+
-h, --help Show this help
|
|
16
|
+
|
|
17
|
+
Debugging:
|
|
18
|
+
CC_CANDYBAR_DEBUG=1 Enable debug logging for troubleshooting
|
|
19
|
+
|
|
20
|
+
Configuration:
|
|
21
|
+
Layout and segment options are defined in .cc-candybar.json5 (place in your
|
|
22
|
+
project dir, cwd, or ~/.config/cc-candybar/config.json5). Use CC_CANDYBAR_CONFIG
|
|
23
|
+
to point at a specific file. See the default config for all available options:
|
|
24
|
+
node dist/index.mjs debug --project-dir . --cwd .
|
|
25
|
+
|
|
26
|
+
The bundled default bar ships a clickable theme/look picker — no config
|
|
27
|
+
needed. Click 🎨 <theme> ${DISCLOSURE_GLYPH_CLOSED} or ◐ <look> ${DISCLOSURE_GLYPH_CLOSED} on the bar to
|
|
28
|
+
switch palettes.
|
|
29
|
+
|
|
30
|
+
Subcommands:
|
|
31
|
+
install One-shot setup: stages the runtime (native render
|
|
32
|
+
binary + dist bundle) at a stable path, creates the
|
|
33
|
+
URL handler app + cc-candybar:// scheme (macOS), and
|
|
34
|
+
writes the staged entry as the statusLine command in
|
|
35
|
+
~/.claude/settings.json. Re-run to update.
|
|
36
|
+
install-url-handler Just stage the runtime and create + register the URL
|
|
37
|
+
handler app (macOS only).
|
|
38
|
+
url-handle URL Internal — invoked by the URL handler app on
|
|
39
|
+
cmd-click. Parses cc-candybar://<verb>/<value> and
|
|
40
|
+
dispatches (currently: copy to clipboard).
|
|
41
|
+
daemon-stats [--json] Query the running daemon for runtime stats:
|
|
42
|
+
uptime, RSS, cache hit rates, watcher count,
|
|
43
|
+
request totals. Does not spawn a daemon.
|
|
44
|
+
|
|
45
|
+
Config tooling:
|
|
46
|
+
check [config-file] Validate a config on the full render pipeline (parse
|
|
47
|
+
→ merge → validate → register → render) with no
|
|
48
|
+
daemon. With no path, checks the same file the daemon
|
|
49
|
+
would load from here. Exit 0 clean (warnings on
|
|
50
|
+
stderr), 1 invalid, 2 unreadable. "lint" is an alias.
|
|
51
|
+
schema Print the JSON Schema for the config file shape
|
|
52
|
+
(.cc-candybar.json5). Point an editor's $schema at it
|
|
53
|
+
for autocomplete + structural validation.
|
|
54
|
+
vars [--json] Declared variables: source kind, value, last error.
|
|
55
|
+
segments [--json] Segment templates and their last rendered output.
|
|
56
|
+
config [--json] The effective merged config. (All three query the
|
|
57
|
+
running daemon; none spawn one.)
|
|
58
|
+
|
|
59
|
+
`;
|
package/src/index.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { runSchema } from "./config/cli";
|
|
|
15
15
|
import { runCheck } from "./check";
|
|
16
16
|
import { obtainDaemonKick } from "./daemon/acquire";
|
|
17
17
|
import { planOutcome } from "./render/outcome-plan";
|
|
18
|
+
import { HELP_TEXT } from "./help-text";
|
|
18
19
|
|
|
19
20
|
// Read terminal width from the live shell context (no subprocess). Returns
|
|
20
21
|
// undefined when nothing reliable is available; the daemon falls back to its
|
|
@@ -36,53 +37,7 @@ function detectTermCols(): number | undefined {
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
function showHelpText(): void {
|
|
39
|
-
console.log(
|
|
40
|
-
cc-candybar - Beautiful powerline statusline for Claude Code
|
|
41
|
-
|
|
42
|
-
Usage: cc-candybar [options]
|
|
43
|
-
|
|
44
|
-
Standalone Commands:
|
|
45
|
-
-h, --help Show this help
|
|
46
|
-
|
|
47
|
-
Debugging:
|
|
48
|
-
CC_CANDYBAR_DEBUG=1 Enable debug logging for troubleshooting
|
|
49
|
-
|
|
50
|
-
Configuration:
|
|
51
|
-
Layout and segment options are defined in .cc-candybar.json5 (place in your
|
|
52
|
-
project dir, cwd, or ~/.config/cc-candybar/config.json5). Use CC_CANDYBAR_CONFIG
|
|
53
|
-
to point at a specific file. See the default config for all available options:
|
|
54
|
-
node dist/index.mjs debug --project-dir . --cwd .
|
|
55
|
-
|
|
56
|
-
Subcommands:
|
|
57
|
-
install One-shot setup: stages the runtime (native render
|
|
58
|
-
binary + dist bundle) at a stable path, creates the
|
|
59
|
-
URL handler app + cc-candybar:// scheme (macOS), and
|
|
60
|
-
writes the staged entry as the statusLine command in
|
|
61
|
-
~/.claude/settings.json. Re-run to update.
|
|
62
|
-
install-url-handler Just stage the runtime and create + register the URL
|
|
63
|
-
handler app (macOS only).
|
|
64
|
-
url-handle URL Internal — invoked by the URL handler app on
|
|
65
|
-
cmd-click. Parses cc-candybar://<verb>/<value> and
|
|
66
|
-
dispatches (currently: copy to clipboard).
|
|
67
|
-
daemon-stats [--json] Query the running daemon for runtime stats:
|
|
68
|
-
uptime, RSS, cache hit rates, watcher count,
|
|
69
|
-
request totals. Does not spawn a daemon.
|
|
70
|
-
|
|
71
|
-
Config tooling:
|
|
72
|
-
check [config-file] Validate a config on the full render pipeline (parse
|
|
73
|
-
→ merge → validate → register → render) with no
|
|
74
|
-
daemon. With no path, checks the same file the daemon
|
|
75
|
-
would load from here. Exit 0 clean (warnings on
|
|
76
|
-
stderr), 1 invalid, 2 unreadable. "lint" is an alias.
|
|
77
|
-
schema Print the JSON Schema for the config file shape
|
|
78
|
-
(.cc-candybar.json5). Point an editor's $schema at it
|
|
79
|
-
for autocomplete + structural validation.
|
|
80
|
-
vars [--json] Declared variables: source kind, value, last error.
|
|
81
|
-
segments [--json] Segment templates and their last rendered output.
|
|
82
|
-
config [--json] The effective merged config. (All three query the
|
|
83
|
-
running daemon; none spawn one.)
|
|
84
|
-
|
|
85
|
-
`);
|
|
40
|
+
console.log(HELP_TEXT);
|
|
86
41
|
}
|
|
87
42
|
|
|
88
43
|
async function main(): Promise<void> {
|
package/src/install/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { tryClickViaDaemon } from "../daemon/client";
|
|
|
7
7
|
import type { PermanentOutcome } from "../daemon/client-transport";
|
|
8
8
|
import { obtainDaemonKick } from "../daemon/acquire";
|
|
9
9
|
import { URL_SCHEME, VERB_COPY } from "../click/wire";
|
|
10
|
+
import { DISCLOSURE_GLYPH_CLOSED } from "../config/disclosure";
|
|
10
11
|
|
|
11
12
|
// [LAW:one-source-of-truth] Replaced at build time by tsdown's `define` option
|
|
12
13
|
// from package.json — the single version stamp install output reports.
|
|
@@ -440,6 +441,21 @@ function formatPermanent(outcome: PermanentOutcome): string {
|
|
|
440
441
|
}
|
|
441
442
|
}
|
|
442
443
|
|
|
444
|
+
// [LAW:effects-at-boundaries] Pure string builder — runInstall performs the
|
|
445
|
+
// actual write. Kept separate so the message content is testable without
|
|
446
|
+
// driving the full (fs + Launch Services) install side effects.
|
|
447
|
+
// [LAW:one-source-of-truth] The disclosure glyph comes from config/disclosure.ts,
|
|
448
|
+
// the same constant the theme/look picker itself renders with, so this tip
|
|
449
|
+
// can't drift from what the bundled default bar actually shows.
|
|
450
|
+
function installSuccessMessage(): string {
|
|
451
|
+
return (
|
|
452
|
+
`✓ install complete.\n` +
|
|
453
|
+
` Restart Claude Code to pick up the new statusline.\n` +
|
|
454
|
+
` Tip: the default bar has a clickable theme/look picker — click\n` +
|
|
455
|
+
` 🎨 <theme> ${DISCLOSURE_GLYPH_CLOSED} or ◐ <look> ${DISCLOSURE_GLYPH_CLOSED} on the bar to switch palettes.\n`
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
|
|
443
459
|
export function runInstall(rendererArgs: string[]): void {
|
|
444
460
|
const force = rendererArgs.includes("--force");
|
|
445
461
|
const filteredArgs = rendererArgs.filter((a) => a !== "--force");
|
|
@@ -459,10 +475,7 @@ export function runInstall(rendererArgs: string[]): void {
|
|
|
459
475
|
|
|
460
476
|
updateClaudeSettings(staged.binPath, argsToInstall, force);
|
|
461
477
|
|
|
462
|
-
process.stdout.write(
|
|
463
|
-
process.stdout.write(
|
|
464
|
-
` Restart Claude Code to pick up the new statusline.\n`,
|
|
465
|
-
);
|
|
478
|
+
process.stdout.write(installSuccessMessage());
|
|
466
479
|
}
|
|
467
480
|
|
|
468
481
|
function updateClaudeSettings(
|
|
@@ -529,4 +542,5 @@ export const __test__ = {
|
|
|
529
542
|
resolveRenderEntry,
|
|
530
543
|
stageFile,
|
|
531
544
|
stagedEntryKind,
|
|
545
|
+
installSuccessMessage,
|
|
532
546
|
};
|