@promptctl/cc-candybar 1.22.0 → 1.23.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 +13 -9
- package/bin/cc-candybar +18 -6
- package/dist/index.mjs +89 -86
- package/package.json +6 -22
- package/src/daemon/acquire.ts +148 -12
- package/src/daemon/paths.ts +11 -0
- package/src/daemon/server.ts +6 -0
- package/src/index.ts +8 -6
- package/src/install/index.ts +207 -85
package/README.md
CHANGED
|
@@ -18,19 +18,19 @@ CCCandybar is a statusline renderer for [Claude Code](https://docs.anthropic.com
|
|
|
18
18
|
|
|
19
19
|
A background daemon caches git state, usage data, and per-session values across concurrent Claude Code sessions. The renderer connects to the daemon over a Unix socket, so every invocation is fast (~50ms budget) and stateful.
|
|
20
20
|
|
|
21
|
-
## Quick start
|
|
21
|
+
## Quick start
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
24
|
pnpm dlx @promptctl/cc-candybar@latest install
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
That single command:
|
|
27
|
+
That single command (re-run it any time to update to the latest release):
|
|
28
28
|
|
|
29
|
-
1.
|
|
30
|
-
2.
|
|
31
|
-
3. Writes the statusline
|
|
29
|
+
1. Stages the runtime at a stable path independent of any package-manager cache — `~/Library/Application Support/CCCandybar/` on macOS, `$XDG_DATA_HOME/cc-candybar/` on Linux — as `bin/cc-candybar` (the prebuilt native render binary for your platform, or a node entry where none exists) beside `dist/index.mjs` (the daemon + CLI bundle).
|
|
30
|
+
2. On macOS, builds `~/Applications/CCCandybarURLHandler.app` and registers the `cc-candybar://` URL scheme with Launch Services.
|
|
31
|
+
3. Writes the staged `bin/cc-candybar` path as the statusline command into `~/.claude/settings.json` (skipped with a notice if you've customized the command; `--force` overwrites).
|
|
32
32
|
|
|
33
|
-
Restart Claude Code. The statusline appears with the bundled default layout (directory,
|
|
33
|
+
Restart Claude Code. The statusline appears with the bundled default layout — an identity row (directory, gitaculous, toolbar) over a status row (model, context, cacheTimer, block, weekly). On macOS, Cmd-clicking clickable cells fires `cc-candybar://` URL verbs that the daemon dispatches (via the URL handler registered in step 2).
|
|
34
34
|
|
|
35
35
|
## Customization
|
|
36
36
|
|
|
@@ -117,21 +117,25 @@ The DSL config picks a base palette via `globals.palette` (e.g. `textual-dark`,
|
|
|
117
117
|
|
|
118
118
|
## Installation
|
|
119
119
|
|
|
120
|
-
Requires Node.js
|
|
120
|
+
Requires Node.js 20.19+ (within the 20.x line) or 22.12+, Claude Code, and Git 2.0+. For best display, install a [Nerd Font](https://www.nerdfonts.com/) so the powerline glyphs render correctly.
|
|
121
121
|
|
|
122
122
|
### Manual setup
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
Run the install once to stage the runtime, then point `~/.claude/settings.json` at the staged entry (this is also exactly what `install` writes):
|
|
125
125
|
|
|
126
126
|
```json
|
|
127
127
|
{
|
|
128
128
|
"statusLine": {
|
|
129
129
|
"type": "command",
|
|
130
|
-
"command": "
|
|
130
|
+
"command": "'/Users/you/Library/Application Support/CCCandybar/bin/cc-candybar'"
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
+
### Developing against a checkout
|
|
136
|
+
|
|
137
|
+
`just deploy` builds `dist/index.mjs` and stages the native binary at `bin/cc-candybar-native` — point your statusline command at that path. On a machine without cargo, `pnpm install && pnpm build` builds only the bundle — point your statusline at the committed `bin/cc-candybar` node entry instead. Either way the bar renders HEAD; the daemon watches the built bundle and respawns itself on rebuild.
|
|
138
|
+
|
|
135
139
|
### Config file
|
|
136
140
|
|
|
137
141
|
Customization lives in `.cc-candybar.json5`. See the [Customization](#customization) section above for the resolution order. Saved edits hot-reload — no restart needed.
|
package/bin/cc-candybar
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
#!/bin/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// The package's one committed entry point. Dynamic import is deliberate: this
|
|
3
|
+
// same file runs from two homes with two module systems — inside the npm
|
|
4
|
+
// package (nearest package.json says type:module, so the extensionless entry
|
|
5
|
+
// runs as ESM) and staged at the support dir with no package.json above it
|
|
6
|
+
// (so it runs as CommonJS) — and import() is the one construct that reaches
|
|
7
|
+
// the ESM bundle from either, resolving relative to this file no matter the cwd.
|
|
8
|
+
// [LAW:composability] No install scripts, no staging ritual — this works the
|
|
9
|
+
// moment any package manager lays the tarball on disk. The native fast-path
|
|
10
|
+
// binary is a deploy-time optimization staged by `cc-candybar install`
|
|
11
|
+
// (published) or `just install-rust` (source checkout, bin/cc-candybar-native).
|
|
12
|
+
import("../dist/index.mjs").catch((err) => {
|
|
13
|
+
console.error(
|
|
14
|
+
"cc-candybar: failed to load dist/index.mjs — " +
|
|
15
|
+
(err && err.message ? err.message : String(err)),
|
|
16
|
+
);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
});
|