Skip to content

Commit 2840438

Browse files
authored
Merge pull request #6 from narumiruna/feat/pi-statusline
feat(statusline): add customizable footer extension
2 parents 41622cb + e0fd386 commit 2840438

11 files changed

Lines changed: 732 additions & 3 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Run commands from the repository root unless noted otherwise.
1515
- Full verification: `npm run check` or `just check`
1616
- Format with Biome: `npm run format` or `just format`
1717
- Typecheck all workspaces: `npm run typecheck`
18-
- Preview npm package contents: `just pack-caffeinate`, `just pack-chrome-devtools`, `just pack-firecrawl`, `just pack-goal`, `just pack-python-lsp`, or `just pack-retry`
19-
- Try a local extension without installing: `just try-caffeinate`, `just try-chrome-devtools`, `just try-firecrawl`, `just try-goal`, `just try-python-lsp`, or `just try-retry`
18+
- Preview npm package contents: `just pack-caffeinate`, `just pack-chrome-devtools`, `just pack-firecrawl`, `just pack-goal`, `just pack-python-lsp`, `just pack-retry`, or `just pack-statusline`
19+
- Try a local extension without installing: `just try-caffeinate`, `just try-chrome-devtools`, `just try-firecrawl`, `just try-goal`, `just try-python-lsp`, `just try-retry`, or `just try-statusline`
2020
- Inspect available recipes before adding new workflow commands: `just --list`
2121

2222
## Code style

MEMORY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
- For sleep-inhibitor extensions on WSL, prefer Windows `powershell.exe` with `SetThreadExecutionState`; `systemd-inhibit` may exist but fail without a usable systemd/logind session.
88
- When testing TypeScript extensions via direct Node import, avoid parameter properties; Node's strip-only TypeScript loader rejects them even though `tsc` accepts them.
99
- ty/ruff LSP servers may request `workspace/configuration`; respond with per-item empty config objects or diagnostic requests can hang.
10+
- pi-statusline is display-only; avoid prompt interception or customization commands unless intentionally reintroduced.
11+
- In Pi extensions, do not call action methods such as `getThinkingLevel()` during the factory load; defer them to `session_start` or later handlers.
1012

1113
## TASTE
1214

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Monorepo for independently installable Pi extension packages.
1212
| `@narumitw/pi-goal` | [`extensions/pi-goal`](./extensions/pi-goal) | `pi install npm:@narumitw/pi-goal` |
1313
| `@narumitw/pi-python-lsp` | [`extensions/pi-python-lsp`](./extensions/pi-python-lsp) | `pi install npm:@narumitw/pi-python-lsp` |
1414
| `@narumitw/pi-retry` | [`extensions/pi-retry`](./extensions/pi-retry) | `pi install npm:@narumitw/pi-retry` |
15+
| `@narumitw/pi-statusline` | [`extensions/pi-statusline`](./extensions/pi-statusline) | `pi install npm:@narumitw/pi-statusline` |
1516

1617
## Local development
1718

@@ -30,6 +31,7 @@ pi -e ./extensions/pi-firecrawl
3031
pi -e ./extensions/pi-goal
3132
pi -e ./extensions/pi-python-lsp
3233
pi -e ./extensions/pi-retry
34+
pi -e ./extensions/pi-statusline
3335
```
3436

3537
Preview package contents:
@@ -41,6 +43,7 @@ npm run pack:firecrawl
4143
npm run pack:goal
4244
npm run pack:python-lsp
4345
npm run pack:retry
46+
npm run pack:statusline
4447
```
4548

4649
Publish packages from their package directories:
@@ -52,4 +55,5 @@ cd extensions/pi-firecrawl && npm publish --access public
5255
cd extensions/pi-goal && npm publish --access public
5356
cd extensions/pi-python-lsp && npm publish --access public
5457
cd extensions/pi-retry && npm publish --access public
58+
cd extensions/pi-statusline && npm publish --access public
5559
```

extensions/pi-statusline/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 narumiruna
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

extensions/pi-statusline/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# pi-statusline
2+
3+
A public [pi](https://pi.dev) extension package that replaces Pi's footer with a beautiful, information-rich statusline.
4+
5+
## Install
6+
7+
```bash
8+
pi install npm:@narumitw/pi-statusline
9+
```
10+
11+
Try without installing:
12+
13+
```bash
14+
pi -e npm:@narumitw/pi-statusline
15+
```
16+
17+
Try this package locally from the repository root:
18+
19+
```bash
20+
pi -e ./extensions/pi-statusline
21+
```
22+
23+
## What it shows
24+
25+
The default statusline includes:
26+
27+
- `π` brand marker
28+
- current model
29+
- thinking level
30+
- git branch
31+
- current project directory
32+
- active or last tool
33+
- context usage percentage
34+
- token totals
35+
- estimated cost
36+
- clock
37+
38+
Statuses from other extensions, such as goal mode, appear on their own line below the main statusline and are separated with ``.
39+
The layout adapts to terminal width and truncates safely.
40+
41+
## Package layout
42+
43+
```txt
44+
extensions/pi-statusline/
45+
├── src/
46+
│ └── statusline.ts
47+
├── README.md
48+
├── LICENSE
49+
├── tsconfig.json
50+
└── package.json
51+
```
52+
53+
The package exposes its extension through `package.json`:
54+
55+
```json
56+
{
57+
"pi": {
58+
"extensions": ["./src/statusline.ts"]
59+
}
60+
}
61+
```
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "@narumitw/pi-statusline",
3+
"version": "0.1.3",
4+
"description": "Pi extension that replaces the footer with an information-rich statusline.",
5+
"type": "module",
6+
"license": "MIT",
7+
"private": false,
8+
"keywords": [
9+
"pi-package",
10+
"pi-extension",
11+
"pi",
12+
"statusline",
13+
"footer"
14+
],
15+
"files": [
16+
"src",
17+
"README.md",
18+
"LICENSE"
19+
],
20+
"pi": {
21+
"extensions": [
22+
"./src/statusline.ts"
23+
]
24+
},
25+
"scripts": {
26+
"check": "biome check . && npm run typecheck",
27+
"format": "biome check --write .",
28+
"typecheck": "tsc --noEmit"
29+
},
30+
"devDependencies": {
31+
"@biomejs/biome": "2.4.14",
32+
"@mariozechner/pi-coding-agent": "0.73.0",
33+
"@mariozechner/pi-tui": "0.73.0",
34+
"@types/node": "25.6.0",
35+
"typescript": "6.0.3"
36+
}
37+
}

0 commit comments

Comments
 (0)