@say8425/cc-statusline 3.0.0 → 3.2.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
@@ -54,7 +54,9 @@ Add the following to `~/.claude/settings.json`:
54
54
  - **Session Time**: Current session elapsed time
55
55
  - **Cost**: Session cost in USD
56
56
  - **Context**: Token usage with percentage (color-coded)
57
+ - **Model**: Current model name and reasoning effort (e.g., `Fable 5 high`; effort shown only for models that support it), with an `⚡ultra` badge when ultracode is enabled in your Claude Code settings and the session reports `xhigh` effort
57
58
  - **Git Diff**: File count, insertions, deletions
59
+ - **Clickable Diff Viewer**: Click `✏️` to open a local diff viewer (Pierre `@pierre/diffs` + `@pierre/trees`) in your browser — file tree, working-tree / vs-base modes, watch mode (auto-refresh), file folding, and in-app search (`Cmd/Ctrl+F`) across the full diff, including deleted lines
58
60
  - **PR URL**: Clickable OSC 8 hyperlink
59
61
  - **Worktree Support**: Shows real project name when running in a `cc --worktree` session
60
62
  - **TrueColor**: Dynamic colors based on thresholds
@@ -73,13 +75,50 @@ Add the following to `~/.claude/settings.json`:
73
75
  | ⏱️ | Session elapsed time |
74
76
  | 💰 | Session cost in USD |
75
77
  | 🧠 | Context window usage |
78
+ | 🤖 | Current model and effort |
76
79
  | ⏳ | Limit reset time |
77
80
  | 📊 | 5-hour utilization % |
78
81
  | ⏰ | Weekly limit reset time |
79
82
  | 📅 | 7-day utilization % |
80
- | ✏️ | Uncommitted changes |
83
+ | ✏️ | Uncommitted changes (click to open diff viewer) |
81
84
  | 📎 | Pull request link |
82
85
 
86
+ ## Diff Viewer
87
+
88
+ Click `✏️` in the statusline to open a local diff viewer in your browser, rendered with Pierre's [`@pierre/diffs`](https://www.npmjs.com/package/@pierre/diffs) components.
89
+
90
+ ![diff_viewer](docs/diff_viewer.png)
91
+
92
+ > [!TIP]
93
+ > **Pairs well with [cmux](https://cmux.com)** — the viewer opens right in cmux's [browser side panel](https://cmux.com/docs/browser-automation), so your diff sits next to your terminal instead of in a separate window. cmux's built-in diff viewer felt clunky to use, which is part of why this one exists.
94
+
95
+ - **Two diff modes**: `Working tree` (vs HEAD) and `vs <base>` (merge-base against the PR target or default branch). After you commit, the entry point stays alive as `✏️ vs <base>` — clicking it opens the viewer in base mode, so your diff never disappears mid-review.
96
+
97
+ ![diff_vs_base](docs/diff_vs_base.png)
98
+
99
+ - **Image diff**: changed binary images (png/jpg/gif/webp/avif/bmp/ico) render inline in the diff flow, in the same order as the file tree — side-by-side Old/New panels on a checkerboard background, foldable like any other file
100
+
101
+ ![image_diff](docs/image_diff.png)
102
+ - **Unified / Split** view toggle
103
+ - **Watch mode**: auto-refresh (~2s polling) that detects changes while preserving scroll position
104
+ - **File tree**: left/right placement and flatten (collapse empty directories) toggles
105
+ - **File folding**: click any file header to collapse/expand; lockfiles and files with more than 1,500 changed lines start collapsed
106
+ - **In-app search** (`Cmd/Ctrl+F`): searches the entire diff including deleted lines, with match navigation and highlighting
107
+ - **Copy path**: hover a file header to copy the file's relative path
108
+ - **Include untracked** files toggle
109
+
110
+ ### How It Works (Diff Viewer)
111
+
112
+ The statusline spawns the viewer server on demand at `127.0.0.1:49573` whenever the repo has something to show. Requests are token-protected and bound to localhost.
113
+
114
+ | Environment variable | Effect |
115
+ | -------------------- | ------ |
116
+ | `CC_STATUSLINE_DIFF_PORT` | Change the port (default: `49573`) |
117
+ | `CC_STATUSLINE_DIFF_DISABLE=1` | Disable the diff viewer entirely |
118
+
119
+ > [!TIP]
120
+ > Open the viewer through the `✏️` link instead of a bookmark — the link always carries a fresh token and makes sure the server is running.
121
+
83
122
  ## Usage Metrics
84
123
 
85
124
  Shows usage information from Claude Code's stdin JSON input.
@@ -118,8 +157,11 @@ bun test --coverage
118
157
  # Type check
119
158
  bun run typecheck
120
159
 
121
- # Lint
160
+ # Lint (oxlint, type-aware)
122
161
  bun run lint
162
+
163
+ # Format (oxfmt)
164
+ bun run format
123
165
  ```
124
166
 
125
167
  ## Color Thresholds