Creating themes
One JSON file, 51 color tokens, hot reload. Restyle every part of pi's TUI.
Anatomy of a theme
A pi theme is a single JSON file. Define reusable colors in vars, then assign all 51 required
tokens in colors (only thinkingMax is optional). Values can be hex codes, xterm-256 palette
indices (0–255), references to your vars, or an empty string to fall back to the terminal
default.
{
"$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
"name": "my-theme",
"vars": {
"bg": "#0a0a0a",
"accent": "#fab283",
"green": "#7fd88f",
"red": "#e06c75"
},
"colors": {
"accent": "accent",
"border": "#1f1f1f",
"success": "green",
"error": "red",
"text": "#eeeeee",
"userMessageBg": "#141414",
"toolDiffAdded": "green",
"toolDiffRemoved": "red"
}
}
(Abbreviated — the $schema line gives you completion and validation for all 51 tokens in your
editor.)
The token groups
| Group | Tokens | Styles |
|---|---|---|
| Core UI | 11 — accent, border, success, error, text, muted… | Chrome, borders, status colors |
| Messages & tools | 11 — userMessageBg, toolSuccessBg, toolTitle… | Chat bubbles and tool-call blocks |
| Markdown | 10 — mdHeading, mdLink, mdCode, mdQuote… | Rendered model output |
| Diffs & syntax | 12 — toolDiffAdded/Removed/Context + 9 syntax colors | Edit previews and code |
| Thinking levels | 7 — thinkingOff … thinkingXhigh (+ optional thinkingMax) | The reasoning-effort indicator |
| Bash mode | 1 — bashMode | The ! shell prompt |
Workflow
- Copy an existing theme — the gallery links to real files, or start from
pi’s built-in
dark/light. - Save yours to
~/.pi/agent/themes/my-theme.json(or.pi/themes/in a project). - Run pi and pick it via
/settings, or set"theme": "my-theme"insettings.json. - Edit the file — custom themes hot-reload while pi is running, so you can tune colors live.
You can also try a theme file directly without installing it:
pi --theme ./my-theme.json
Tips from the themes in our gallery
- Keep
muted/dimgenuinely low-contrast — most of pi’s chrome uses them, and loud values make the UI shouty. - Diff colors (
toolDiffAdded/toolDiffRemoved) are the ones you’ll see most while coding; test them against yourtoolSuccessBg. - xterm indices are handy if you want the theme to inherit the user’s terminal palette instead of forcing exact hexes.
Share it
Put the JSON in a package’s themes/ directory, publish, and it installs with everything else —
see Publishing packages. Then submit it here and
we’ll render a live preview in the gallery from your actual theme file.
📖
This is a community quickstart. The canonical reference is the
official pi documentation — always trust it over us
if the two disagree.