Pi School

Cheatsheet

Slash commands, prompt syntax, keyboard shortcuts, CLI flags, and file paths at a glance.

A quick reference drawn from Pi’s own docs and the lessons in this course.

For deeper context on any item, follow the links to the relevant lesson or to the official docs.

Slash commands

Type these inside Pi’s prompt. Type / on its own to see the full list of available commands, including any prompt templates and skills you’ve installed.

CommandWhat it does
/login, /logoutManage OAuth or API-key credentials for a model provider
/modelSwitch models
/scoped-modelsEnable/disable models for Ctrl+P cycling
/settingsThinking level, theme, message delivery, transport
/resumePick from previous sessions
/newStart a new session
/name <name>Set the current session’s display name
/sessionShow session file, ID, messages, tokens, and cost
/treeJump to any point in the session and continue from there — see Branching
/trustSave a project trust decision for future sessions
/forkCreate a new session from a previous user message
/cloneDuplicate the current active branch into a new session
/compact [prompt]Manually compact context, optionally with custom instructions
/copyCopy the last assistant message to the clipboard
/export [file]Export the session to HTML or JSONL
/import <file>Import and resume a session from a JSONL file
/shareUpload the session as a private GitHub gist with a shareable HTML link
/reloadReload keybindings, extensions, skills, prompt templates, themes, and context files
/hotkeysShow all keyboard shortcuts
/changelogDisplay version history
/quitQuit Pi
/skill:nameManually invoke an installed skill
/<template-name>Run a prompt template you’ve defined

Prompt syntax

Special characters that change how a prompt is interpreted.

SyntaxWhat it does
@<path>Fuzzy-search and reference a project file; its contents are added to the conversation (e.g. Explain @src/index.ts)
!<command>Run a shell command and send its output to the model as part of the conversation
!!<command>Run a shell command without sending its output to the model

Keyboard shortcuts

The full set is customizable via ~/.pi/agent/keybindings.json — these are the defaults. Run /hotkeys inside Pi any time for the live list.

Images and files

ShortcutWhat it does
Ctrl+V (Alt+V on Windows)Paste an image from the clipboard
Drag and dropDrag an image file into a terminal that supports it
TabComplete a file path
Ctrl+GOpen the current input in an external editor

Models and thinking

ShortcutWhat it does
Ctrl+LOpen the model selector
Ctrl+P / Shift+Ctrl+PCycle forward/backward through scoped models
Shift+TabCycle thinking level
Ctrl+TCollapse or expand thinking blocks

Sessions and tree

ShortcutWhat it does
Ctrl+XCopy the last assistant message, or the selected message in /tree
Ctrl+O (in tree view)Cycle the tree filter mode
Shift+L (in tree view)Set or clear a label on the selected entry
Ctrl+R (in session picker)Rename a session
Ctrl+D (in session picker)Delete a session

Application

ShortcutWhat it does
EscapeCancel or abort the current response
Ctrl+CClear the editor
Ctrl+DExit Pi (when the editor is empty)
Ctrl+ZSuspend Pi to the background (not on native Windows)

CLI flags

Pass these when starting pi from your terminal. For the full list, see the usage docs.

FlagWhat it does
-p, --printPrint a single response and exit, instead of starting an interactive session
--mode jsonOutput events as JSON lines
--mode rpcRPC mode over stdin/stdout, for process integration
-c, --continueContinue the most recent session
-r, --resumeBrowse and select a session at startup
--name <name>, -n <name>Set the session display name at startup
--provider <name>Choose a provider, e.g. anthropic, openai, google
--model <pattern>Choose a model, e.g. sonnet:high or openai/gpt-4o
--no-context-files, -ncDisable AGENTS.md/CLAUDE.md discovery
--no-builtin-tools, -nbtDisable built-in tools, keep extension/custom tools
--approve, -aTrust project-local settings for one run
--no-approve, -naIgnore project-local settings for one run

File paths

Where Pi looks for config and customization files. Global paths apply to every project; per-project paths apply only inside that project (and only load once the project is trusted).

Global

PathWhat it is
~/.pi/agent/settings.jsonMain config: default provider/model, project trust default, compaction tuning
~/.pi/agent/AGENTS.mdCustom instructions loaded at the start of every session
~/.pi/agent/extensions/Global extensions
~/.pi/agent/skills/, ~/.agents/skills/Global skills
~/.pi/agent/prompts/Global prompt templates
~/.pi/agent/themes/Global themes
~/.pi/agent/models.jsonCustom model/provider definitions
~/.pi/agent/keybindings.jsonCustom keyboard shortcuts
~/.pi/agent/trust.jsonSaved project trust decisions
~/.pi/agent/sessions/Saved sessions, as JSONL
~/.pi/agent/auth.jsonStored OAuth tokens and API keys from /login

Per-project

PathWhat it is
AGENTS.md (or CLAUDE.md)Project-specific instructions, typically committed to Git
.pi/settings.jsonProject-specific config overrides
.pi/extensions/Project-specific extensions
.pi/skills/, .agents/skills/Project-specific skills
.pi/prompts/Project-specific prompt templates
.pi/themes/Project-specific themes

Where to look next

  • Pi’s own docs are the canonical reference for everything above.
  • The keybindings docs cover every default binding and how to remap them.
  • The usage docs document every CLI flag and slash command in detail.
  • The Glossary defines the terms used throughout this cheatsheet and the lessons.