← Catalog

@zhcsyncer/pi-glance

A polished input surface for the Pi coding agent with composable statuses, context progress, and highlighted auto-compaction.

ExtensionTheme

Install

Install with PiG

pig install npm:@zhcsyncer/pi-glance

Install with Pi

pi install npm:@zhcsyncer/pi-glance
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "image": "https://raw.githubusercontent.com/zhcsyncer/pi-extensions/main/packages/pi-glance/assets/demo.png",
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.9.3 (README.md). PiG does not review it.

◌ @zhcsyncer/pi-glance

简体中文

A calm, composable input surface for Pi

Replace the default prompt with a rounded multiline editor and an inline glance at Git, cost, Reply speed, context, optional tokens, and model—without hiding statuses published by other extensions.

This package is a maintained fork of pi-glance 0.5.3. It adds a status-only footer, Follow Pi theme integration, bottom-right context and auto-compaction details, and a switchable Claude-inspired working indicator. Upstream 0.5.3 does not include the working indicator.

npm license pi


Install

pi install npm:@zhcsyncer/pi-glance

Then restart Pi or run /reload.

Needs Pi 1.1 or newer and Node.js 22.19.0 or newer. Standalone usage and automatic theme appearance follow Pi 1.1's reporting.

Use

/glance
/diff

/glance opens settings with a live input-surface preview. /diff hands the terminal to optional revdiff after you choose Working tree, Branch vs main, or Compare revisions; annotations return to the editor for you to confirm and are never sent automatically. If revdiff is missing, only /diff shows the install hint.

Ctrl+Shift+S stashes or restores the current editor draft. Ctrl+Shift+U discards the stash after a second press. Confirm prompts appear under the editor with a short draft preview and disappear if you wait. The left border shows a highlighted !stash mark while a draft is waiting. Reloading or resuming the same session restores it automatically if the editor is empty.

Review changes

  • /diff worktree — review staged, unstaged, and untracked changes.
  • /diff branch [base] — MR-style review from the common ancestor of the base and HEAD. Choose Committed only or Include working tree (including untracked files). The default base is the locally available origin/main, falling back to local main; /diff never fetches. Supply a base if neither exists.
  • /diff compare [from] [to] — compare two committed endpoints, without working-tree changes. Missing endpoints open a searchable picker for local/remote branches, tags, and the latest 50 commits on HEAD. Search by name, SHA, or commit subject, or choose Use typed ref/SHA after pasting a revision.

In fullscreen mode, click the changes summary ending in a bold, accent-colored › in the Git status line or bottom-right border to review the working tree directly. In regular mode, use /diff worktree. Only the displayed summary is clickable, not the branch name or empty border.

Subcommands have completion. Use ↑↓ and Enter to choose; Esc cancels without changing your draft. Annotations append to the current draft (or fill an empty editor); a cancelled or annotation-free review leaves it untouched. Reviews require an idle Pi TUI and a Git worktree. Revdiff keeps your native appearance preferences, including theme, compact mode, and wrapping; the selected review mode determines which changes are included. Native include/exclude file filters still apply. Your original config is not modified; theme changes made with T inside /diff apply only to that review. To save a theme preference, use standalone revdiff or edit its native config.

What you see

pi-glance demo

(blank)(blank)(blank)
🖊️Rounded editor2 / 3 / 4 min rows and 0 / 1 / 2 top spacing rows
🏷️Project titleFolder name, or a safe ~/... path
📊Inline statusGit · cost · Reply speed · context · optional tokens · model
ΔWorking treeFile count and tracked +N −N in the Git line, or on the bottom-right border
⚙️/glance paneGeneral settings, segment order, and per-segment options
💤Dim unfocusedSurface quiets when you scroll the chat
🎨ThemesFollow Pi theme tokens by default, with 22 Glance palettes as fallback
📥Editor stashCtrl+Shift+S stashes or restores, Ctrl+Shift+U discards after a second press; the border shows !stash for an unrestored draft
✢Working indicatorSpinner, activity, current-cycle output, and elapsed time

