# pi-input-bar

[![npm](https://img.shields.io/npm/v/pi-input-bar)](https://www.npmjs.com/package/pi-input-bar)

A [pi](https://pi.dev) extension that embeds live status in your editor's border — no extra rows, no clutter. Everything fits inside the input box: folder, branch, model, speed, context, cost.

```
╭─ ⌂ agent :: ⎇ main ● ────────────────── openrouter/tencent/hy3:free :: ✦ high  ─╮
│ _                                                                                │
╰─────────────────────── ⛁ 10%/262k :: ↑29k ↓1.6k R24k :: ⚡pp 512 · tg 34.2 t/s ─╯
```

## Install

From npm:

```bash
pi install npm:pi-input-bar
```

Or from git:

```bash
pi install git:github.com/sebaxzero/pi-input-bar.git
```

Add `-l` to either form to install project-locally (adds to `.pi/settings.json` only).

No dependencies, no build step, nothing to configure — the bar appears as soon as it loads.

## What you see

**Top border** — where you are and what's thinking:
- Current folder and git branch
- A dot that pulses while the agent is responding (`●`)
- `provider/model` and thinking effort level (color-coded)
- If [pi-loop-police](https://github.com/sebaxzero/pi-loop-police) is installed and has caught loops this session, a summary appears after the dot: `⚠ 10 loops (tool 7, think 3)`. No loop-police (or no loops) — nothing shown.

**Bottom border** — what's happening under the hood:
- **Context usage** — fill level, colored green → yellow → red as it fills
- **Token stats** — input, output, cache reads/writes
- **Session cost** — running total
- **Speed** — prefill (`pp`) and generation (`tg`) tokens/sec, llama.cpp style

**While streaming** — a random working word replaces the default label:
_Pondering…, Percolating…, Marinating…_ — re-rolled on every agent run.

## Commands

```
/input-bar                 — show current config
/input-bar set KEY=VAL     — override config for the current session only
/input-bar save            — write the current config to input-bar.json
/input-bar reset           — restore defaults
```

## Configuration

Persistent configuration lives in `extensions/input-bar.json` next to the installed extension (auto-created on first load with defaults). You can ask the agent to edit it, or tune values live with `/input-bar set`.

| Key | Default | Description |
|-----|---------|-------------|
| `TOP` | `true` | Show folder/branch/model/effort in the top border |
| `BOTTOM` | `true` | Show stats in the bottom border (and slim down the footer) |
| `TPS` | `true` | Show tokens/sec |
| `ANIM` | `true` | Random working word while streaming |
| `ICONS` | `true` | Glyphs (⌂ ⎇ ⛁ ⚡) in the bars |
| `WORDS` | `""` | Comma-separated custom working-word pool |
| `LOOPS` | `true` | Summary of pi-loop-police detections in the top border (only shown once a loop is caught) |

## License

MIT
