claudeline 1.0.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/LICENSE +21 -0
- package/README.md +353 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1193 -0
- package/package.json +34 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Luca Silverentand
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
# claudeline
|
|
2
|
+
|
|
3
|
+
Customizable status line for [Claude Code](https://claude.ai/code). Display model info, git status, context usage, costs, and more in your terminal.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Install with a theme
|
|
9
|
+
npx claudeline --theme minimal --install
|
|
10
|
+
|
|
11
|
+
# Or with a custom format
|
|
12
|
+
npx claudeline "claude:model fs:dir git:branch" --install
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
That's it. Restart Claude Code and your status line will appear.
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# List available themes
|
|
21
|
+
npx claudeline --themes
|
|
22
|
+
|
|
23
|
+
# List all components
|
|
24
|
+
npx claudeline --list
|
|
25
|
+
|
|
26
|
+
# Preview what data is available
|
|
27
|
+
npx claudeline --preview
|
|
28
|
+
|
|
29
|
+
# Install to current project only
|
|
30
|
+
npx claudeline --theme powerline --install --project
|
|
31
|
+
|
|
32
|
+
# Uninstall
|
|
33
|
+
npx claudeline --uninstall
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Themes
|
|
37
|
+
|
|
38
|
+
| Theme | Format |
|
|
39
|
+
|-------|--------|
|
|
40
|
+
| `minimal` | `claude:model fs:dir` |
|
|
41
|
+
| `default` | `[claude:model] emoji:folder fs:dir if:git(sep:pipe emoji:branch git:branch git:status)` |
|
|
42
|
+
| `powerline` | `bold:cyan:claude:model sep:powerline fs:dir if:git(sep:powerline green:git:branch git:status)` |
|
|
43
|
+
| `full` | `[bold:cyan:claude:model] fs:home sep:arrow green:git:branch git:status sep:pipe ctx:bar ctx:percent sep:pipe cost:total` |
|
|
44
|
+
| `git` | `[claude:model] emoji:folder fs:dir sep:pipe emoji:branch git:branch git:status git:ahead-behind if:dirty(sep:pipe git:staged git:modified git:untracked)` |
|
|
45
|
+
| `tokens` | `claude:model sep:pipe ctx:emoji ctx:tokens sep:pipe cost:lines` |
|
|
46
|
+
| `dev` | `[fs:dir] git:branch sep:pipe env:node sep:pipe time:now` |
|
|
47
|
+
| `dashboard` | `[bold:claude:model] fs:dir sep:pipe git:branch git:status sep:pipe ctx:percent sep:pipe cost:total sep:pipe time:now` |
|
|
48
|
+
| `context-focus` | `claude:model sep:pipe ctx:bar sep:pipe ctx:tokens sep:pipe ctx:emoji` |
|
|
49
|
+
| `cost` | `claude:model sep:pipe cost:total sep:pipe cost:duration sep:pipe cost:lines-both` |
|
|
50
|
+
| `simple` | `claude:model fs:dir git:branch` |
|
|
51
|
+
| `compact` | `claude:model sep:slash fs:dir sep:slash git:branch` |
|
|
52
|
+
| `colorful` | `bold:magenta:claude:model sep:arrow cyan:fs:dir sep:arrow green:git:branch yellow:git:status sep:arrow blue:ctx:percent` |
|
|
53
|
+
|
|
54
|
+
## Format Syntax
|
|
55
|
+
|
|
56
|
+
Components use `type:key` format, separated by spaces:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
claude:model fs:dir git:branch
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Styling
|
|
63
|
+
|
|
64
|
+
Add color/style prefixes before any component:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
green:git:branch # green text
|
|
68
|
+
bold:cyan:claude:model # bold cyan text
|
|
69
|
+
bg-red:white:text:ERROR # white on red background
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Grouping
|
|
73
|
+
|
|
74
|
+
Wrap components in brackets to add literal brackets:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
[claude:model] # outputs: [Sonnet 4]
|
|
78
|
+
(fs:dir) # outputs: (myproject)
|
|
79
|
+
{git:branch} # outputs: {main}
|
|
80
|
+
<ctx:percent> # outputs: <45%>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Conditionals
|
|
84
|
+
|
|
85
|
+
Show components only when conditions are met:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
if:git(git:branch git:status) # only in git repos
|
|
89
|
+
if:dirty(text:UNCOMMITTED) # only when working tree is dirty
|
|
90
|
+
if:node(env:node) # only in Node.js projects
|
|
91
|
+
if:python(env:python) # only in Python projects
|
|
92
|
+
if:rust(emoji:rust) # only in Rust projects
|
|
93
|
+
if:go(emoji:go) # only in Go projects
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Separators
|
|
97
|
+
|
|
98
|
+
Use `sep:name` between components:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
claude:model sep:pipe fs:dir sep:arrow git:branch
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Available separators:
|
|
105
|
+
- `pipe` → ` | `
|
|
106
|
+
- `arrow` → ` → `
|
|
107
|
+
- `arrow-left` → ` ← `
|
|
108
|
+
- `chevron` → ` › `
|
|
109
|
+
- `chevron-left` → ` ‹ `
|
|
110
|
+
- `dot` → ` • `
|
|
111
|
+
- `dash` → ` - `
|
|
112
|
+
- `slash` → ` / `
|
|
113
|
+
- `colon` → `: `
|
|
114
|
+
- `double-colon` → ` :: `
|
|
115
|
+
- `tilde` → ` ~ `
|
|
116
|
+
- `double-pipe` → ` ‖ `
|
|
117
|
+
- `bullet` → ` ◦ `
|
|
118
|
+
- `diamond` → ` ◇ `
|
|
119
|
+
- `star` → ` ★ `
|
|
120
|
+
- `powerline` → ``
|
|
121
|
+
- `powerline-left` → ``
|
|
122
|
+
- `space` → ` `
|
|
123
|
+
- `none` → (empty)
|
|
124
|
+
|
|
125
|
+
## Components Reference
|
|
126
|
+
|
|
127
|
+
### Claude/Session
|
|
128
|
+
|
|
129
|
+
| Component | Description |
|
|
130
|
+
|-----------|-------------|
|
|
131
|
+
| `claude:model` | Model display name (e.g., "Sonnet 4") |
|
|
132
|
+
| `claude:model-id` | Model ID (e.g., "claude-sonnet-4") |
|
|
133
|
+
| `claude:model-letter` | First letter of model name |
|
|
134
|
+
| `claude:version` | Claude Code version |
|
|
135
|
+
| `claude:session` | Session ID (first 8 chars) |
|
|
136
|
+
| `claude:session-full` | Full session ID |
|
|
137
|
+
| `claude:style` | Output style name |
|
|
138
|
+
|
|
139
|
+
### Context Window
|
|
140
|
+
|
|
141
|
+
| Component | Description |
|
|
142
|
+
|-----------|-------------|
|
|
143
|
+
| `ctx:percent` | Usage percentage (e.g., "45%") |
|
|
144
|
+
| `ctx:remaining` | Remaining percentage |
|
|
145
|
+
| `ctx:tokens` | Used/total tokens (e.g., "50k/200k") |
|
|
146
|
+
| `ctx:in` | Input tokens |
|
|
147
|
+
| `ctx:out` | Output tokens |
|
|
148
|
+
| `ctx:size` | Context window size |
|
|
149
|
+
| `ctx:bar` | Progress bar `[████░░░░░░]` |
|
|
150
|
+
| `ctx:bar:N` | Progress bar with width N |
|
|
151
|
+
| `ctx:emoji` | Status emoji (🟢🟡🟠🔴) |
|
|
152
|
+
| `ctx:used-tokens` | Total used tokens |
|
|
153
|
+
|
|
154
|
+
### Cost/Usage
|
|
155
|
+
|
|
156
|
+
| Component | Description |
|
|
157
|
+
|-----------|-------------|
|
|
158
|
+
| `cost:total` | Total cost (e.g., "$0.42") |
|
|
159
|
+
| `cost:total-cents` | Cost in cents (e.g., "42¢") |
|
|
160
|
+
| `cost:duration` | Total session duration |
|
|
161
|
+
| `cost:api` | API call duration |
|
|
162
|
+
| `cost:lines` | Net lines changed (+/-) |
|
|
163
|
+
| `cost:added` | Lines added |
|
|
164
|
+
| `cost:removed` | Lines removed |
|
|
165
|
+
| `cost:lines-both` | Lines added and removed |
|
|
166
|
+
|
|
167
|
+
### File System
|
|
168
|
+
|
|
169
|
+
| Component | Description |
|
|
170
|
+
|-----------|-------------|
|
|
171
|
+
| `fs:dir` | Current directory name |
|
|
172
|
+
| `fs:path` | Full current path |
|
|
173
|
+
| `fs:project` | Project directory name |
|
|
174
|
+
| `fs:project-path` | Full project path |
|
|
175
|
+
| `fs:home` | Path with ~ for home |
|
|
176
|
+
| `fs:cwd` | Working directory |
|
|
177
|
+
| `fs:relative` | Path relative to project |
|
|
178
|
+
|
|
179
|
+
### Git
|
|
180
|
+
|
|
181
|
+
| Component | Description |
|
|
182
|
+
|-----------|-------------|
|
|
183
|
+
| `git:branch` | Current branch name |
|
|
184
|
+
| `git:status` | Clean (✓) or dirty (*) |
|
|
185
|
+
| `git:status-emoji` | ✨ or 📝 |
|
|
186
|
+
| `git:status-word` | "clean" or "dirty" |
|
|
187
|
+
| `git:ahead` | Commits ahead (↑N) |
|
|
188
|
+
| `git:behind` | Commits behind (↓N) |
|
|
189
|
+
| `git:ahead-behind` | Both ahead/behind |
|
|
190
|
+
| `git:stash` | Stash count (⚑N) |
|
|
191
|
+
| `git:staged` | Staged files (●N) |
|
|
192
|
+
| `git:modified` | Modified files (+N) |
|
|
193
|
+
| `git:untracked` | Untracked files (?N) |
|
|
194
|
+
| `git:dirty` | Combined dirty status |
|
|
195
|
+
| `git:commit` | Short commit hash |
|
|
196
|
+
| `git:commit-long` | Full commit hash |
|
|
197
|
+
| `git:tag` | Current tag |
|
|
198
|
+
| `git:remote` | Remote name |
|
|
199
|
+
| `git:repo` | Repository name |
|
|
200
|
+
| `git:user` | Git user name |
|
|
201
|
+
| `git:email` | Git user email |
|
|
202
|
+
| `git:remote-url` | Remote URL |
|
|
203
|
+
|
|
204
|
+
### Environment
|
|
205
|
+
|
|
206
|
+
| Component | Description |
|
|
207
|
+
|-----------|-------------|
|
|
208
|
+
| `env:node` | Node.js version |
|
|
209
|
+
| `env:node-short` | Node version without 'v' |
|
|
210
|
+
| `env:bun` | Bun version |
|
|
211
|
+
| `env:npm` | npm version |
|
|
212
|
+
| `env:pnpm` | pnpm version |
|
|
213
|
+
| `env:yarn` | Yarn version |
|
|
214
|
+
| `env:python` | Python version |
|
|
215
|
+
| `env:deno` | Deno version |
|
|
216
|
+
| `env:rust` | Rust version |
|
|
217
|
+
| `env:go` | Go version |
|
|
218
|
+
| `env:ruby` | Ruby version |
|
|
219
|
+
| `env:java` | Java version |
|
|
220
|
+
| `env:user` | Current username |
|
|
221
|
+
| `env:hostname` | Full hostname |
|
|
222
|
+
| `env:hostname-short` | Short hostname |
|
|
223
|
+
| `env:shell` | Current shell |
|
|
224
|
+
| `env:term` | Terminal type |
|
|
225
|
+
| `env:os` | Operating system |
|
|
226
|
+
| `env:arch` | CPU architecture |
|
|
227
|
+
| `env:os-release` | OS release |
|
|
228
|
+
| `env:cpus` | CPU count |
|
|
229
|
+
| `env:memory` | Total memory |
|
|
230
|
+
|
|
231
|
+
### Time
|
|
232
|
+
|
|
233
|
+
| Component | Description |
|
|
234
|
+
|-----------|-------------|
|
|
235
|
+
| `time:now` | Current time (HH:MM) |
|
|
236
|
+
| `time:seconds` | Time with seconds |
|
|
237
|
+
| `time:12h` | 12-hour format |
|
|
238
|
+
| `time:date` | Short date (Jan 15) |
|
|
239
|
+
| `time:full` | Full date (2024-01-15) |
|
|
240
|
+
| `time:iso` | ISO timestamp |
|
|
241
|
+
| `time:unix` | Unix timestamp |
|
|
242
|
+
| `time:weekday` | Short weekday |
|
|
243
|
+
| `time:weekday-long` | Full weekday |
|
|
244
|
+
| `time:month` | Short month |
|
|
245
|
+
| `time:month-long` | Full month |
|
|
246
|
+
| `time:year` | Year |
|
|
247
|
+
| `time:day` | Day of month |
|
|
248
|
+
| `time:hour` | Hour (24h) |
|
|
249
|
+
| `time:minute` | Minute |
|
|
250
|
+
| `time:elapsed` | Session elapsed time |
|
|
251
|
+
|
|
252
|
+
### Emojis
|
|
253
|
+
|
|
254
|
+
Use `emoji:name` for any of these:
|
|
255
|
+
|
|
256
|
+
**Files:** `folder` 📁, `file` 📄, `home` 🏠
|
|
257
|
+
|
|
258
|
+
**Git:** `branch` 🌿, `commit` 📝, `merge` 🔀, `tag` 🏷️, `stash` 📦
|
|
259
|
+
|
|
260
|
+
**Status:** `check` ✓, `x` ✗, `warn` ⚠, `error` ❌, `success` ✅, `info` ℹ
|
|
261
|
+
|
|
262
|
+
**Decorative:** `star` ★, `fire` 🔥, `rocket` 🚀, `sparkle` ✨, `lightning` ⚡, `heart` ❤, `diamond` ◆, `circle` ●, `square` ■, `triangle` ▲
|
|
263
|
+
|
|
264
|
+
**Tech:** `node` ⬢, `python` 🐍, `rust` 🦀, `go` 🐹, `ruby` 💎, `java` ☕, `docker` 🐳
|
|
265
|
+
|
|
266
|
+
**Indicators:** `green` 🟢, `yellow` 🟡, `orange` 🟠, `red` 🔴
|
|
267
|
+
|
|
268
|
+
**Arrows:** `up` ↑, `down` ↓, `left` ←, `right` →
|
|
269
|
+
|
|
270
|
+
**Other:** `clock` 🕐, `calendar` 📅, `money` 💰
|
|
271
|
+
|
|
272
|
+
### Colors & Styles
|
|
273
|
+
|
|
274
|
+
Prefix any component with styles:
|
|
275
|
+
|
|
276
|
+
**Colors:** `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`, `gray`
|
|
277
|
+
|
|
278
|
+
**Bright colors:** `bright-red`, `bright-green`, `bright-yellow`, `bright-blue`, `bright-magenta`, `bright-cyan`, `bright-white`
|
|
279
|
+
|
|
280
|
+
**Backgrounds:** `bg-black`, `bg-red`, `bg-green`, `bg-yellow`, `bg-blue`, `bg-magenta`, `bg-cyan`, `bg-white`
|
|
281
|
+
|
|
282
|
+
**Styles:** `bold`, `dim`, `italic`, `underline`, `inverse`, `strikethrough`
|
|
283
|
+
|
|
284
|
+
Chain multiple styles: `bold:green:underline:git:branch`
|
|
285
|
+
|
|
286
|
+
### Custom Text
|
|
287
|
+
|
|
288
|
+
Use `text:value` for literal text:
|
|
289
|
+
|
|
290
|
+
```
|
|
291
|
+
text:Hello text:World
|
|
292
|
+
text:"Hello World" # with spaces
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## CLI Options
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
-i, --install Install to ~/.claude/settings.json
|
|
299
|
+
-u, --uninstall Remove statusline configuration
|
|
300
|
+
--project Use project .claude/ instead of global
|
|
301
|
+
-t, --theme <name> Use a preset theme
|
|
302
|
+
-l, --list List all components
|
|
303
|
+
--themes List all themes
|
|
304
|
+
-p, --preview Show sample JSON data
|
|
305
|
+
--no-emoji Disable emojis
|
|
306
|
+
--no-color Disable colors
|
|
307
|
+
--use-bunx Force bunx in command
|
|
308
|
+
--use-npx Force npx in command
|
|
309
|
+
--global-install Use claudeline directly (global install)
|
|
310
|
+
-V, --version Show version
|
|
311
|
+
-h, --help Show help
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
## How It Works
|
|
315
|
+
|
|
316
|
+
When you run `--install`, claudeline updates your `~/.claude/settings.json`:
|
|
317
|
+
|
|
318
|
+
```json
|
|
319
|
+
{
|
|
320
|
+
"statusLine": {
|
|
321
|
+
"type": "command",
|
|
322
|
+
"command": "npx claudeline run 'claude:model fs:dir'",
|
|
323
|
+
"padding": 0
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Claude Code pipes session data as JSON to this command, and claudeline outputs the formatted status line.
|
|
329
|
+
|
|
330
|
+
## Testing
|
|
331
|
+
|
|
332
|
+
Test your format without installing:
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
# Get sample data
|
|
336
|
+
npx claudeline --preview
|
|
337
|
+
|
|
338
|
+
# Test with sample data
|
|
339
|
+
echo '{"model":{"display_name":"Sonnet 4"}}' | npx claudeline run "claude:model fs:dir"
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
## Package Managers
|
|
343
|
+
|
|
344
|
+
claudeline auto-detects bun vs node and uses the appropriate runner:
|
|
345
|
+
|
|
346
|
+
- Running with `bun` → installs `bunx claudeline run ...`
|
|
347
|
+
- Running with `node` → installs `npx claudeline run ...`
|
|
348
|
+
|
|
349
|
+
Override with `--use-bunx` or `--use-npx`.
|
|
350
|
+
|
|
351
|
+
## License
|
|
352
|
+
|
|
353
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|