Pi Agent: Keybindings & Theme Customization
Last updated: 2026-08-31
Tools feel right when they fit your hands. Keybindings and themes are your "workstation calibration."
1. Keyboard Shortcuts
(1) Default Shortcuts
| Shortcut | Function |
|---|---|
| Ctrl+C | Interrupt current operation / Exit |
| Ctrl+D | Exit interactive mode |
| Enter | Send message |
| Ctrl+L | Clear screen |
| Tab | Auto-complete (commands/filenames) |
| Up/Down | Browse message history |
| Ctrl+R | Regenerate last response |
| Ctrl+E | Edit last message |
| Ctrl+K | Delete to end of line |
(2) Custom Shortcuts
Configure in ~/.pi-agent/keybindings.yaml:
YAML
keybindings:
submit: "enter"
new_line: "ctrl+enter"
clear_screen: "ctrl+l"
retry: "ctrl+r"
edit_last: "ctrl+e"
save_session: "ctrl+s"
load_session: "ctrl+o"
toggle_tools: "ctrl+t"
switch_model: "ctrl+m"
history_up: "up"
history_down: "down"
(3) Register Shortcuts in Code
PYTHON
from pi_agent import Agent
agent = Agent(name="custom")
@agent.keybind("ctrl+shift+r")
def retry_with_reasoner():
agent.switch_model("deepseek-reasoner")
agent.retry()
@agent.keybind("ctrl+shift+s")
def save_and_summarize():
agent.session.save("auto_save.json")
print("Session saved")
2. Theme Customization
(1) Built-in Themes
BASH
pi-agent config set theme dark
pi-agent config set theme light
pi-agent config set theme monokai
pi-agent config set theme solarized
pi-agent config set theme nord
(2) Switch in Interactive Mode
TEXT
📖 Display only
you> /theme dark
Theme switched to dark
(3) Custom Theme
Create ~/.pi-agent/themes/my_theme.yaml:
YAML
name: my_theme
background: "#1e1e2e"
foreground: "#cdd6f4"
accent: "#89b4fa"
error: "#f38ba8"
warning: "#fab387"
success: "#a6e3a1"
user_input: "#89dceb"
agent_output: "#cdd6f4"
tool_call: "#f9e2af"
code_block:
background: "#313244"
foreground: "#cdd6f4"
keyword: "#cba6f7"
string: "#a6e3a1"
comment: "#6c7086"
function: "#89b4fa"
Apply:
BASH
pi-agent config set theme my_theme
3. Output Format Customization
(1) Code Highlighting
YAML
display:
code_highlight: true
code_theme: "monokai"
line_numbers: true
wrap_lines: false
(2) Markdown Rendering
YAML
display:
markdown_render: true
table_render: true
link_clickable: true
(3) Tool Call Display
YAML
display:
show_tool_calls: true
tool_call_format: "compact" # compact | detailed | minimal
show_thinking: false
4. Font & Layout
YAML
display:
font_family: "JetBrains Mono"
font_size: 14
line_height: 1.5
show_header: true
show_token_count: true
show_timestamp: false
compact_mode: false
max_width: 120
FAQ
Q Keybinding conflicts?
A Pi Agent's shortcuts have lower priority than terminal shortcuts. If they conflict, modify Pi Agent's keybinding config.
Q Theme not applying?
A Make sure the theme filename matches the config. Custom themes must be in
~/.pi-agent/themes/.Q Emoji display issues in terminal?
A Ensure your terminal supports Unicode. Windows Terminal, iTerm2, and Alacritty all support it. Old cmd.exe may not.
Summary
- Default shortcuts cover common operations; customizable in keybindings.yaml
- 5 built-in themes; fully custom color schemes supported
- Output format configurable: code highlighting, Markdown rendering, tool call display
- Font and layout options optimize reading experience
Exercises
- Basic (Difficulty: ⭐): Switch between 3 built-in themes, pick your favorite.
- Intermediate (Difficulty: ⭐⭐): Create a custom theme with your preferred color scheme.
- Advanced (Difficulty: ⭐⭐⭐): Register shortcuts for one-key switching between "coding mode" and "reading mode" themes.