cavaldos/pitago
Tentang
A polished terminal UI (TUI) for the pi AI coding agent — real-time chat, multi-provider LLMs, tools and sessions. Built with Go and Bubble Tea.
Alat pengembanganPertumbuhan bintang terukur
- dalam 24 jam
- +1
- dalam 7 hari
- +5
- dalam 15 hari
- +6
- dalam 1 bulan
- +8
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
Asli
https://github.com/user-attachments/assets/93bfcae4-b02e-429d-a302-d2df850f71a7
A polished Terminal User Interface (TUI) frontend for the pi agent, built with tview and tcell. pi --mode rpc serves as the backend (multi-provider, tools, sessions, compaction), while pitago provides a rich terminal interface communicating over JSONL.
Screenshots
Install
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/cavaldos/pitago/main/script/install.sh | bash
# Windows (PowerShell)
Invoke-WebRequest https://github.com/cavaldos/pitago/releases/latest/download/pitago-windows-amd64.exe -OutFile pitago.exe
From source:
git clone https://github.com/cavaldos/pitago.git
cd pitago
script/build.sh # outputs bin/pitago (VERSION defaults to git tag/commit)
mkdir -p ~/.local/bin && cp bin/pitago ~/.local/bin/pitago
pitago --version
script/run.sh # or: go run ./src
Uninstall
| Platform | Command |
|---|---|
| macOS / Linux | rm ~/.local/bin/pitago (or /usr/local/bin/pitago if you installed with sudo before) |
| Windows | del C:\path\to\pitago.exe — wherever you placed it, on a folder in your PATH |
| Any (reset data) | rm -rf ~/.config/pitago / Remove-Item -Recurse -Force $HOME\.config\pitago — drops saved API keys + recent models |
Quick Start
go run ./src # start in this directory
go run ./src ~/Code/workspace # or open another directory (flags first)
go run ./src -c # resume the most recent session
go run ./src -ne # load no pi extensions (same as `pi -ne`)
go run ./src --update # self-update to the latest GitHub release
Commands & keybindings
Commands
Type / to open the command popup. Builtins are intercepted locally and re-implemented over
RPC; extension/prompt/skill commands come from pi's get_commands and run server-side.
| Command | Action |
|---|---|
/model · /recent |
Change model · recent models picker |
/yank /copy /copy-md /copy-tables /copy-code |
Copy the last assistant answer, whole or semantic |
/sidebar · /mouse [on|off] |
Hide/show sidebar · toggle mouse (click + wheel) |
/theme [name] |
Switch theme — picker, or apply directly (pitago --theme one-dark) |
/pet [name|ascii|classic] |
Sidebar pet: picker dialog, or apply directly |
/plugins |
Collapse/expand installed pi plugins in the sidebar |
/thinking |
Toggle thinking level |
/mcp |
MCP server manager: add/remove servers, per-server login, tools, reconnect, exposure, enable/disable |
/tree |
Navigate the session tree like pi: branches, fold, filters, labels, Enter switches branch (Esc Esc on an empty input opens it too) |
/focus [path[:start-end]] |
File tree (neo-tree style) + code view: select lines (v/drag), ask the AI about only those lines |
/trajectory [all|tools|messages] |
Harness-style run trace window (updates live while pi runs) |
/notification [filter] |
Notification history (time + info/error, newest first) |
/settings |
Agent settings, saved to ~/.pi/agent/settings.json |
/pitago-setting |
Pitago hub: agent, skills, prompts, extensions, plugins, MCP, tasks, theme, login |
/login · /logout |
Manage API keys + pi OAuth/subscriptions |
/quota |
Provider quota panel: OpenCode Go/Zen, ChatGPT Codex, Claude, OpenRouter, Groq rate limit (percent LEFT with reset countdown); Gemini shows its limits live on AI Studio (the API has no quota endpoint). Read-only endpoints, 90s cache |
/live |
Attach read-only to a running pi session |
/reload |
Reload extensions |
/new · /resume · /session |
New session · resume picker · session management |
/compact [instructions] |
Compact the context now (an LLM call, can take a while) |
/update |
Check GitHub releases and install the latest |
/quit |
Exit |
Keybindings
| Key | Action |
|---|---|
Enter |
Send (idle) / steer (while running) |
Esc |
Cancel the running turn. Before the model answers, the prompt can be taken back into the input |
Ctrl+C |
Clear the input — text, a recalled message, the image tray; on an empty input, quit (press twice within 3s) |
Ctrl+N |
New session |
Ctrl+P / Ctrl+R / Alt+1…5 |
Cycle model · recent-models picker · jump to a recent model |
Ctrl+T |
Cycle thinking level (no picker) |
Ctrl+E |
Hide/show sidebar (hide for clean drag-select of chat only) |
Ctrl+Y / Ctrl+O |
Yank last assistant answer · yank picker for any message |
Ctrl+V |
Paste text — or screenshot data (pngpaste/wl-paste/xclip) |
Ctrl+G |
Expand/collapse tool output: write content, read results, diffs |
Backspace |
Empty input + image tray → remove the last [Image N] chip |
↓ (+tray) |
Cursor into the image tray · ←→ pick a chip · ⌫ delete it · Esc back to input |
Tab |
Complete /command or @file |
@ |
Mention a file (fuzzy finder; @*.png/.jpg/.gif/.webp also sends vision) |
↑↓ PgUp PgDn |
Empty input: recall sent messages (Esc clear) · otherwise scroll chat |
Tab |
Toggle plan mode (/complete in the palette, @complete files) |
End |
Jump to the latest message — a hint chip with the same shortcut floats over the transcript while you are scrolled up (click it to jump too) |
Alt+… or Ctrl+↑↓ PgUp PgDn Home End |
Scroll the sidebar |
Mouse wheel |
Hover sidebar to scroll it, the chat otherwise; --mouse=false disables |
Mouse interaction
Click the menu bar, sidebar rows, or prompt (to place the cursor). Right-click for contextual actions, drag the sidebar divider to resize it, or double-click the divider to reset it. In native pickers, click a row to choose it or click outside to dismiss. Use Alt+M to toggle mouse capture and F10 to open the menu with the keyboard. See the tview migration notes for current coverage.
Shell mode
Type ! on an empty input to switch the editor into a local shell: Enter runs the line, Esc
leaves the mode and kills the process. Nothing typed in shell mode ever reaches pi — no turn, no
session entry — so the command is yours, not the model's. (!cmd still goes to pi.)
The editor footer shows the local shell's name and PID even between commands, and shows active Pi
shell commands. Click a Shells row next to the task list above the editor to see its source,
status, PID when available, and full command (enable the mouse with Alt+M if needed). The right
sidebar also lists all active shells. Run /shells and press Enter on a row to open its details
from the keyboard. In the details, press s or click [s] Stop to stop the selected shell. For an
Agent shell, press y to confirm cancelling the entire Agent turn.
When Pitago quits, it stops the local shell tree and asks its own Pi process to shut
down before forcing it to exit. External Pi sessions and jobs that detach from the managed shell tree
are not controlled by Pitago.
| Key | Action |
|---|---|
! (empty input) |
Enter shell mode |
Enter |
Run the line; output lands in the chat as a bash block (stderr included, non-zero exit marked) |
↑↓ / Shift+↑↓ |
Recall an earlier shell command (Esc clears) — never a message sent to pi |
Esc |
Leave shell mode, kill the shell, drop a recalled command |
Ctrl+C |
Interrupt the running command (the shell keeps its cwd); idle, clear the line / double-press quit |
Ctrl+V |
Paste a command (the editor's other keys keep working: chat scroll, sidebar) |
One long-lived shell runs every line with the session cwd, so cd, export and shell variables
persist between commands. The program is $SHELL (see /settings → Pitago → Shell binary for
an override: $SHELL or an absolute path). Commands run one at a time with an empty stdin and no
terminal, so a typo'd quote reports a syntax error, cat/read see end-of-file and sudo/ssh
password prompts fail fast instead of hanging the mode. A block
shows the first 12 output lines (Ctrl+G shows all) and keeps the first 16 KB of a command's output,
so one chatty command cannot slow down typing afterwards.
pi's own !cmd escape (a fresh process per command, output visible to the model) is untouched.
Copying text and messages
| Action | How |
|---|---|
| Drag-select | With mouse on (default): drag inside the chat — selection is clamped to the chat pane, edge auto-scrolls |
| Select a line | Double-click a chat line |
| Copy a block | Right-click an assistant block for Copy markdown, Copy N code block(s), Copy N table(s), Copy plain text — the menu only lists what the block contains |
| Mouse off | Native terminal selection; toggle at runtime with /mouse off |
| Last answer | Ctrl+Y / /yank / /copy, or /copy-md /copy-tables /copy-code for semantic content |
| Any message | Ctrl+O opens the yank picker |
Whole-message copy preserves raw Markdown, tables, fenced-code languages, and links; partial drag selection copies visible text without ANSI/OSC sequences.
Development
go vet ./... # vet
go build -o /tmp/pitago ./src # build
go test ./... # test
script/test-cicd.sh # what CI runs, locally first
A tag push cross-builds (linux-amd64, darwin-amd64/arm64, windows-amd64) and publishes a GitHub
Release: script/release.sh v0.0.1.
app is a thin MVC shell, components holds pure view primitives, ext and pitago are
separate pure domain layers, builtin is a command surface over RPC, and pirpc/update are
the backend edges. script/check-layers.sh enforces the one-way import graph.
Docs
| Doc | What |
|---|---|
| resources/doc/ARCHITECTURE.md | Directory map and the import rules |
| resources/doc/CONFIGURATION.md | Every file under ~/.config/pitago/ |
| resources/doc/LIVE-SESSION.md | Attaching to a running pi session |
| resources/doc/CONTRIBUTING.md | Dev workflow, layers, tests |
| docs/design.md | Design notes: why each decision looks the way it does |
| docs/subagent-surface-hosts.md | Subagent surface hosts |
Star History
Jelajahi proyek terkait
Memuat…