@ogulcancelik/pi-minimal-footer 0.1.11 → 0.1.13
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 +2 -1
- package/index.ts +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,6 +40,7 @@ Environment variables (all optional):
|
|
|
40
40
|
| ------------------------------- | -------------------------------------------------------- | ------- |
|
|
41
41
|
| `PI_MINIMAL_FOOTER_SHOW_CWD` | Show current working directory in footer status line | `1` |
|
|
42
42
|
| `PI_MINIMAL_FOOTER_SHOW_BRANCH` | Show git branch/dirty/ahead/behind in footer status line | `1` |
|
|
43
|
+
| `PI_MINIMAL_FOOTER_SHOW_PROVIDER` | Show provider/full-model-id instead of the short model ID | `0` |
|
|
43
44
|
|
|
44
45
|
Accepted false values: `0`, `false`, `no`, `off` (case-insensitive).
|
|
45
46
|
|
|
@@ -65,7 +66,7 @@ The footer adapts to narrow terminals by stacking lines vertically instead of th
|
|
|
65
66
|
|
|
66
67
|
### Claude Max usage bar not showing
|
|
67
68
|
|
|
68
|
-
Anthropic's OAuth usage endpoint (`/api/oauth/usage`)
|
|
69
|
+
Anthropic's OAuth usage endpoint (`/api/oauth/usage`) rate-limits requests by `User-Agent`. Anything other than Claude Code gets persistent 429s ([claude-code#30930](https://github.com/anthropics/claude-code/issues/30930)), so the footer identifies as `claude-code/<version>`. The limit is still tight, so with many pi sessions open the bar may briefly keep showing the last known values.
|
|
69
70
|
|
|
70
71
|
## Notes
|
|
71
72
|
|
package/index.ts
CHANGED
|
@@ -354,6 +354,8 @@ async function fetchClaudeUsage(): Promise<UsageSnapshot> {
|
|
|
354
354
|
headers: {
|
|
355
355
|
Authorization: `Bearer ${token}`,
|
|
356
356
|
"anthropic-beta": "oauth-2025-04-20",
|
|
357
|
+
// Other user agents land in a much stricter rate-limit bucket (persistent 429s).
|
|
358
|
+
"User-Agent": "claude-code/2.1.282",
|
|
357
359
|
},
|
|
358
360
|
});
|
|
359
361
|
|
|
@@ -815,6 +817,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
815
817
|
// Optional visibility toggles (default: enabled)
|
|
816
818
|
const showCwd = parseBooleanEnv(process.env.PI_MINIMAL_FOOTER_SHOW_CWD, true);
|
|
817
819
|
const showBranch = parseBooleanEnv(process.env.PI_MINIMAL_FOOTER_SHOW_BRANCH, true);
|
|
820
|
+
const showProvider = parseBooleanEnv(process.env.PI_MINIMAL_FOOTER_SHOW_PROVIDER, false);
|
|
818
821
|
|
|
819
822
|
function formatTokenCount(tokens: number): string {
|
|
820
823
|
if (tokens >= 1_000_000) {
|
|
@@ -1087,7 +1090,11 @@ export default function (pi: ExtensionAPI) {
|
|
|
1087
1090
|
}
|
|
1088
1091
|
|
|
1089
1092
|
// Model + thinking
|
|
1090
|
-
const modelName = ctx.model
|
|
1093
|
+
const modelName = ctx.model
|
|
1094
|
+
? showProvider
|
|
1095
|
+
? `${ctx.model.provider}/${ctx.model.id}`
|
|
1096
|
+
: ctx.model.id.split("/").pop() || "no-model"
|
|
1097
|
+
: "no-model";
|
|
1091
1098
|
const plainModelStr = theme.fg("muted", modelName);
|
|
1092
1099
|
let modelStr = plainModelStr;
|
|
1093
1100
|
if (ctx.model?.reasoning) {
|