{"slug": "show-hn-pisesh-a-zero-dependency-tui-for-finding-and-resuming-pi-sessions", "title": "Show HN: Pisesh, a zero-dependency TUI for finding and resuming Pi sessions", "summary": "Pisesh, a zero-dependency Node.js TUI for finding and resuming Pi coding-agent sessions, is now available via `pi install npm:pisesh` or `npm install -g pisesh`. The tool adds bookmarking, search, and session management features missing from `pi --resume`, including star favorites, custom titles, a Here tab filtering by working directory, and a [NOW] badge. It runs as a single-file script (~1,600 LoC) on Node 18+ and integrates with pi's official `ctx.switchSession()` API.", "body_md": "**English** | [한국어](https://github.com/Blue-B/pisesh/blob/main/docs/README.ko.md)\n\n**Bookmark, search, and resume pi coding-agent sessions with a fast keyboard-driven TUI.**\n\n`pi --resume`\n\nlists every session you ever started. After a week that's 50+ entries with no titles, no tags, and no order, so you just scroll and hope. pisesh adds what was missing: ⭐ favorites, instant search, and a`[NOW]`\n\nbadge for the session you're attached to.\n\nReal capture: ★ starred session at the top, the rest available behind the Today, Here, and All tabs.\n\n`Tab`\n\ncycles. `f`\n\nstars. `Enter`\n\nresumes.What the TUI looks like, screen by screen. The data below is made up, not real sessions.\n\n**Main list.** The highlighted row is the current selection, and `Tab`\n\ncycles through the tabs. The green `[NOW]`\n\nbadge marks the pi session you launched from, and the cyan `✎`\n\nmarks a session you renamed yourself. CJK titles stay column-aligned:\n\n** e renames a session.** The first user prompt makes a poor title for a thread you keep coming back to, so press\n\n`e`\n\nto set your own. It's saved as an override (the session jsonl is never touched) and the session gets a `✎`\n\nmarker in the list:** p re-points the working directory** through an arrow-key directory browser. This is the cwd pi actually\n\n`cd`\n\ns into on resume, and it's also what the `Here`\n\ntab filters on. Press `s`\n\nto lock in the highlighted directory:The ** Here tab** shows only sessions whose effective cwd matches the directory you launched pisesh from. Inside a project you see just that project's threads, without scrolling past your home-dir scratch sessions.\n\nPi accumulates sessions across many working directories: your home, several project dirs, scratch tmux panes. The built-in resume picker is roughly alphabetical and forgets context. After a few weeks:\n\n- You can't tell which session was \"the one where you fixed the auth bug\"\n- You can't pin the 3-4 long-running threads you keep going back to\n- You re-open the wrong session and pollute it with unrelated context\n- You waste time searching by timestamp guessing\n\npisesh is a **single-file Node script** (no dependencies, ~1,600 LoC) that gives you everything `pi --resume`\n\ndoesn't.\n\n| Need | What you get |\n|---|---|\n| Mark important sessions | ⭐ Star/unstar with one keystroke; favorites persist to one global JSON |\n| Give a thread a real name | `e` sets one manually; `g` generates one with a model you choose |\n| See only the current project's sessions | `Here` tab filters to sessions whose cwd matches where you launched pisesh |\n| Fix where a session resumes | `p` opens an arrow-key directory browser; sets the cwd pi `cd` s into |\n| Find a session by what you said | `/` searches id + project + first user prompt + custom title |\n| Know which session you're attached to | `[NOW]` badge on the live session (passed from pi via env var) |\n| Keep your terminal clean | Alt-screen buffer, so quitting puts your terminal back the way it was (like vim) |\n| Read Korean / Chinese / Japanese prompts | Display-width-aware truncation; columns never blow up on CJK |\n| Open from anywhere | Run as standalone `pisesh` shell command, or `/sesh` inside pi |\n| Zero install pain | No build step, no native deps, runs on Node 18+ everywhere |\n| Trust it with your history | favorites and overrides stay in sidecar JSON; session history changes only for orphan-call repair |\n\n```\npi install npm:pisesh\n```\n\nThis registers pisesh as a pi extension. Inside any pi session, type `/sesh`\n\n. The extension runs its bundled CLI, so a global npm installation is not required.\n\n`/sesh`\n\ndoes not start a second pi process. The picker returns the selected session and options to the extension, which calls pi's official `ctx.switchSession()`\n\nAPI. Standalone `pisesh`\n\nkeeps its shell behavior and starts `pi --session`\n\n. Custom cwd overrides require a pi version that supports `cwdOverride`\n\non extension session switches; pisesh warns if pi ignores one.\n\n```\nnpm install -g pisesh\npisesh\n```\n\nThe standalone `pisesh`\n\nshell command requires this global npm installation. It is separate from `pi install npm:pisesh`\n\n.\n\n```\ngit clone https://github.com/Blue-B/pisesh.git\ncd pisesh\nnpm link            # symlink ./bin/pisesh into your global PATH\npisesh --help\n```\n\nFor local pi testing, run `pi install .`\n\nfrom the cloned repository so the extension and its bundled CLI stay together.\n\n| Key | Action |\n|---|---|\n`↑` `↓` / `j` `k` |\nmove cursor |\n`Tab` / `h` / `l` |\nswitch tab (`★ Favorites` → `Today` → `Here` → `All` ) |\n`f` / `Space` |\nstar / unstar the selected session |\n`x` |\nremove favorites whose session files no longer exist |\n`Enter` |\nresume using the current default model and thinking settings |\n`o` |\nresume using the model and thinking recorded in the session |\n`e` |\nedit name: set a custom display title, shown with `✎` in the list |\n`g` |\nqueue title generation with the saved model and effort; clear a manual title with `e` first |\n`G` |\nopen title-generation settings to choose the saved model + effort |\n`p` |\nedit cwd with an arrow-key directory browser; sets the resume / `Here` dir |\n`d` |\nsession details (full prompt, file, byte size, timestamps) |\n`/` |\nsearch by id / project / first user prompt / custom title |\n`Esc` / `q` |\ncancel generation or clear search first; press again to quit |\n`Ctrl-C` |\ncancel generation and quit immediately |\n`r` |\nrescan session files (after pi starts a new session) |\n`c` (in details view) |\ncopy session id to clipboard (clip.exe / pbcopy / xclip) |\n`Home` `End` `PgUp` `PgDn` |\njump to top / bottom / ±10 |\n\nTitle generation sends up to 16 KB of session text to the selected model provider and may incur provider charges. It excludes tool results and disables context files, skills, prompt templates, and tools.\n\nFor scripts and automation:\n\n```\npisesh --list                  # print starred session IDs (one per line)\npisesh --json                  # full favorites file as JSON\npisesh --star <partial-uuid>   # star a session from a script\npisesh --unstar <partial-uuid> # unstar\npisesh --clean-favorites       # remove favorites whose sessions are gone\npisesh --version               # print installed version\npisesh --help\n```\n\n| Area | Details |\n|---|---|\n| Runtime | Node.js ≥ 18 (uses only built-in modules: `fs` , `path` , `os` , `child_process` , `readline` ) |\n| TUI rendering | Raw ANSI escape sequences (no `blessed` / `ink` / `chalk` dependency) |\n| Alt screen buffer | `\\x1b[?1049h` / `\\x1b[?1049l` , the same primitive `vim` , `less` , `htop` , and droid CLI use |\n| Input | Node's `readline.emitKeypressEvents` in raw mode |\n| Width calculation | UAX #11 East Asian Width ranges, compressed to ~10 inline range checks |\n| Pi extension | TypeScript factory using `ui.custom` , `tui.stop` , and `ctx.switchSession()` |\n| Storage | Two JSON files under `$PI_AGENT_DIR` : `favorites.json` and `pisesh-meta.json` |\n| Session discovery | Direct filesystem scan of `~/.pi/agent/sessions/<projectSlug>/*.jsonl` ; first 96 KB parsed |\n| Process model | `/sesh` runs pisesh as a selector and switches the current runtime; standalone starts `pi` |\n| Resume settings | `Enter` uses current defaults; `o` preserves the model and thinking recorded in the session |\n| Custom paths | Honors `PI_AGENT_DIR` and `PI_SESSION_DIR` , including a flat custom session directory |\n| Title generation | Ephemeral `pi --print --no-session` call using the model and effort selected in pisesh |\n\n- No\n`npm install`\n\nfor the bundled CLI runtime; it's genuinely zero-dependency - No native binaries / GPU / ffmpeg / database\n- No telemetry or analytics; title generation contacts only the provider for the model you select\n- No daemon / background process\n\n| What | Where |\n|---|---|\n| Favorites | `$PI_AGENT_DIR/favorites.json` (defaults to `~/.pi/agent/favorites.json` ) |\n| Overrides | `$PI_AGENT_DIR/pisesh-meta.json` (per-session title / cwd plus the saved title model + effort preset) |\n| Sessions | `$PI_SESSION_DIR` , or `$PI_AGENT_DIR/sessions` by default (repaired only when an orphaned tool call would break resume) |\n\nFavorites file shape:\n\n```\n{\n  \"ids\": [\n    \"019e79b9-d2c1-741f-81ea-1dcad9a2d712\",\n    \"019e6355-9957-7a30-b4ce-b9db5e3c9ac6\"\n  ],\n  \"updated\": \"2026-05-31T01:33:21.234Z\"\n}\n```\n\nIt's a single global file (not per-project). Back it up by syncing one file.\n\nKorean / Chinese / Japanese / fullwidth characters render **2 cells wide** in terminals; pisesh measures display width (not JavaScript code-unit length) when truncating and padding. Korean prompts never wrap, columns stay aligned, and the layout looks identical whether the prompt is `hello world`\n\nor `안녕하세요 세상`\n\n.\n\n```\n✓ webapp          로그인 폼 만들고 인증 엔드포인트 연결…\n✓ 가계부앱         이번 달 지출 분석 화면 설계…\n✓ docs-site       시작하기 가이드 다시 작성…\n```\n\n(Previously: Korean prompts overflowed to a second line and broke the table.)\n\n**Node.js ≥ 18 on**(the`PATH`\n\n`/sesh`\n\nextension uses`node`\n\nto run its bundled CLI)- A terminal with ANSI escape and alternate screen buffer support, which covers basically every modern emulator:\n- Windows:\n**Windows Terminal**,** WezTerm**,** Alacritty**✅ - macOS:\n**iTerm2**,** Terminal.app**,** WezTerm**,** Alacritty**,** Kitty**✅ - Linux:\n**GNOME Terminal**,** Konsole**,** xterm**,** Alacritty**,** Kitty**✅\n\n- Windows:\non`pi`\n\n`$PATH`\n\nwhen using standalone`pisesh`\n\n```\ngit clone https://github.com/Blue-B/pisesh.git\ncd pisesh\nnpm link\nnpm test        # node --check + smoke test\n```\n\nBranch from `main`\n\nwith a short-lived `feature/<scope>`\n\nor `fix/<scope>`\n\n, then squash-merge back.\nCommits: [Conventional Commits](https://www.conventionalcommits.org/) style (`feat:`\n\n, `fix:`\n\n, `docs:`\n\n, `chore:`\n\n).\n\nOpen a PR. The CI matrix runs on Ubuntu, macOS, and Windows across Node 18, 20, and 22.\n\nIf pisesh saves you context-switching time or just makes pi nicer to live in, supporting it directly accelerates development:\n\n- Your support helps: bug fixes, new keybindings, more search modes, integration with other pi extensions.\n- Transparency: I don't sell data; funds go to development time and a coffee or two.\n- One-time sponsors are credited in README and release notes (opt-out available).\n- Monthly sponsors ($3/mo via GitHub Sponsors) get best-effort priority triage for \"Sponsor Request\" issues.\n\n[pi-coding-agent](https://github.com/earendil-works/pi)by[@mariozechner](https://github.com/mariozechner), the agent and extension API that make`/sesh`\n\npossible.[interactive-shell example extension](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/examples/extensions/interactive-shell.ts), the pattern reference for the`ui.custom`\n\n+`tui.stop`\n\nTTY handoff.- Inspiration for the favorites + tabs UX:\n[droid CLI](https://github.com/factory-ai/droid)and tmux's[sesh](https://github.com/joshmedeski/sesh).\n\nThanks to everyone who helped make pisesh better 🙏\n\nThe pi extension uses the `@earendil-works/pi-coding-agent`\n\nAPI; check pi's own license for that side. The CLI binary is pure Node and has no other licenses to worry about.", "url": "https://wpnews.pro/news/show-hn-pisesh-a-zero-dependency-tui-for-finding-and-resuming-pi-sessions", "canonical_source": "https://github.com/Blue-B/pisesh", "published_at": "2026-08-22 13:54:09+00:00", "updated_at": "2026-08-22 14:13:57.780525+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-agents"], "entities": ["Pisesh", "Node.js", "pi"], "alternates": {"html": "https://wpnews.pro/news/show-hn-pisesh-a-zero-dependency-tui-for-finding-and-resuming-pi-sessions", "markdown": "https://wpnews.pro/news/show-hn-pisesh-a-zero-dependency-tui-for-finding-and-resuming-pi-sessions.md", "text": "https://wpnews.pro/news/show-hn-pisesh-a-zero-dependency-tui-for-finding-and-resuming-pi-sessions.txt", "jsonld": "https://wpnews.pro/news/show-hn-pisesh-a-zero-dependency-tui-for-finding-and-resuming-pi-sessions.jsonld"}}