@owloops/claude-powerline 1.0.0 → 1.1.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 +133 -124
- package/dist/index.js +887 -237
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,67 +1,27 @@
|
|
|
1
1
|
# Claude Powerline
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A vim-style powerline statusline for Claude Code with real-time usage tracking, git integration, and custom themes.
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|

|
|
7
|
-
[](https://www.npmjs.com/package/claude-powerline)
|
|
7
|
+
[](https://www.npmjs.com/package/@owloops/claude-powerline)
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
|
-
- **Vim-style powerline**
|
|
12
|
-
- **Real-time
|
|
13
|
-
- **Git integration**
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
- **Font management** - Built-in powerline fonts installer
|
|
18
|
-
|
|
19
|
-
## Screenshots
|
|
20
|
-
|
|
21
|
-
### Default Theme
|
|
22
|
-
|
|
23
|
-

|
|
24
|
-
|
|
25
|
-
### Dark Theme
|
|
26
|
-
|
|
27
|
-

|
|
11
|
+
- **Vim-style powerline** with proper arrows and segments
|
|
12
|
+
- **Real-time usage tracking** with costs, tokens, and session blocks
|
|
13
|
+
- **Git integration** with branch, status, ahead/behind counts
|
|
14
|
+
- **Custom themes** with full color control
|
|
15
|
+
- **Budget monitoring** with percentage warnings
|
|
16
|
+
- **Flexible configuration** via JSON files and environment variables
|
|
28
17
|
|
|
29
18
|
## Installation
|
|
30
19
|
|
|
31
|
-
### npm (Recommended)
|
|
32
|
-
|
|
33
20
|
```bash
|
|
34
|
-
npm install -g claude-powerline
|
|
21
|
+
npm install -g @owloops/claude-powerline
|
|
22
|
+
claude-powerline --install-fonts # Install powerline fonts
|
|
35
23
|
```
|
|
36
24
|
|
|
37
|
-
### Install powerline fonts
|
|
38
|
-
|
|
39
|
-
For proper arrow display, install powerline fonts:
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
claude-powerline --install-fonts
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
After installation, set your terminal font to:
|
|
46
|
-
|
|
47
|
-
- Source Code Pro Powerline
|
|
48
|
-
- DejaVu Sans Mono Powerline
|
|
49
|
-
- Ubuntu Mono Powerline
|
|
50
|
-
|
|
51
|
-
### From source
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
git clone https://github.com/user/claude-powerline.git
|
|
55
|
-
cd claude-powerline
|
|
56
|
-
npm install
|
|
57
|
-
npm run build
|
|
58
|
-
npm install -g .
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Usage
|
|
62
|
-
|
|
63
|
-
### Claude Code Integration
|
|
64
|
-
|
|
65
25
|
Add to your Claude Code `settings.json`:
|
|
66
26
|
|
|
67
27
|
```json
|
|
@@ -74,118 +34,167 @@ Add to your Claude Code `settings.json`:
|
|
|
74
34
|
}
|
|
75
35
|
```
|
|
76
36
|
|
|
77
|
-
|
|
37
|
+
## Usage
|
|
78
38
|
|
|
79
39
|
```bash
|
|
80
|
-
#
|
|
40
|
+
# Basic usage (single line with directory, git, model, session, block)
|
|
81
41
|
claude-powerline
|
|
82
42
|
|
|
83
|
-
# Dark theme
|
|
84
|
-
claude-powerline --dark
|
|
43
|
+
# Dark theme
|
|
44
|
+
claude-powerline --theme=dark
|
|
85
45
|
|
|
86
|
-
#
|
|
87
|
-
claude-powerline --
|
|
46
|
+
# Show tokens instead of costs
|
|
47
|
+
claude-powerline --usage=tokens
|
|
88
48
|
|
|
89
|
-
# Show
|
|
90
|
-
claude-powerline --
|
|
49
|
+
# Show token breakdown (input/output)
|
|
50
|
+
claude-powerline --usage=breakdown
|
|
51
|
+
|
|
52
|
+
# Set budgets with warnings
|
|
53
|
+
claude-powerline --daily-budget=50 --session-budget=20
|
|
91
54
|
```
|
|
92
55
|
|
|
93
|
-
|
|
56
|
+
## Screenshots
|
|
94
57
|
|
|
95
|
-
|
|
96
|
-
echo '{
|
|
97
|
-
"model": {"id": "claude-sonnet", "display_name": "Claude 3.5 Sonnet"},
|
|
98
|
-
"workspace": {"current_dir": "/path/to/project", "project_dir": "/path/to/project"},
|
|
99
|
-
"session_id": "abc123",
|
|
100
|
-
"cwd": "/path/to/project",
|
|
101
|
-
"transcript_path": "/path/to/transcript.json",
|
|
102
|
-
"hook_event_name": "Status"
|
|
103
|
-
}' | claude-powerline
|
|
104
|
-
```
|
|
58
|
+
### Dark Theme (Default)
|
|
105
59
|
|
|
106
|
-
|
|
60
|
+

|
|
107
61
|
|
|
108
|
-
|
|
62
|
+
### Light Theme
|
|
109
63
|
|
|
110
|
-
|
|
111
|
-
|---------|-------------|---------|
|
|
112
|
-
| **Directory** | Current working directory or project name | `myproject` |
|
|
113
|
-
| **Git Branch** | Branch with status and ahead/behind | `master ✓ ↑2` |
|
|
114
|
-
| **Model** | Current Claude model | `Claude 3.5 Sonnet` |
|
|
115
|
-
| **Session** | Current session usage cost | `Session $0.05` |
|
|
116
|
-
| **Daily** | Total daily usage cost | `Today $14.82` |
|
|
64
|
+

|
|
117
65
|
|
|
118
|
-
|
|
66
|
+
## Default Segments
|
|
119
67
|
|
|
120
|
-
|
|
121
|
-
- `●` **Dirty** - Uncommitted changes present
|
|
122
|
-
- `⚠` **Conflicts** - Merge conflicts detected
|
|
123
|
-
- `↑3` **Ahead** - 3 commits ahead of remote
|
|
124
|
-
- `↓2` **Behind** - 2 commits behind remote
|
|
68
|
+
By default displays: `Directory | Git Branch | Model | Session Usage | Block Info`
|
|
125
69
|
|
|
126
|
-
###
|
|
70
|
+
### Usage Display Types
|
|
127
71
|
|
|
128
|
-
|
|
72
|
+
- **cost**: Show dollar amounts (`$0.05`)
|
|
73
|
+
- **tokens**: Show token counts (`1.2K tokens`)
|
|
74
|
+
- **both**: Show both (`$0.05 (1.2K tokens)`)
|
|
75
|
+
- **breakdown**: Show detailed token breakdown (`1.2Kin + 0.8Kout + 1.5Kcached`)
|
|
129
76
|
|
|
130
|
-
|
|
131
|
-
- Displays `N/A` if session not found
|
|
132
|
-
- Shows `<$0.01` for small amounts
|
|
77
|
+
### Git Status Indicators
|
|
133
78
|
|
|
134
|
-
|
|
79
|
+
- `✓` Clean, `●` Dirty, `⚠` Conflicts
|
|
80
|
+
- `↑3` Ahead, `↓2` Behind remote
|
|
135
81
|
|
|
136
|
-
|
|
82
|
+
### Budget Indicators
|
|
137
83
|
|
|
138
|
-
-
|
|
139
|
-
-
|
|
84
|
+
- `25%` Normal (under 50%)
|
|
85
|
+
- `+75%` Moderate (50-79%)
|
|
86
|
+
- `!85%` Warning (80%+, configurable)
|
|
140
87
|
|
|
141
|
-
|
|
88
|
+
## Configuration
|
|
142
89
|
|
|
143
|
-
|
|
144
|
-
- Optimized for dark terminals
|
|
90
|
+
Generate config template:
|
|
145
91
|
|
|
146
|
-
|
|
92
|
+
```bash
|
|
93
|
+
claude-powerline --print-default-config > ~/.claude/claude-powerline.json
|
|
94
|
+
```
|
|
147
95
|
|
|
148
|
-
|
|
149
|
-
- Claude Code with statusline hook support
|
|
150
|
-
- Terminal with powerline font support (use `--install-fonts`)
|
|
151
|
-
- Git (optional, for git integration)
|
|
96
|
+
Config files loaded in priority order:
|
|
152
97
|
|
|
153
|
-
|
|
98
|
+
1. CLI arguments (`--theme`, `--usage`, `--config`)
|
|
99
|
+
2. Environment variables (`CLAUDE_POWERLINE_THEME`, `CLAUDE_POWERLINE_USAGE_TYPE`, `CLAUDE_POWERLINE_CONFIG`)
|
|
100
|
+
3. `./.claude-powerline.json` (project)
|
|
101
|
+
4. `~/.claude/claude-powerline.json` (user)
|
|
102
|
+
5. `~/.config/claude-powerline/config.json` (XDG)
|
|
154
103
|
|
|
155
|
-
|
|
156
|
-
# Install dependencies
|
|
157
|
-
npm install
|
|
104
|
+
### Enable Additional Segments
|
|
158
105
|
|
|
159
|
-
|
|
160
|
-
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"display": {
|
|
109
|
+
"lines": [
|
|
110
|
+
{
|
|
111
|
+
"segments": {
|
|
112
|
+
"directory": { "enabled": true },
|
|
113
|
+
"git": { "enabled": true, "showSha": true },
|
|
114
|
+
"model": { "enabled": true },
|
|
115
|
+
"session": { "enabled": true, "type": "tokens" },
|
|
116
|
+
"today": { "enabled": true, "type": "tokens" },
|
|
117
|
+
"block": { "enabled": true, "type": "cost" },
|
|
118
|
+
"tmux": { "enabled": true }
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
161
125
|
|
|
162
|
-
|
|
163
|
-
npm test
|
|
126
|
+
### Multi-line Layout (Optional)
|
|
164
127
|
|
|
165
|
-
|
|
166
|
-
npm run lint
|
|
128
|
+
To prevent segment cutoff, configure multiple lines:
|
|
167
129
|
|
|
168
|
-
|
|
169
|
-
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"display": {
|
|
133
|
+
"lines": [
|
|
134
|
+
{
|
|
135
|
+
"segments": {
|
|
136
|
+
"directory": { "enabled": true },
|
|
137
|
+
"git": { "enabled": true },
|
|
138
|
+
"model": { "enabled": true }
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"segments": {
|
|
143
|
+
"session": { "enabled": true, "type": "tokens" },
|
|
144
|
+
"today": { "enabled": true, "type": "tokens" },
|
|
145
|
+
"block": { "enabled": true, "type": "cost" },
|
|
146
|
+
"tmux": { "enabled": true }
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
}
|
|
170
152
|
```
|
|
171
153
|
|
|
172
|
-
|
|
154
|
+
### Custom Theme
|
|
173
155
|
|
|
174
|
-
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"theme": "custom",
|
|
159
|
+
"colors": {
|
|
160
|
+
"custom": {
|
|
161
|
+
"directory": { "bg": "#ff6600", "fg": "#ffffff" },
|
|
162
|
+
"git": { "bg": "#0066cc", "fg": "#ffffff" },
|
|
163
|
+
"model": { "bg": "#9900cc", "fg": "#ffffff" },
|
|
164
|
+
"session": { "bg": "#cc0099", "fg": "#ffffff" },
|
|
165
|
+
"today": { "bg": "#00cc66", "fg": "#000000" },
|
|
166
|
+
"block": { "bg": "#cc6600", "fg": "#ffffff" },
|
|
167
|
+
"tmux": { "bg": "#228b22", "fg": "#ffffff" }
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"budget": {
|
|
171
|
+
"session": { "warningThreshold": 80 },
|
|
172
|
+
"today": { "amount": 50, "warningThreshold": 80 }
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Environment Variables
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
export CLAUDE_POWERLINE_THEME=dark
|
|
181
|
+
export CLAUDE_POWERLINE_USAGE_TYPE=tokens
|
|
182
|
+
export CLAUDE_POWERLINE_CONFIG=/path/to/config.json
|
|
183
|
+
```
|
|
175
184
|
|
|
176
|
-
|
|
177
|
-
2. Restart terminal and set font to a powerline font
|
|
178
|
-
3. Ensure terminal supports Unicode
|
|
185
|
+
## Requirements
|
|
179
186
|
|
|
180
|
-
|
|
187
|
+
- Node.js ≥ 18.0.0
|
|
188
|
+
- Terminal with powerline font support
|
|
189
|
+
- Git (optional, for git integration)
|
|
190
|
+
|
|
191
|
+
## Troubleshooting
|
|
181
192
|
|
|
182
|
-
|
|
183
|
-
2. Check session ID matches current Claude session
|
|
193
|
+
**Arrows not displaying?** Run `claude-powerline --install-fonts` and set terminal font to a powerline-patched font.
|
|
184
194
|
|
|
185
|
-
**
|
|
195
|
+
**Cost showing N/A?** Verify [ccusage](https://github.com/ryanschneider/ccusage) is working and session ID matches.
|
|
186
196
|
|
|
187
|
-
|
|
188
|
-
2. Check git is installed and in PATH
|
|
197
|
+
**Tmux segment not showing?** Ensure you're in a tmux session and enable it in config.
|
|
189
198
|
|
|
190
199
|
## Contributing
|
|
191
200
|
|