@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 CHANGED
@@ -1,67 +1,27 @@
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)
7
- [![npm version](https://img.shields.io/npm/v/claude-powerline?style=flat-square)](https://www.npmjs.com/package/claude-powerline)
7
+ [![npm version](https://img.shields.io/npm/v/@owloops/claude-powerline?style=flat-square)](https://www.npmjs.com/package/@owloops/claude-powerline)
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
- 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
- ### Command Line Options
37
+ ## Usage
78
38
 
79
39
  ```bash
80
- # Default colorful theme
40
+ # Basic usage (single line with directory, git, model, session, block)
81
41
  claude-powerline
82
42
 
83
- # Dark theme for dark terminals
84
- claude-powerline --dark
43
+ # Dark theme
44
+ claude-powerline --theme=dark
85
45
 
86
- # Install powerline fonts
87
- claude-powerline --install-fonts
46
+ # Show tokens instead of costs
47
+ claude-powerline --usage=tokens
88
48
 
89
- # Show help
90
- 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
91
54
  ```
92
55
 
93
- ### Manual Testing
56
+ ## Screenshots
94
57
 
95
- ```bash
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
- ## Statusline Segments
60
+ ![Dark Theme](images/powerline-dark.png)
107
61
 
108
- The statusline displays information in colored segments from left to right:
62
+ ### Light Theme
109
63
 
110
- | Segment | Description | Example |
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
+ ![Light theme](images/powerline-light.png)
117
65
 
118
- ### Git Status Indicators
66
+ ## Default Segments
119
67
 
120
- - `✓` **Clean** - No uncommitted changes
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
- ### Cost Information
70
+ ### Usage Display Types
127
71
 
128
- 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`)
129
76
 
130
- - Shows current session and daily totals
131
- - Displays `N/A` if session not found
132
- - Shows `<$0.01` for small amounts
77
+ ### Git Status Indicators
133
78
 
134
- ## Themes
79
+ - `✓` Clean, `●` Dirty, `⚠` Conflicts
80
+ - `↑3` Ahead, `↓2` Behind remote
135
81
 
136
- **Colors Theme (Default):**
82
+ ### Budget Indicators
137
83
 
138
- - Vibrant segments: orange → blue → purple → pink → green
139
- - High contrast for light terminals
84
+ - `25%` Normal (under 50%)
85
+ - `+75%` Moderate (50-79%)
86
+ - `!85%` Warning (80%+, configurable)
140
87
 
141
- **Dark Theme (`--dark`):**
88
+ ## Configuration
142
89
 
143
- - Subdued segments: brown → gray → dark purple → charcoal
144
- - Optimized for dark terminals
90
+ Generate config template:
145
91
 
146
- ## Requirements
92
+ ```bash
93
+ claude-powerline --print-default-config > ~/.claude/claude-powerline.json
94
+ ```
147
95
 
148
- - Node.js 18.0.0
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
- ## 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)
154
103
 
155
- ```bash
156
- # Install dependencies
157
- npm install
104
+ ### Enable Additional Segments
158
105
 
159
- # Build TypeScript
160
- 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": "tokens" },
117
+ "block": { "enabled": true, "type": "cost" },
118
+ "tmux": { "enabled": true }
119
+ }
120
+ }
121
+ ]
122
+ }
123
+ }
124
+ ```
161
125
 
162
- # Run tests
163
- npm test
126
+ ### Multi-line Layout (Optional)
164
127
 
165
- # Lint code
166
- npm run lint
128
+ To prevent segment cutoff, configure multiple lines:
167
129
 
168
- # Development mode with file watching
169
- 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": "tokens" },
145
+ "block": { "enabled": true, "type": "cost" },
146
+ "tmux": { "enabled": true }
147
+ }
148
+ }
149
+ ]
150
+ }
151
+ }
170
152
  ```
171
153
 
172
- ## Troubleshooting
154
+ ### Custom Theme
173
155
 
174
- **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
+ ```
175
184
 
176
- 1. Run `claude-powerline --install-fonts`
177
- 2. Restart terminal and set font to a powerline font
178
- 3. Ensure terminal supports Unicode
185
+ ## Requirements
179
186
 
180
- **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
181
192
 
182
- 1. Verify [ccusage](https://github.com/ryanschneider/ccusage) can access Claude data
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
- **Git info missing?**
195
+ **Cost showing N/A?** Verify [ccusage](https://github.com/ryanschneider/ccusage) is working and session ID matches.
186
196
 
187
- 1. Ensure you're in a git repository
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