Pi Cheatsheet
Keys: Ctrl = Control (⌃), Option = ⌥, Shift = ⇧, Enter = Return (↵). Run /hotkeys in Pi to see the shortcuts in your current configuration.
Prompting
| Shortcut | Action |
|---|---|
Enter | Submit a message. While Pi is working, queue a steering message to run after the current tool call finishes. |
Option+Enter | Queue a follow-up to run after the agent finishes all queued work. |
Ctrl+V | Paste an image. |
Option+↑ | Restore queued messages to the editor. |
Ctrl+G | Open an external editor for longer prompts. Choose the editor with the EDITOR environment variable; the PDF suggests EDITOR="code --wait" for VS Code. |
Ctrl+C | Clear the current prompt input. |
Esc | Cancel or abort the current operation. |
Ctrl+O | Show or hide tool output in the message composer. |
Ctrl+T | Show or hide thinking blocks in the message composer. |
Ctrl+D | Exit when the prompt input is empty. |
Prompting Additions
| Syntax | Action |
|---|---|
@file | Type @ to fuzzy-search files and attach them to your message. |
!command | Run a shell command and send its output to the model. |
!!command | Run a shell command without sending its output to the model. |
Tree Navigation
These shortcuts apply inside /tree.
| Shortcut | Action |
|---|---|
Ctrl+← or Option+← | Collapse the current branch. If no branch is expanded, jump to the previous segment start. |
Ctrl+→ or Option+→ | Expand the current branch. If no branch is collapsed, jump to the next segment start or branch end. |
Shift+L | Edit a label. |
Ctrl+D | Use the default filter. |
Ctrl+T | Hide tool results. |
Ctrl+U | Show only user messages. |
Ctrl+L | Show labeled entries. |
Ctrl+A | Show all entries. |
Sessions & Branching
| Command | Action |
|---|---|
/new | Start a fresh session file. |
/resume | Browse previous sessions and switch to one. |
/name <name> | Set a human-readable session name. |
/session | Show session details, including ID, token usage, and cost. |
/tree | Jump anywhere in the current session tree. |
/fork | Create a new session from an earlier user message. |
/clone | Duplicate the current session into a new session. |
/compact [prompt] | Summarize older context to free tokens. |
/export [file] | Export the session to HTML. |
/share | Upload a private GitHub gist with a shareable HTML link. |
Models & Thinking
| Shortcut | Action |
|---|---|
Ctrl+L | Open the model selector. |
Ctrl+P | Cycle to the next model. |
Shift+Ctrl+P | Cycle to the previous model. |
Shift+Tab | Cycle the thinking level. |
Core Slash Commands
| Command | Action |
|---|---|
/login, /logout | Manage OAuth or API-key credentials. |
/model | Open the current model selector. |
/skill:name | Run an installed skill on demand. |
/promptName | Load a predefined prompt template into the editor. |
/scoped-models | Choose which models participate in Ctrl+P cycling. |
/settings | Change Pi editor settings. |
/reload | Reload keybindings, skills, prompts, extensions, and context files. |
/hotkeys | Show the live shortcut list from the current configuration. |
/copy | Copy the last assistant message to the clipboard. |
Starting Pi
| Command | Action |
|---|---|
pi -c | Start Pi with the most recent session. |
pi -r | Browse and resume a previous session. |
pi --session <path|id> | Start Pi with a specific session. |
pi --name <name> | Start a new session with a specific name. |
pi --no-session | Start in ephemeral mode without saving session data. |
pi --mode json <msg> | Run non-interactively with the given prompt, stream JSON responses, and exit. |
Adapted from the Pi Coding Agent Shortcuts (Dark, Mac) reference by Web Dev Simplified.