53 lines
1.2 KiB
Markdown
53 lines
1.2 KiB
Markdown
# pi-statusbar
|
|
|
|
A [pi](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent) extension that replaces the built-in footer with a configurable two-row statusbar.
|
|
|
|
## Features
|
|
|
|
- Directory, git branch, session, context, model, thinking, and cost modules
|
|
- Account usage modules for Claude/Anthropic, Codex/ChatGPT, and Z.ai
|
|
- Configurable rows and module placement in `config.ts`
|
|
- ANSI-aware rendering and truncation for narrow terminals
|
|
- Continuous green → yellow → red usage bar gradient
|
|
|
|
## Usage
|
|
|
|
Add this extension to pi via `package.json`:
|
|
|
|
```json
|
|
{
|
|
"pi": {
|
|
"extensions": ["./index.ts"]
|
|
}
|
|
}
|
|
```
|
|
|
|
Reload pi after changes with `/reload`.
|
|
|
|
Refresh account usage manually with:
|
|
|
|
```text
|
|
/refresh-usage
|
|
```
|
|
|
|
## Configuration
|
|
|
|
Edit `config.ts` to change the statusbar layout. Usage modules can be composed with options such as:
|
|
|
|
```ts
|
|
{ type: "usage", window: "current", style: "line", grow: 1 }
|
|
{ type: "usage", window: "week", style: "text", parts: ["percent", "time"] }
|
|
```
|
|
|
|
## Development
|
|
|
|
```sh
|
|
npm install
|
|
npm run lint
|
|
npm run typecheck
|
|
```
|
|
|
|
## Attribution
|
|
|
|
Provider usage fetchers in `usage/` are adapted from [`oh-my-pi`](https://github.com/can1357/oh-my-pi/tree/main/packages/ai/src/usage).
|