pi-chonk
v0.2.0
Published
A pi extension that shows context-window fill with configurable chonk cats.
Maintainers
Readme
pi-chonk
A pi extension that shows context-window fill with a configurable Chonk Chart cat badge.
Features
- Footer status showing current context usage.
- Six increasingly chonky cats mapped across the active model's context window.
- Optional token-count or percentage prefix.
- Optional chonk label text.
- Theme-aware coloring: muted prefix, success chonk states, and error coloring for the last two stages.
- Configurable labels, icons, and refresh interval.
- Interactive settings UI.
- Footer-agnostic integration through Pi extension status.
Install
From npm, once published:
pi install npm:pi-chonkTry without installing:
pi -e npm:pi-chonkFrom GitHub:
pi install git:github.com/somus/pi-chonkFrom a local checkout:
git clone https://github.com/somus/pi-chonk.git
pi install ./pi-chonkAfter installing or updating, restart pi or run:
/reloadUsage
Open settings:
/pi-chonkSettings are changed through the /pi-chonk UI. Command arguments do not mutate settings.
Settings
Configurable from /pi-chonk:
- Enabled on/off
- Prefix:
off,tokens, orpercentage - Label on/off
- Refresh interval
- Six chonk labels
- Six chonk icons
- Reset defaults
Settings are stored at:
~/.pi/agent/pi-chonk.jsonDefault config:
{
"enabled": true,
"showLabel": true,
"tokenDisplay": "tokens",
"refreshIntervalMs": 2000,
"labels": ["Lean", "Chonking", "Chonky", "Big Chonk", "Mega Chonk", "Oh lawd"],
"icons": ["", "", "", "", "", ""]
}tokenDisplay values:
off— show only the cat and optional labeltokens— show compact context token count, e.g.138kpercentage— show context fill percentage, e.g.51%
Chonk Chart font
Chonk icons use private-use glyphs from the bundled Chonk Chart font. npm install runs a postinstall script that installs assets/chonk-chart.ttf:
- macOS:
~/Library/Fonts/chonk-chart.ttf - Linux:
~/.local/share/fonts/chonk-chart.ttf
Manual install:
npm run install-fontRestart your terminal or select a font fallback that includes Chonk Chart if glyphs still show as boxes.
Custom footer integration
pi-chonk exposes footer text through Pi extension status:
ctx.ui.setStatus("pi-chonk", text);Custom footer extensions can include it with:
footerData.getExtensionStatuses()The status text may include safe SGR color sequences from Pi theme tokens. Custom footers should preserve those sequences if they want pi-chonk colors to appear.
Package metadata
package.json declares this as a pi package:
{
"keywords": ["pi-package"],
"pi": {
"extensions": ["./src/index.ts"]
}
}Development
Install dependencies:
npm installRun checks:
npm run check
npm run typecheck
npm testPackage dry-run:
npm pack --dry-runReleases use Release Please and npm trusted publishing. Merge Conventional Commits to main, then merge the Release Please PR to publish with provenance.
