@babarot/c-c-statusline 0.2.5 → 0.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.
- package/README.md +124 -35
- package/bin/install.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# c-c-statusline
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
[](https://github.com/babarot/c-c-statusline/actions/workflows/test.yml)
|
|
5
4
|
|
|
6
5
|
A Deno-powered status line for Claude Code CLI.
|
|
@@ -20,7 +19,7 @@ curl -fsSL https://raw.githubusercontent.com/babarot/c-c-statusline/main/bin/ins
|
|
|
20
19
|
# npx
|
|
21
20
|
npx @babarot/c-c-statusline
|
|
22
21
|
|
|
23
|
-
#
|
|
22
|
+
# deno
|
|
24
23
|
deno run -A https://raw.githubusercontent.com/babarot/c-c-statusline/main/bin/install.ts
|
|
25
24
|
```
|
|
26
25
|
|
|
@@ -33,25 +32,47 @@ Generate `~/.claude/statusline.yaml` with defaults:
|
|
|
33
32
|
```bash
|
|
34
33
|
# After install
|
|
35
34
|
~/.claude/c-c-statusline --init-config
|
|
35
|
+
```
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
Or during install:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# curl
|
|
41
|
+
curl -fsSL https://raw.githubusercontent.com/babarot/c-c-statusline/main/bin/install.sh | bash -s -- --init-config
|
|
42
|
+
|
|
43
|
+
# npx
|
|
44
|
+
npx @babarot/c-c-statusline --init-config
|
|
45
|
+
|
|
46
|
+
# deno
|
|
47
|
+
deno run -A https://raw.githubusercontent.com/babarot/c-c-statusline/main/bin/install.ts --init-config
|
|
40
48
|
```
|
|
41
49
|
|
|
42
50
|
Then edit to your liking:
|
|
43
51
|
|
|
44
52
|
```yaml
|
|
45
53
|
# ~/.claude/statusline.yaml
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
theme: tokyo-night-storm
|
|
55
|
+
|
|
56
|
+
# Layout: controls which items appear on each line and their order.
|
|
57
|
+
# Items not listed here are hidden. Remove an item to hide it.
|
|
58
|
+
lines:
|
|
59
|
+
- [model, context, git, duration, effort, vim, update]
|
|
60
|
+
- [usage]
|
|
61
|
+
|
|
62
|
+
# Per-item options
|
|
63
|
+
items:
|
|
64
|
+
context:
|
|
65
|
+
format: 'ctx {used}/{total} ({pct}%)'
|
|
66
|
+
git:
|
|
67
|
+
path-style: short
|
|
68
|
+
# symbols:
|
|
69
|
+
# stash: "-"
|
|
70
|
+
# untracked: "?"
|
|
71
|
+
vim:
|
|
72
|
+
mode: auto
|
|
73
|
+
usage:
|
|
74
|
+
bar-style: block
|
|
75
|
+
time-style: relative
|
|
55
76
|
```
|
|
56
77
|
|
|
57
78
|
`settings.json` stays clean — no flags in the command:
|
|
@@ -71,8 +92,16 @@ options:
|
|
|
71
92
|
CLI flags override config file values. Pass flags during install to bake them into `settings.json`:
|
|
72
93
|
|
|
73
94
|
```bash
|
|
95
|
+
# curl
|
|
74
96
|
curl -fsSL https://raw.githubusercontent.com/babarot/c-c-statusline/main/bin/install.sh \
|
|
75
97
|
| bash -s -- --bar-style block --path-style short --theme tokyo-night
|
|
98
|
+
|
|
99
|
+
# npx
|
|
100
|
+
npx @babarot/c-c-statusline --bar-style block --path-style short --theme tokyo-night
|
|
101
|
+
|
|
102
|
+
# deno
|
|
103
|
+
deno run -A https://raw.githubusercontent.com/babarot/c-c-statusline/main/bin/install.ts \
|
|
104
|
+
--bar-style block --path-style short --theme tokyo-night
|
|
76
105
|
```
|
|
77
106
|
|
|
78
107
|
This writes the flags directly into the command:
|
|
@@ -87,17 +116,56 @@ This writes the flags directly into the command:
|
|
|
87
116
|
}
|
|
88
117
|
```
|
|
89
118
|
|
|
119
|
+
## Layout
|
|
120
|
+
|
|
121
|
+
The `lines` config controls which items appear and in what order. Each array is a display line:
|
|
122
|
+
|
|
123
|
+
```yaml
|
|
124
|
+
lines:
|
|
125
|
+
- [model, context, git, duration, effort, vim, update] # line 1
|
|
126
|
+
- [usage] # line 2+
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Available items:** `model`, `context`, `git`, `duration`, `effort`, `vim`, `update`, `usage`
|
|
130
|
+
|
|
131
|
+
- Items are rendered left-to-right within each line, separated by `│`
|
|
132
|
+
- Remove an item from `lines` to hide it
|
|
133
|
+
- Reorder items to change display order
|
|
134
|
+
- If `lines` is omitted, the default layout above is used
|
|
135
|
+
|
|
136
|
+
Examples:
|
|
137
|
+
|
|
138
|
+
```yaml
|
|
139
|
+
# Minimal: only git and usage
|
|
140
|
+
lines:
|
|
141
|
+
- [git, effort]
|
|
142
|
+
- [usage]
|
|
143
|
+
|
|
144
|
+
# Everything on one line (no rate limit bars)
|
|
145
|
+
lines:
|
|
146
|
+
- [model, context, git, duration, effort, vim, update, usage]
|
|
147
|
+
|
|
148
|
+
# Custom order
|
|
149
|
+
lines:
|
|
150
|
+
- [git, context, model]
|
|
151
|
+
- [usage]
|
|
152
|
+
```
|
|
153
|
+
|
|
90
154
|
## Options
|
|
91
155
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
|
95
|
-
|
|
96
|
-
| `theme` | See [Themes](#themes) | `default` | Color theme |
|
|
97
|
-
| `
|
|
98
|
-
| `
|
|
99
|
-
| `
|
|
100
|
-
| `git
|
|
156
|
+
Options are organized per-item under the `items` section, plus a global `theme`:
|
|
157
|
+
|
|
158
|
+
| Scope | Option | Values | Default | Description |
|
|
159
|
+
|---|---|---|---|---|
|
|
160
|
+
| global | `theme` | See [Themes](#themes) | `default` | Color theme |
|
|
161
|
+
| `items.usage` | `bar-style` | `dot`, `block`, `fill` | `dot` | Progress bar style |
|
|
162
|
+
| `items.usage` | `time-style` | `absolute`, `relative` | `absolute` | Reset time format |
|
|
163
|
+
| `items.git` | `path-style` | `parent`, `full`, `short`, `basename` | `parent` | Directory display style |
|
|
164
|
+
| `items.git` | `symbols` | Map | See [below](#git-symbols) | Override git status symbols |
|
|
165
|
+
| `items.context` | `format` | Format string | `ctx {used}/{total} ({pct}%)` | Context display format |
|
|
166
|
+
| `items.vim` | `mode` | `auto`, `always` | `auto` | Vim mode indicator behavior |
|
|
167
|
+
|
|
168
|
+
> **Legacy support:** The flat `options` format (e.g. `options.bar-style`) still works for backward compatibility. CLI flags (e.g. `--bar-style`) also continue to work and override config file values.
|
|
101
169
|
|
|
102
170
|
### bar-style
|
|
103
171
|
|
|
@@ -143,24 +211,40 @@ Use `{used}`, `{total}`, `{pct}`, `{compact}` placeholders.
|
|
|
143
211
|
| `--ctx-format '{pct}% compact:{compact}%'` | `14% compact:83%` |
|
|
144
212
|
| `--ctx-format '{used} of {total}'` | `28k of 200k` |
|
|
145
213
|
|
|
214
|
+
### model-name
|
|
215
|
+
|
|
216
|
+
To hide the model name, remove `model` from `lines`:
|
|
217
|
+
|
|
218
|
+
```yaml
|
|
219
|
+
lines:
|
|
220
|
+
- [context, git, duration, effort, vim, update] # no "model"
|
|
221
|
+
- [usage]
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
> Legacy: `--model-name off` and `options.model-name: "off"` still work.
|
|
225
|
+
|
|
146
226
|
### vim-mode
|
|
147
227
|
|
|
148
|
-
Shows the current Vim mode when Claude Code's Vim keybinding is enabled.
|
|
228
|
+
Shows the current Vim mode when Claude Code's Vim keybinding is enabled.
|
|
149
229
|
|
|
150
230
|
| Value | Behavior |
|
|
151
231
|
|---|---|
|
|
152
232
|
| `auto` | Show only in `NORMAL` mode (hides in `INSERT` to reduce noise) |
|
|
153
233
|
| `always` | Show in all modes (`NORMAL`, `INSERT`, etc.) |
|
|
154
|
-
| `off` | Never show |
|
|
155
234
|
|
|
156
|
-
|
|
235
|
+
To hide the vim indicator entirely, remove `vim` from `lines`. To control its behavior:
|
|
157
236
|
|
|
158
237
|
```yaml
|
|
159
238
|
# ~/.claude/statusline.yaml
|
|
160
|
-
|
|
161
|
-
vim
|
|
239
|
+
items:
|
|
240
|
+
vim:
|
|
241
|
+
mode: auto
|
|
162
242
|
```
|
|
163
243
|
|
|
244
|
+
Mode colors: `NORMAL` uses the theme's primary color, `INSERT` uses success (green).
|
|
245
|
+
|
|
246
|
+
> Legacy: `--vim-mode off` and `options.vim-mode: "off"` still work.
|
|
247
|
+
|
|
164
248
|
### Themes
|
|
165
249
|
|
|
166
250
|
Built-in color themes using 24-bit True Color (RGB). Each theme defines 8 semantic color roles (`primary`, `secondary`, `success`, `warning`, `caution`, `danger`, `muted`, `accent`).
|
|
@@ -201,17 +285,22 @@ Override any git status symbol. In the config file, use a map; with CLI flags, u
|
|
|
201
285
|
|
|
202
286
|
Config file:
|
|
203
287
|
```yaml
|
|
204
|
-
|
|
205
|
-
git
|
|
206
|
-
|
|
207
|
-
|
|
288
|
+
items:
|
|
289
|
+
git:
|
|
290
|
+
symbols:
|
|
291
|
+
stash: "-"
|
|
292
|
+
untracked: "?"
|
|
208
293
|
```
|
|
209
294
|
|
|
295
|
+
> Legacy: `options.git-symbols` also still works.
|
|
296
|
+
|
|
210
297
|
## What it shows
|
|
211
298
|
|
|
212
|
-
**Line 1
|
|
299
|
+
**Line 1** (default): Model name, context usage (tokens + %), directory, git status, session duration, effort level, vim mode, update notification
|
|
300
|
+
|
|
301
|
+
**Lines 2+** (default): Rate limit usage (current 5-hour window, weekly, extra credits when active)
|
|
213
302
|
|
|
214
|
-
|
|
303
|
+
All items can be reordered, shown, or hidden via the [`lines` config](#layout).
|
|
215
304
|
|
|
216
305
|
### Git status
|
|
217
306
|
|
|
@@ -247,7 +336,7 @@ curl -fsSL https://raw.githubusercontent.com/babarot/c-c-statusline/main/bin/ins
|
|
|
247
336
|
# npx
|
|
248
337
|
npx @babarot/c-c-statusline --uninstall
|
|
249
338
|
|
|
250
|
-
#
|
|
339
|
+
# deno
|
|
251
340
|
deno run -A https://raw.githubusercontent.com/babarot/c-c-statusline/main/bin/install.ts --uninstall
|
|
252
341
|
```
|
|
253
342
|
|
package/bin/install.js
CHANGED
|
@@ -261,6 +261,7 @@ if (argv.includes("--help") || argv.includes("-h")) {
|
|
|
261
261
|
--time-style <absolute|relative> Time format (default: absolute)
|
|
262
262
|
--ctx-format <format> Context display format
|
|
263
263
|
--vim-mode <auto|always|off> Vim mode display (default: auto)
|
|
264
|
+
--model-name <on|off> Model name display (default: on)
|
|
264
265
|
--git-symbols <key=val,...> Override git symbols
|
|
265
266
|
--init-config Generate ~/.claude/statusline.yaml
|
|
266
267
|
--uninstall Remove statusline
|
|
@@ -274,7 +275,7 @@ if (argv.includes("--uninstall")) {
|
|
|
274
275
|
} else {
|
|
275
276
|
const extraArgs = [];
|
|
276
277
|
const initConfig = argv.includes("--init-config");
|
|
277
|
-
const valueFlags = ["--bar-style", "--path-style", "--theme", "--time-style", "--ctx-format", "--vim-mode", "--git-symbols"];
|
|
278
|
+
const valueFlags = ["--bar-style", "--path-style", "--theme", "--time-style", "--ctx-format", "--vim-mode", "--model-name", "--git-symbols"];
|
|
278
279
|
for (let i = 0; i < argv.length; i++) {
|
|
279
280
|
if (argv[i] === "--init-config") continue;
|
|
280
281
|
if (valueFlags.includes(argv[i]) && argv[i + 1]) {
|
package/package.json
CHANGED