@owloops/claude-powerline 1.0.1 → 1.1.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Claude Powerline
2
2
 
3
- A beautiful vim-style powerline statusline for Claude Code with real-time cost tracking, git integration, and custom themes.
3
+ A vim-style powerline statusline for Claude Code with real-time usage tracking, git integration, and custom themes.
4
4
 
5
5
  ![Language:TypeScript](https://img.shields.io/static/v1?label=Language&message=TypeScript&color=blue&style=flat-square)
6
6
  ![License:MIT](https://img.shields.io/static/v1?label=License&message=MIT&color=blue&style=flat-square)
@@ -8,63 +8,20 @@ A beautiful vim-style powerline statusline for Claude Code with real-time cost t
8
8
 
9
9
  ## Features
10
10
 
11
- - **Vim-style powerline** - Beautiful segmented statusline with proper powerline arrows
12
- - **Real-time cost tracking** - Session and daily usage costs using [ccusage](https://github.com/ryanschneider/ccusage)
13
- - **Git integration** - Branch name, status indicators, ahead/behind counts
14
- - **Dual themes** - Light and dark color schemes optimized for different terminals
15
- - **Smart directory display** - Project-aware path showing with context
16
- - **Zero configuration** - Works out of the box with Claude Code hooks
17
- - **Font management** - Built-in powerline fonts installer
18
-
19
- ## Screenshots
20
-
21
- ### Default Theme
22
-
23
- ![Default colorful theme](images/powerline-default.png)
24
-
25
- ### Dark Theme
26
-
27
- ![Dark theme](images/powerline-dark.png)
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
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 any powerline-patched font. Popular choices include:
46
-
47
- - Source Code Pro Powerline
48
- - DejaVu Sans Mono Powerline
49
- - Ubuntu Mono Powerline
50
- - Fira Code Powerline
51
- - Hack Powerline
52
- - Or any other font with powerline symbols
53
-
54
- ### From source
55
-
56
- ```bash
57
- git clone https://github.com/Owloops/claude-powerline.git
58
- cd claude-powerline
59
- npm install
60
- npm run build
61
- npm install -g .
62
- ```
63
-
64
- ## Usage
65
-
66
- ### Claude Code Integration
67
-
68
25
  Add to your Claude Code `settings.json`:
69
26
 
70
27
  ```json
@@ -77,118 +34,167 @@ Add to your Claude Code `settings.json`:
77
34
  }
78
35
  ```
79
36
 
80
- ### Command Line Options
37
+ ## Usage
81
38
 
82
39
  ```bash
83
- # Default colorful theme
40
+ # Basic usage (single line with directory, git, model, session, today)
84
41
  claude-powerline
85
42
 
86
- # Dark theme for dark terminals
87
- claude-powerline --dark
43
+ # Dark theme
44
+ claude-powerline --theme=dark
88
45
 
89
- # Install powerline fonts
90
- claude-powerline --install-fonts
46
+ # Show tokens instead of costs
47
+ claude-powerline --usage=tokens
91
48
 
92
- # Show help
93
- claude-powerline --help
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
94
54
  ```
95
55
 
96
- ### Manual Testing
56
+ ## Screenshots
97
57
 
98
- ```bash
99
- echo '{
100
- "model": {"id": "claude-sonnet", "display_name": "Claude 3.5 Sonnet"},
101
- "workspace": {"current_dir": "/path/to/project", "project_dir": "/path/to/project"},
102
- "session_id": "abc123",
103
- "cwd": "/path/to/project",
104
- "transcript_path": "/path/to/transcript.json",
105
- "hook_event_name": "Status"
106
- }' | claude-powerline
107
- ```
58
+ ### Dark Theme (Default)
108
59
 
109
- ## Statusline Segments
60
+ ![Dark Theme](images/powerline-dark.png)
110
61
 
111
- The statusline displays information in colored segments from left to right:
62
+ ### Light Theme
112
63
 
113
- | Segment | Description | Example |
114
- |---------|-------------|---------|
115
- | **Directory** | Current working directory or project name | `myproject` |
116
- | **Git Branch** | Branch with status and ahead/behind | `master ✓ ↑2` |
117
- | **Model** | Current Claude model | `Claude 3.5 Sonnet` |
118
- | **Session** | Current session usage cost | `Session $0.05` |
119
- | **Daily** | Total daily usage cost | `Today $14.82` |
64
+ ![Light theme](images/powerline-light.png)
120
65
 
121
- ### Git Status Indicators
66
+ ## Default Segments
122
67
 
123
- - `✓` **Clean** - No uncommitted changes
124
- - `●` **Dirty** - Uncommitted changes present
125
- - `⚠` **Conflicts** - Merge conflicts detected
126
- - `↑3` **Ahead** - 3 commits ahead of remote
127
- - `↓2` **Behind** - 2 commits behind remote
68
+ By default displays: `Directory | Git Branch | Model | Session Usage | Today Usage`
128
69
 
129
- ### Cost Information
70
+ ### Usage Display Types
130
71
 
131
- Powered by [ccusage](https://github.com/ryanschneider/ccusage) integration:
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`)
132
76
 
133
- - Shows current session and daily totals
134
- - Displays `N/A` if session not found
135
- - Shows `<$0.01` for small amounts
77
+ ### Git Status Indicators
136
78
 
137
- ## Themes
79
+ - `✓` Clean, `●` Dirty, `⚠` Conflicts
80
+ - `↑3` Ahead, `↓2` Behind remote
138
81
 
139
- **Colors Theme (Default):**
82
+ ### Budget Indicators
140
83
 
141
- - Vibrant segments: orange → blue → purple → pink → green
142
- - High contrast for light terminals
84
+ - `25%` Normal (under 50%)
85
+ - `+75%` Moderate (50-79%)
86
+ - `!85%` Warning (80%+, configurable)
143
87
 
144
- **Dark Theme (`--dark`):**
88
+ ## Configuration
145
89
 
146
- - Subdued segments: brown → gray → dark purple → charcoal
147
- - Optimized for dark terminals
90
+ Generate config template:
148
91
 
149
- ## Requirements
92
+ ```bash
93
+ claude-powerline --print-default-config > ~/.claude/claude-powerline.json
94
+ ```
150
95
 
151
- - Node.js 18.0.0
152
- - Claude Code with statusline hook support
153
- - Terminal with powerline font support (use `--install-fonts`)
154
- - Git (optional, for git integration)
96
+ Config files loaded in priority order:
155
97
 
156
- ## Development
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)
157
103
 
158
- ```bash
159
- # Install dependencies
160
- npm install
104
+ ### Enable Additional Segments
161
105
 
162
- # Build TypeScript
163
- npm run build
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": "both" },
117
+ "block": { "enabled": false, "type": "cost" },
118
+ "tmux": { "enabled": true }
119
+ }
120
+ }
121
+ ]
122
+ }
123
+ }
124
+ ```
164
125
 
165
- # Run tests
166
- npm test
126
+ ### Multi-line Layout (Optional)
167
127
 
168
- # Lint code
169
- npm run lint
128
+ To prevent segment cutoff, configure multiple lines:
170
129
 
171
- # Development mode with file watching
172
- npm run dev
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": "both" },
145
+ "block": { "enabled": false, "type": "cost" },
146
+ "tmux": { "enabled": true }
147
+ }
148
+ }
149
+ ]
150
+ }
151
+ }
173
152
  ```
174
153
 
175
- ## Troubleshooting
154
+ ### Custom Theme
176
155
 
177
- **Arrows not displaying?**
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
+ ```
178
184
 
179
- 1. Run `claude-powerline --install-fonts`
180
- 2. Restart terminal and set font to a powerline font
181
- 3. Ensure terminal supports Unicode
185
+ ## Requirements
182
186
 
183
- **Cost showing N/A?**
187
+ - Node.js ≥ 18.0.0
188
+ - Terminal with powerline font support
189
+ - Git (optional, for git integration)
190
+
191
+ ## Troubleshooting
184
192
 
185
- 1. Verify [ccusage](https://github.com/ryanschneider/ccusage) can access Claude data
186
- 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.
187
194
 
188
- **Git info missing?**
195
+ **Cost showing N/A?** Verify [ccusage](https://github.com/ryanschneider/ccusage) is working and session ID matches.
189
196
 
190
- 1. Ensure you're in a git repository
191
- 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.
192
198
 
193
199
  ## Contributing
194
200