Other extensions' ctx.ui.setStatus() values remain visible below the editor. Glance does not restore Pi's two informational footer rows.

Settings

Open /glance:

  • General — Color source is Follow Pi on new installs. Choose Glance palette to use the 22 built-in palettes. Light palette and Dark palette are the fallback when the current Pi theme is unavailable. Icons default to plain; nerd needs a Nerd Font. If icons look like boxes, choose plain. Workspace label is name, smart, or path.
  • Working indicator — one Enabled: on/off switch in the first-level menu. off restores Pi's default working row.
  • Git — Enabled stops all Glance git reads, fetch, /diff, and worktree counts, not just the status segment. Then Dirty marker (hidden while file counts are visible; conflicts stay), Ahead / behind, Behind main, SHA, Working tree (status or border right), and Polling.
  • Reply speed — enabled by default. Shows output tokens per second of server inference (thinking + writing): ? unknown, ~42 tok/s provisional, 42 tok/s final. It excludes local tool execution and waiting before each response starts, so a slow tool no longer drags the speed down. Longer thinking lowers the speed for the same output. On supported Pi versions, time spent waiting in blocking UI prompts is excluded too. Precision is auto, 1 digit, or 0 digits. This is a reply-experience indicator, not a benchmark. It sends no notifications and does not estimate tokens from text.
  • Cost — known costs recorded in the current session, including standalone usage such as cache warming and tool-reported totals. A trailing ? means a recorded usage has missing or invalid pricing; the known subtotal stays visible even with Hide zero. Unreported charges are not estimated. Branch navigation keeps the session-wide total; standalone usage does not increase Context or Reply speed.
  • Tokens — optional session totals. Display chooses input/output or total. Cache cycles through auto (read/write counts at full width), show (always show counts), hide, and Hit rate (rate). Hit rate shows a rounded percentage such as 42% of prompt tokens served from cache; output tokens do not affect it. Narrow layouts keep the percentage first, and no percentage appears before there are prompt tokens. The default remains auto; existing settings stay unchanged.
  • Context — text as percent / tokens, plus an optional bottom-right Progress bar (track or border, one third or remaining). Unused border cells stay light ─, used cells become heavy ━. Below 70% is normal, 70% to below 85% is warning, 85% or higher is error.
  • Bottom details — hide the auto-compaction marker if you want. Nerd Font mode shows 󰁄 auto.

Git stays quiet:

  • Clean trees show only the branch name.
  • Dirty trees add * / ● unless Working Tree file counts are already visible, for example main Δ6 +123 −99.
  • If a narrow layout hides the file-count summary, the enabled dirty marker returns. Conflicts add ! / ⚠ independently of the summary.
  • Upstream counts look like ↑2 ↓1.
  • Behind the last local origin/main adds highlighted main↓N. It stays hidden when the count is 0, origin/main is missing, or upstream ↓N is already showing that same lag.

Pi's light/dark appearance takes priority over its theme name, including when the system theme changes without being renamed. Older themes without appearance keep the exact light / dark name fallback.

/diff is optional. Glance and the working-tree summary stay available without revdiff.

Working indicator

Fork difference: provided by this package; upstream pi-glance 0.5.3 does not include it.

While a high-level cycle is active, Glance shows a themed spinner, a stable per-cycle verb, current activity (requesting, thinking, highlighted responding, or running a tool), cycle output, and elapsed time after three seconds (3s, 47s, 3m 08s). Elapsed time uses the theme warning color at five minutes or later. It is not an official Anthropic component and does not change the Agent, prompts, models, tools, messages, or session behavior.

The working row is the current cycle's output. Top-border Tokens are session cumulative usage. Context is context-window occupancy. Empty partials stay hidden instead of showing ↓ ~0 tokens.

License

MIT. Original pi-glance copyright © 2026 linys77. See UPSTREAM_SOURCE.md, UPSTREAM_LICENSE, and UPSTREAM_README.md.