pi-click-model0.1.0
Click the badges in Pi's footer to switch models and thinking levels with the mouse (fullscreen TUI).
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-click-model
Click the badges in Pi's footer to switch models and thinking levels — with the mouse.
↑1.2k ↓300 $0.012 · 42% ctx click to switch · right-click for next ⟨anthropic/claude-sonnet-4-5⟩ ⟨think: high⟩
The badges sit at the bottom right — the thinking level flush with the edge and the model badge just inside it — while the token/cost summary stays on the left. Model and thinking level are separate clickable targets, each with its own picker.
Pi's built-in /model selector is keyboard-only: its list component has no mouse
handler, so in the fullscreen TUI a click on a model row does nothing. This
extension replaces the footer with clickable badges and opens pickers that work
with both mouse and keyboard.
Install
# from npm
pi install npm:pi-click-model
# local checkout
pi install /path/to/pi-click-model
# or for a single run without installing
pi -e /path/to/pi-click-model/index.ts
# or symlink it into your user extensions directory
ln -s "$PWD" ~/.pi/agent/extensions/pi-click-model
Use
| Action | Result |
|---|---|
| Left-click the model badge (bottom right) | Opens the model picker |
| Left-click the thinking badge | Opens the thinking-level picker |
| Click a row in either picker | Applies it to the session immediately |
| Right-click the model badge | Switches to the next available model (cycles) |
| Right-click the thinking badge | Switches to the next supported level (cycles) |
alt+m |
Model picker (keyboard path) |
alt+t |
Thinking-level picker (keyboard path) |
ctrl+shift+m / ctrl+shift+t |
Same, on terminals with the Kitty keyboard protocol |
/click-model |
Model picker |
/click-model cycle |
Next available model |
/click-model thinking |
Thinking-level picker |
/click-model off / on |
Restores Pi's built-in footer / re-installs the badges |
/click-thinking |
Thinking-level picker |
/click-thinking cycle |
Next supported thinking level |
Both pickers support ↑/↓ (or j/k), enter to select, esc to cancel,
and typing to fuzzy-search. ctrl+u clears the search. Mouse wheel, click, and
drag behave as expected in the list. The picker opens with the current model /
level preselected.
Right-clicking anywhere in the picker dismisses it — on a row, on the title or hint lines, or on the blank space beside the list — and that click never falls through to the transcript underneath.
Thinking levels come from the same rules as Pi's built-in selector: models
without reasoning only offer off, a null entry in thinkingLevelMap hides a
level, and xhigh/max appear only when the model maps them explicitly.
Requirements
- Pi Coding Agent
>= 1.0.0(@earendil-works/pi-tui >= 0.85for component mouse dispatch). - Fullscreen TUI for mouse input. This is Pi's default; if you switched to
the regular TUI (
tuiMode: "regular"in/settings), the badges are still rendered but the terminal owns the mouse and no click reaches Pi — usealt+m/alt+t, the/click-modeland/click-thinkingcommands, or Pi's built-inctrl+linstead.
How it works
ctx.ui.setFooter()installs a one-line component that renders the token/cost summary on the left and packs the badges in from the right edge (thinking level outermost, then the model), recording each badge's column range while rendering.- In the fullscreen renderer, Pi hit-tests every layout box and forwards
normalized mouse events to the component under the pointer, including
components that have no layout node of their own (this footer). A badge claims
a left/right press so the release is routed back to it as a
click. - Pickers are overlays built from
@earendil-works/pi-tui'sSelectList(which ships its ownhandleMouse) plus a fuzzy filter, so mouse and keyboard both work. Pi renders an overlay as an opaque rectangle, so the picker spans the full terminal width while keeping its content in a right-hand column: that keeps the list next to the badges that were clicked and still captures clicks on the blank space beside it, which dismiss the picker on right click. The left padding is excluded from hit-testing, sinceContainerdispatches mouse events by row only. - Switching calls
pi.setModel()/pi.setThinkingLevel(); nothing is written tosettings.json, so the session changes without touching your configured defaults.thinkingLevelMapis read from the model registry to list only the levels the current model accepts.
Narrow terminals
Badges are packed from the right edge inward, so the thinking badge owns the
outermost column and the model badge sits just inside it. As width shrinks, the
click hint is dropped first, then the thinking badge gives way so the model badge
can take the right edge, and the left summary drops one segment at a time
(↑… ↓…, $…, ctx %). Only when the model badge alone no longer fits is it
truncated — and then clicking is disabled, so there is never a click target you
cannot see.
Limitations
- Only one extension can own the footer. Installing this alongside another footer-replacing extension means the last one loaded wins.
- Model list content comes from
ctx.modelRegistry.getAvailable(), so only models with working credentials appear.
Development
npx -p typescript tsc -p tsconfig.json # typecheck against a local Pi install
tsconfig.json maps the two Pi packages to the paths of the locally installed
coding agent; adjust them if your Pi lives elsewhere.
License
MIT