@owloops/claude-powerline 1.23.4 → 1.24.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
@@ -12,44 +12,8 @@
12
12
 
13
13
  [![Mentioned in Awesome Claude Code](https://awesome.re/mentioned-badge-flat.svg)](https://github.com/hesreallyhim/awesome-claude-code)
14
14
 
15
- ### Demo
16
-
17
15
  <img src="images/demo-tui.gif" alt="Claude Powerline TUI Mode Demo" width="600"/>
18
16
 
19
- _Live demonstration: real-time usage tracking, git integration, and theme showcase_
20
-
21
- <table>
22
- <tr>
23
- <td align="center">
24
- <img src="images/claude-powerline-dark.png" width="500" alt="Dark Theme"><br>
25
- <strong>Dark</strong>
26
- </td>
27
- <td align="center">
28
- <img src="images/claude-powerline-light.png" width="500" alt="Light Theme"><br>
29
- <strong>Light</strong>
30
- </td>
31
- </tr>
32
- <tr>
33
- <td align="center">
34
- <img src="images/claude-powerline-nord.png" width="500" alt="Nord Theme"><br>
35
- <strong>Nord</strong>
36
- </td>
37
- <td align="center">
38
- <img src="images/claude-powerline-tokyo-night.png" width="500" alt="Tokyo Night Theme"><br>
39
- <strong>Tokyo Night</strong>
40
- </td>
41
- </tr>
42
- <tr>
43
- <td align="center">
44
- <img src="images/claude-powerline-rose-pine.png" width="500" alt="Rose Pine Theme"><br>
45
- <strong>Rose Pine</strong>
46
- </td>
47
- <td align="center">
48
- <img src="images/claude-powerline-custom.png" width="500" alt="Custom Theme"><br>
49
- <em>Create your own!</em>
50
- </td>
51
- </tr>
52
- </table>
53
17
  </div>
54
18
 
55
19
  ## Installation
@@ -82,20 +46,17 @@ Add to your Claude Code `settings.json`:
82
46
  }
83
47
  ```
84
48
 
85
- Start a Claude session and the statusline appears at the bottom.
49
+ Start a Claude session and the statusline appears at the bottom. Using `npx` automatically downloads and runs the latest version without manual updates.
86
50
 
87
- ![Claude Code with powerline](images/claude-interface-with-powerline.png)
51
+ ## Styles
88
52
 
89
- Using `npx` automatically downloads and runs the latest version without manual updates.
53
+ <img src="images/claude-powerline-styles.png" alt="Claude Powerline Styles" width="700">
90
54
 
91
- ## Styles
55
+ ## Themes
92
56
 
93
- <img src="images/claude-powerline-styles.png" alt="Claude Powerline Styles" width="600">
57
+ <img src="images/claude-powerline-themes.png" alt="Claude Powerline Themes" width="700">
94
58
 
95
- - **minimal** -- Segments separated by spaces, no decorations
96
- - **powerline** -- Arrow-shaped separators between segments (best with Nerd Font)
97
- - **capsule** -- Rounded pill-shaped segments (best with Nerd Font)
98
- - **tui** -- Bordered panel with responsive multi-line layout. TUI mode is **opinionated**: it always displays all data regardless of segment configuration. Only theme, charset, and budget thresholds are respected.
59
+ 6 built-in themes (dark, light, nord, tokyo-night, rose-pine, gruvbox) or [create your own](#configuration).
99
60
 
100
61
  <details>
101
62
  <summary><h2>Configuration</h2></summary>
@@ -607,6 +568,18 @@ Create custom themes and configure color compatibility:
607
568
 
608
569
  **Color Options:** `bg` (hex, `transparent`, `none`) &#8226; `fg` (hex)
609
570
 
571
+ **TUI Grid Colors:** In TUI grid mode, custom colors also support bare segment names and dot-notation parts as keys. A bare segment key (e.g. `"context"`) sets the default color for the segment and all its parts. A part key (e.g. `"context.bar"`) overrides a specific part:
572
+
573
+ ```json
574
+ "colors": {
575
+ "custom": {
576
+ "model": { "fg": "#e0d68a" },
577
+ "context": { "fg": "#7dcfff" },
578
+ "metrics.lastResponse": { "fg": "#bb9af7" }
579
+ }
580
+ }
581
+ ```
582
+
610
583
  **Compatibility Modes:** `auto` (default), `ansi`, `ansi256`, `truecolor`
611
584
 
612
585
  **Environment Variables:**
@@ -636,11 +609,238 @@ Create custom themes and configure color compatibility:
636
609
  }
637
610
  ```
638
611
 
639
- The panel adapts to terminal width across three breakpoints:
612
+ By default, the TUI panel uses a built-in responsive layout. For full control over what goes where, add a `display.tui` object to your config this activates the **grid layout engine**, a CSS Grid-inspired system that lets you define rows, columns, spans, and responsive breakpoints.
613
+
614
+ #### Grid Layout Configuration
615
+
616
+ Add `display.tui` to your config file to enable the grid engine:
617
+
618
+ ```json
619
+ {
620
+ "display": {
621
+ "style": "tui",
622
+ "tui": {
623
+ "fitContent": true,
624
+ "widthReserve": 45,
625
+ "minWidth": 32,
626
+ "maxWidth": 120,
627
+ "padding": { "horizontal": 4 },
628
+ "separator": {
629
+ "column": " ",
630
+ "divider": "─"
631
+ },
632
+ "box": { ... },
633
+ "title": { ... },
634
+ "footer": { ... },
635
+ "segments": { ... },
636
+ "breakpoints": [ ... ]
637
+ }
638
+ }
639
+ }
640
+ ```
641
+
642
+ | Property | Type | Default | Description |
643
+ |---|---|---|---|
644
+ | `fitContent` | `boolean` | `false` | Panel shrinks to fit content instead of filling terminal width |
645
+ | `widthReserve` | `number` | `45` | Characters reserved from terminal width (ignored when `fitContent: true`) |
646
+ | `minWidth` | `number` | `32` | Minimum panel width |
647
+ | `maxWidth` | `number` | `∞` | Maximum panel width |
648
+ | `padding.horizontal` | `number` | `0` | Extra horizontal padding in `fitContent` mode |
649
+ | `separator.column` | `string` | `" "` | String placed between columns |
650
+ | `separator.divider` | `string` | box char | Character used for `---` divider rows |
651
+ | `box` | `object` | — | Custom box-drawing characters (see below) |
652
+ | `title` | `object` | — | Title bar text configuration (see below) |
653
+ | `footer` | `object` | — | Footer text configuration (see below) |
654
+ | `segments` | `object` | — | Custom segment templates (see below) |
655
+ | `breakpoints` | `array` | required | Responsive layout definitions |
656
+
657
+ #### Breakpoints
658
+
659
+ Each breakpoint defines a complete layout that activates when the panel width is at or above its `minWidth`. The engine picks the first match, sorted widest-first.
660
+
661
+ ```json
662
+ "breakpoints": [
663
+ {
664
+ "minWidth": 80,
665
+ "areas": [
666
+ "git.head git.head git.head . git.working",
667
+ "---",
668
+ "context.icon context.bar context.bar context.pct context.tokens",
669
+ "block.icon block.bar block.bar block.value block.time"
670
+ ],
671
+ "columns": ["auto", "1fr", "auto", "auto", "auto"],
672
+ "align": ["left", "left", "right", "right", "right"]
673
+ },
674
+ {
675
+ "minWidth": 55,
676
+ "areas": [
677
+ "git.head git.working",
678
+ "---",
679
+ "context.bar context.tokens",
680
+ "block ."
681
+ ],
682
+ "columns": ["1fr", "auto"],
683
+ "align": ["left", "right"]
684
+ },
685
+ {
686
+ "minWidth": 0,
687
+ "areas": [
688
+ "git.head",
689
+ "git.working",
690
+ "---",
691
+ "context",
692
+ "block"
693
+ ],
694
+ "columns": ["1fr"],
695
+ "align": ["left"]
696
+ }
697
+ ]
698
+ ```
699
+
700
+ | Property | Type | Required | Description |
701
+ |---|---|---|---|
702
+ | `minWidth` | `number` | yes | Minimum panel width to activate this layout |
703
+ | `areas` | `string[]` | yes | Grid rows — each string is one row of space-separated cell names |
704
+ | `columns` | `string[]` | yes | Column sizing: `"auto"`, `"1fr"` / `"2fr"`, or a fixed number like `"20"` |
705
+ | `align` | `string[]` | no | Per-column alignment: `"left"`, `"center"`, or `"right"` (defaults to `"left"`) |
706
+
707
+ **Column sizing:**
708
+ - `"auto"` — shrinks to the widest content in that column
709
+ - `"1fr"`, `"2fr"` — fractional units that divide remaining space proportionally
710
+ - `"20"` — fixed width in characters
711
+
712
+ **Special area tokens:**
713
+ - `.` — empty cell (renders as blank space)
714
+ - `---` — full-width horizontal divider row
715
+
716
+ **Spanning:** repeat the same name in adjacent cells to span columns:
717
+
718
+ ```
719
+ "context.bar context.bar context.bar context.pct context.tokens"
720
+ ```
721
+
722
+ Here `context.bar` spans the first three columns.
723
+
724
+ #### Segment Names
725
+
726
+ Use bare segment names to render the full pre-formatted segment:
727
+
728
+ ```
729
+ context block session today weekly
730
+ git dir version tmux metrics
731
+ activity burn env
732
+ ```
733
+
734
+ #### Dot-Notation Subsegments
735
+
736
+ Use `segment.part` to place individual pieces of a segment into separate cells with independent alignment:
737
+
738
+ | Segment | Parts |
739
+ |---|---|
740
+ | `git` | `icon`, `branch`, `status`, `ahead`, `behind`, `working`, `head` |
741
+ | `context` | `icon`, `bar`, `pct`, `tokens` |
742
+ | `block` | `icon`, `bar`, `value`, `time`, `budget` |
743
+ | `session` | `icon`, `cost`, `tokens`, `budget` |
744
+ | `today` | `icon`, `cost`, `label`, `budget` |
745
+ | `weekly` | `icon`, `bar`, `pct`, `time` |
746
+ | `metrics` | `response`, `responseIcon`, `responseVal`, `lastResponse`, `lastResponseIcon`, `lastResponseVal`, `added`, `addedIcon`, `addedVal`, `removed`, `removedIcon`, `removedVal` |
747
+ | `activity` | `duration`, `durationIcon`, `durationVal`, `messages`, `messagesIcon`, `messagesVal` |
748
+ | `burn` | `icon`, `rate` |
749
+ | `version` | `icon`, `value` |
750
+ | `tmux` | `label`, `value` |
751
+ | `dir` | `value` |
752
+ | `env` | `prefix`, `value` |
753
+
754
+ Example — block segment with a progress bar, mirroring the context layout:
755
+
756
+ ```json
757
+ "areas": [
758
+ "context.icon context.bar context.bar context.pct context.tokens",
759
+ "block.icon block.bar block.bar block.value block.time"
760
+ ]
761
+ ```
762
+
763
+ > [!NOTE]
764
+ > `context.bar`, `block.bar`, and `weekly.bar` are width-aware — their progress bars render at exactly the resolved column width. Block bar uses `nativeUtilization` when available, or `cost / budget` for transcript mode. Weekly bar uses the 7-day `used_percentage`.
765
+
766
+ #### Custom Box Characters
767
+
768
+ Override individual box-drawing characters. Partial overrides merge with the charset default (`unicode` or `text`):
769
+
770
+ ```json
771
+ "box": {
772
+ "topLeft": "┌",
773
+ "topRight": "┐",
774
+ "bottomLeft": "└",
775
+ "bottomRight": "┘",
776
+ "horizontal": "─",
777
+ "vertical": "│",
778
+ "teeLeft": "├",
779
+ "teeRight": "┤"
780
+ }
781
+ ```
782
+
783
+ Only specify the characters you want to change — the rest inherit from the active charset.
784
+
785
+ #### Title Bar
786
+
787
+ Configure the left and right text in the top border. Supports `{model}` and any `{segment}` or `{segment.part}` token that resolves from segment data:
788
+
789
+ ```json
790
+ "title": {
791
+ "left": "{model}",
792
+ "right": "{dir}"
793
+ }
794
+ ```
795
+
796
+ | Property | Type | Default | Description |
797
+ |---|---|---|---|
798
+ | `left` | `string` | `"{model}"` | Left-side text (supports tokens) |
799
+ | `right` | `string \| false` | `"claude-powerline"` | Right-side text, or `false` to hide |
800
+
801
+ #### Footer
802
+
803
+ Same as the title bar, but on the bottom border. Defaults to no text (plain border):
804
+
805
+ ```json
806
+ "footer": {
807
+ "left": "{weekly}",
808
+ "right": "{metrics.lastResponse}"
809
+ }
810
+ ```
811
+
812
+ | Property | Type | Default | Description |
813
+ |---|---|---|---|
814
+ | `left` | `string` | — | Left-side footer text (supports tokens) |
815
+ | `right` | `string` | — | Right-side footer text (supports tokens) |
816
+
817
+ Tokens resolve any segment or subsegment reference: `{model}`, `{dir}`, `{git.head}`, `{block.value}`, `{metrics.lastResponse}`, etc.
818
+
819
+ #### Segment Templates
820
+
821
+ Define custom compositions for composite cells using the `segments` key. This assembles multiple parts into a single cell:
822
+
823
+ ```json
824
+ "segments": {
825
+ "metrics.lastResponse": {
826
+ "items": ["{lastResponseIcon}", "{lastResponseVal}"],
827
+ "gap": 1,
828
+ "justify": "start"
829
+ }
830
+ }
831
+ ```
832
+
833
+ | Property | Type | Default | Description |
834
+ |---|---|---|---|
835
+ | `items` | `string[]` | required | Part references like `"{partName}"` or literal strings |
836
+ | `gap` | `number` | `1` | Spaces between items |
837
+ | `justify` | `string` | `"start"` | `"start"` packs items left; `"between"` distributes across cell width |
838
+
839
+ The template name (e.g. `metrics.lastResponse`) can then be used as a cell name in `areas`.
840
+
841
+ #### Automatic Culling
640
842
 
641
- - **Wide** (80+ cols): metrics on one line, workspace and footer spread across columns
642
- - **Medium** (55-79 cols): metrics split across two lines, stacked footer
643
- - **Narrow** (<55 cols): fully stacked layout
843
+ Empty segments are automatically removed cells resolve to `.`, empty rows are dropped, and orphaned dividers are cleaned up. A wide layout gracefully degrades when data is unavailable.
644
844
 
645
845
  > [!NOTE]
646
846
  > Claude Code's internal progress indicators (spinner, context bar) may briefly overlap the TUI panel during tool calls. This is a limitation of the hook architecture and resolves once the tool call completes.