From 2031ab050694c181e2311d591ceae22ab9c66bf3 Mon Sep 17 00:00:00 2001 From: Evan Reichard Date: Sun, 3 May 2026 11:34:17 -0400 Subject: [PATCH] docs: add project readme and usage attribution --- AGENTS.md | 2 +- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/AGENTS.md b/AGENTS.md index ad75015..9c01dbc 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,7 +12,7 @@ - `render.ts` — Width allocation, ANSI-aware truncation, dim text rendering. - `modules/basic.ts` — Directory, context, model, thinking, and cost modules. - `modules/usage.ts` — Usage bars/text modules and color gradient rendering. -- `usage/` — Provider usage fetchers copied/adapted from `oh-my-pi`. +- `usage/` — Provider usage fetchers adapted from `oh-my-pi`: https://github.com/can1357/oh-my-pi/tree/main/packages/ai/src/usage - `providers/openai-codex/constants.ts`, `usage.ts`, `utils.ts` — Local shims/support for copied usage code. ## Conventions diff --git a/README.md b/README.md new file mode 100644 index 0000000..fcc00d1 --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +# 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).