pi-bar 0.3.30 → 0.3.32
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 +15 -18
- package/extensions/status-footer.ts +15 -31
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -3,23 +3,23 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/pi-bar)
|
|
4
4
|
[](https://www.npmjs.com/package/pi-bar)
|
|
5
5
|
|
|
6
|
-
**Never accidentally run Opus on a typo again.** pi-bar keeps your model, thinking level, context pressure,
|
|
6
|
+
**Never accidentally run Opus on a typo again.** pi-bar keeps your model, thinking level, context pressure, a live progress update, and any extension statuses visible in pi's footer.
|
|
7
7
|
|
|
8
8
|
```text
|
|
9
|
-
claude-opus-4.7 ❯ think:med ❯ 2.6% / 1.0M ❯
|
|
9
|
+
claude-opus-4.7 ❯ think:med ❯ 2.6% / 1.0M ❯ Reviewing package structure ❯ plan:active
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-

|
|
13
|
+

|
|
14
|
+

|
|
15
15
|
|
|
16
16
|
## Why use it?
|
|
17
17
|
|
|
18
18
|
- **See the active model at a glance** — catch accidental model switches before an expensive or sensitive task starts.
|
|
19
19
|
- **Track thinking level in place** — immediately notice when you are using the wrong reasoning setting.
|
|
20
20
|
- **Watch context pressure early** — context usage turns green, yellow, then red as you approach the limit.
|
|
21
|
-
- **Follow what pi is doing** — a
|
|
22
|
-
- **Keep extension statuses visible** — statuses
|
|
21
|
+
- **Follow what pi is doing** — a one-line progress update keeps the current task visible without scrolling.
|
|
22
|
+
- **Keep extension statuses visible** — statuses other extensions set still appear in the footer.
|
|
23
23
|
|
|
24
24
|
pi-bar is intentionally tiny: one small extension, no broad behavior changes, and no commands to learn. It replaces pi's built-in footer with a compact model / thinking / context / progress / extension-status line.
|
|
25
25
|
|
|
@@ -46,34 +46,31 @@ PI_BAR_SHOW=model,thinking,context,progress,extensions pi
|
|
|
46
46
|
PI_BAR_SHOW=model,context pi
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Allowed segments are `model`, `thinking`, `context`, `progress`, and `extensions`. The `progress` segment
|
|
50
|
-
|
|
51
|
-
> The legacy `tldr` segment name and `PI_BAR_TLDR_MODEL` / `bar.tldrModel` settings still work and are kept as aliases for existing configs.
|
|
49
|
+
Allowed segments are `model`, `thinking`, `context`, `progress`, and `extensions`. The `progress` segment stays hidden until pi-bar has a current update. The `extensions` segment stays hidden when no extension has set a status.
|
|
52
50
|
|
|
53
51
|
### Configure live progress updates
|
|
54
52
|
|
|
55
|
-
pi-bar shows a
|
|
53
|
+
pi-bar shows a short, plain-English description of what pi is working on right now. It refreshes as pi works and resets when you switch branches in the session tree, so stale updates never follow you across tasks. Set `PI_BAR_SHOW` without `progress` to hide it.
|
|
56
54
|
|
|
57
|
-
|
|
55
|
+
Pick a specific model for the update by setting the env var or pi settings:
|
|
58
56
|
|
|
59
57
|
```bash
|
|
60
58
|
PI_BAR_PROGRESS_MODEL=anthropic/claude-haiku-4-5 pi
|
|
61
59
|
```
|
|
62
60
|
|
|
63
|
-
|
|
61
|
+
Or in pi settings: `bar.progressModel`. Otherwise pi-bar picks a fast model you are already authenticated with.
|
|
64
62
|
|
|
65
63
|
### Configure extension statuses
|
|
66
64
|
|
|
67
|
-
pi-bar
|
|
68
|
-
Use `/bar` inside pi to open an interactive status-visibility picker.
|
|
65
|
+
Other pi extensions can publish small status badges. Pi-bar collects them into the `extensions` segment. Run `/bar` inside pi to pick which ones to show:
|
|
69
66
|
|
|
70
67
|
```text
|
|
71
68
|
/bar
|
|
72
69
|
```
|
|
73
70
|
|
|
74
|
-
Toggle each status
|
|
71
|
+
Toggle each status between `shown` and `hidden`. The `New statuses` row controls the default for badges that appear later.
|
|
75
72
|
|
|
76
|
-
|
|
73
|
+
Your choices persist across pi sessions in `~/.pi/agent/pi-bar.json`. Override the path with `PI_BAR_CONFIG=/some/path.json`.
|
|
77
74
|
|
|
78
75
|
### Change context thresholds
|
|
79
76
|
|
|
@@ -92,4 +89,4 @@ The first number is the warning/yellow threshold. The second number is the dange
|
|
|
92
89
|
|
|
93
90
|
Pi extensions run with your local user permissions. Review any pi package source before installing it.
|
|
94
91
|
|
|
95
|
-
|
|
92
|
+
Progress updates send short snippets of your session activity to the selected model provider. Disable the `progress` segment with `PI_BAR_SHOW` if that is not acceptable.
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pi-bar — footer/statusline extension.
|
|
2
|
+
* pi-bar — footer / statusline extension.
|
|
3
3
|
*
|
|
4
|
-
* Replaces
|
|
5
|
-
* <model
|
|
4
|
+
* Replaces pi's built-in footer with left-aligned segments:
|
|
5
|
+
* <model> ❯ think:<level> ❯ <context% / window> ❯ <progress> ❯ <extensions>
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
* claude-opus-4.7 ❯ think:med ❯ 2.6% / 1.0M
|
|
7
|
+
* Example:
|
|
8
|
+
* claude-opus-4.7 ❯ think:med ❯ 2.6% / 1.0M ❯ Reviewing package structure
|
|
9
9
|
*
|
|
10
|
-
* Re-renders on model change, thinking-level change, status updates,
|
|
11
|
-
*
|
|
10
|
+
* Re-renders on model change, thinking-level change, status updates, and after
|
|
11
|
+
* each assistant turn so context usage stays current.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
* PI_BAR_SHOW
|
|
15
|
-
* PI_BAR_THRESHOLDS
|
|
13
|
+
* Environment variables:
|
|
14
|
+
* PI_BAR_SHOW comma-separated list of segments to show
|
|
15
|
+
* PI_BAR_THRESHOLDS warning,danger context-usage percentages
|
|
16
|
+
* PI_BAR_PROGRESS_MODEL provider/id for the progress update model
|
|
17
|
+
* PI_BAR_CONFIG override the persisted status-filter config path
|
|
16
18
|
*/
|
|
17
19
|
|
|
18
20
|
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
@@ -74,9 +76,6 @@ type FastModelAuth = {
|
|
|
74
76
|
|
|
75
77
|
const STATUS_FILTER_ENTRY_TYPE = "pi-bar-status-filter";
|
|
76
78
|
const SETTINGS_PROGRESS_KEY = "progress";
|
|
77
|
-
// Legacy settings/env names. The `tldr` keys remain accepted so existing user
|
|
78
|
-
// configs continue to work after the rename to "progress updates".
|
|
79
|
-
const LEGACY_SETTINGS_TLDR_KEY = "tldr";
|
|
80
79
|
const SETTINGS_BAR_KEY = "bar";
|
|
81
80
|
const MAX_ACTIVITY_TEXT_CHARS = 800;
|
|
82
81
|
const MAX_USER_TEXT_CHARS = 700;
|
|
@@ -171,12 +170,9 @@ function parseSegments(): SegmentName[] {
|
|
|
171
170
|
const raw = process.env.PI_BAR_SHOW;
|
|
172
171
|
if (!raw) return DEFAULT_SEGMENTS;
|
|
173
172
|
|
|
174
|
-
// `tldr` is the legacy segment name, kept working as an alias so existing
|
|
175
|
-
// PI_BAR_SHOW configs do not break after the rename to "progress".
|
|
176
173
|
const requested = raw
|
|
177
174
|
.split(",")
|
|
178
175
|
.map((segment) => segment.trim().toLowerCase())
|
|
179
|
-
.map((segment) => (segment === "tldr" ? "progress" : segment))
|
|
180
176
|
.filter((segment): segment is SegmentName =>
|
|
181
177
|
["model", "thinking", "context", "progress", "extensions"].includes(segment),
|
|
182
178
|
);
|
|
@@ -223,11 +219,8 @@ function parseProgressModelSpec(value: string): ProgressModelPreference | undefi
|
|
|
223
219
|
function settingsModelValue(settings: Record<string, unknown>): string | undefined {
|
|
224
220
|
const bar = settings[SETTINGS_BAR_KEY];
|
|
225
221
|
if (bar && typeof bar === "object" && !Array.isArray(bar)) {
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
// settings still work without manual migration.
|
|
229
|
-
if (typeof record.progressModel === "string") return record.progressModel;
|
|
230
|
-
if (typeof record.tldrModel === "string") return record.tldrModel;
|
|
222
|
+
const value = (bar as Record<string, unknown>).progressModel;
|
|
223
|
+
if (typeof value === "string") return value;
|
|
231
224
|
}
|
|
232
225
|
|
|
233
226
|
const progressSection = settings[SETTINGS_PROGRESS_KEY];
|
|
@@ -236,20 +229,11 @@ function settingsModelValue(settings: Record<string, unknown>): string | undefin
|
|
|
236
229
|
if (typeof value === "string") return value;
|
|
237
230
|
}
|
|
238
231
|
|
|
239
|
-
const legacy = settings[LEGACY_SETTINGS_TLDR_KEY];
|
|
240
|
-
if (legacy && typeof legacy === "object" && !Array.isArray(legacy)) {
|
|
241
|
-
const value = (legacy as Record<string, unknown>).model;
|
|
242
|
-
if (typeof value === "string") return value;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
232
|
return undefined;
|
|
246
233
|
}
|
|
247
234
|
|
|
248
235
|
function resolveProgressModelPreference(cwd: string): ProgressModelPreference | undefined {
|
|
249
|
-
|
|
250
|
-
// honored as a backwards-compat alias for users who set it before the
|
|
251
|
-
// rename.
|
|
252
|
-
const envModel = process.env.PI_BAR_PROGRESS_MODEL ?? process.env.PI_BAR_TLDR_MODEL;
|
|
236
|
+
const envModel = process.env.PI_BAR_PROGRESS_MODEL;
|
|
253
237
|
if (envModel) return parseProgressModelSpec(envModel);
|
|
254
238
|
|
|
255
239
|
const settings = SettingsManager.create(cwd);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-bar",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.32",
|
|
4
4
|
"description": "Pi footer/statusline showing active model, thinking level, context pressure, live progress updates, and extension statuses.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
"thinking",
|
|
15
15
|
"context",
|
|
16
16
|
"context-window",
|
|
17
|
-
"progress"
|
|
18
|
-
"tldr"
|
|
17
|
+
"progress"
|
|
19
18
|
],
|
|
20
19
|
"license": "MIT",
|
|
21
20
|
"repository": {
|
|
@@ -52,6 +51,6 @@
|
|
|
52
51
|
"extensions": [
|
|
53
52
|
"./extensions/status-footer.ts"
|
|
54
53
|
],
|
|
55
|
-
"image": "https://cdn.jsdelivr.net/npm/pi-bar@0.3.
|
|
54
|
+
"image": "https://cdn.jsdelivr.net/npm/pi-bar@0.3.32/assets/screenshot-yellow.png"
|
|
56
55
|
}
|
|
57
56
|
}
|