Asia/Shanghai
August 12, 2026

OpenCode Theme for Pi: One Palette, the Full TUI

把 OpenCode 配色带到 Pi:不只是换几个颜色

Mingjian Shao
OpenCode Theme for Pi: One Palette, the Full TUI
I wanted Pi to feel like the rest of my OpenCode-themed workspace, but a Pi theme is more than a terminal color preset.
My OpenCode Themes project started with Obsidian and Typora, then expanded to Ghostty. Those ports share one palette, but they solve different problems: writing, rendered Markdown, and terminal colors.Pi adds a fourth surface. It is a terminal-native coding agent with its own semantic UI. A useful theme must distinguish the user's message from tool output, a pending tool from a failed one, Markdown from source code, and one thinking level from another.That is why this port maps the full Pi theme contract instead of stopping at foreground, background, and ANSI colors.The visual source remains OpenCode's dark TUI palette:
RoleColor
Primary#fab283
Accent#9d7cd8
Secondary#5c9cf5
Success#7fd88f
Warning#e5c07b
Error#e06c75
Background#0a0a0a
Text#eeeeee
Warm orange leads the interface. Purple marks headings and high-reasoning states. Blue and cyan separate secondary structure. Green, yellow, and red keep their familiar status meanings.The theme covers Pi's complete semantic color system:
  • core UI borders, accents, status colors, and secondary text;
  • user messages, extension messages, selection, and scrollbar states;
  • pending, successful, and failed tool containers;
  • Markdown headings, links, code, quotes, rules, and list bullets;
  • added, removed, and contextual diff lines;
  • comments, keywords, functions, variables, strings, numbers, and types;
  • every Pi thinking level from off through max;
  • the separate Bash mode border.
The result stays recognizably OpenCode without flattening everything into the same orange accent.Download the theme and place it in Pi's global theme directory:
Bash
mkdir -p "$HOME/.pi/agent/themes"
curl -fsSL \
  https://raw.githubusercontent.com/nxxxsooo/opencode-themes/main/pi/opencode.json \
  -o "$HOME/.pi/agent/themes/opencode.json"
Then open /settings in Pi and select opencode.You can also try the repository copy without installing it:
Bash
pi --theme ./pi/opencode.json
Pi hot-reloads the active custom theme while you edit it, which makes small contrast adjustments pleasantly fast.The repository now contains themes for Obsidian, Typora, Ghostty, and Pi. The landing page has been updated with the Pi download and installation path as well.Paste this into a coding agent with shell access:
Text
Install the OpenCode theme for Pi from:
https://github.com/nxxxsooo/opencode-themes

Ask whether I want a global or project installation.
Back up any existing destination and ~/.pi/agent/settings.json.
Validate pi/opencode.json before copying it.
Install it as opencode.json in the correct Pi themes directory.
Ask before setting "theme": "opencode" in settings.json.
Preserve unrelated settings and verify the final JSON.
Never hardcode a user path; use $HOME.
我想让 Pi 和整个 OpenCode 主题工作区保持一致。但 Pi 主题不是简单换一组终端颜色。
OpenCode Themes 最早只有 Obsidian 和 Typora,后来加入了 Ghostty。它们使用同一套配色,但解决的是不同问题:写作、Markdown 渲染和终端 ANSI Color。Pi 是第四个场景。它是一个终端原生 Coding Agent,有自己的语义界面。一个真正可用的主题,需要区分用户消息和工具输出、等待中的工具和失败的工具、Markdown 和源代码,以及不同的 Thinking Level。所以这次不是只设置前景色、背景色和几个 ANSI Color,而是完整映射 Pi 的主题协议。视觉来源仍然是 OpenCode 默认的深色 TUI Palette:
角色颜色
Primary#fab283
Accent#9d7cd8
Secondary#5c9cf5
Success#7fd88f
Warning#e5c07b
Error#e06c75
Background#0a0a0a
Text#eeeeee
暖橙色负责主要交互,紫色用于标题和高 Thinking Level,蓝色与青色拆分次级结构,绿、黄、红继续承担大家熟悉的状态语义。这个主题覆盖了 Pi 完整的语义色彩系统:
  • 核心 UI 边框、强调色、状态色和次级文字;
  • 用户消息、扩展消息、选中状态和滚动条;
  • 等待、成功和失败三种工具容器;
  • Markdown 标题、链接、代码、引用、分隔线和列表;
  • Diff 的新增、删除和上下文;
  • 注释、关键字、函数、变量、字符串、数字和类型;
  • offmax 的所有 Pi Thinking Level;
  • 独立的 Bash Mode 边框。
最终效果仍然能一眼看出是 OpenCode,但不会把所有元素都粗暴地染成橙色。下载主题并放进 Pi 的全局主题目录:
Bash
mkdir -p "$HOME/.pi/agent/themes"
curl -fsSL \
  https://raw.githubusercontent.com/nxxxsooo/opencode-themes/main/pi/opencode.json \
  -o "$HOME/.pi/agent/themes/opencode.json"
然后在 Pi 中打开 /settings,选择 opencode也可以不安装,直接在仓库里试用:
Bash
pi --theme ./pi/opencode.json
Pi 会热更新当前启用的自定义主题,所以调整对比度和细节时反馈很快。现在仓库里已经有 Obsidian、Typora、Ghostty 和 Pi 四个版本。Landing Page 也加入了 Pi 的下载入口和安装说明。把下面这段交给一个有 Shell 权限的 Coding Agent:
Text
请从下面的仓库安装 Pi 的 OpenCode 主题:
https://github.com/nxxxsooo/opencode-themes

先问我是全局安装还是项目安装。
备份已有目标文件和 ~/.pi/agent/settings.json。
复制前验证 pi/opencode.json。
把它作为 opencode.json 安装到正确的 Pi themes 目录。
修改 settings.json 前先问我是否要设为默认主题。
保留所有无关设置,并验证最终 JSON。
不要写死用户目录,统一使用 $HOME。

For AI Agents

This post ships a machine-readable execution plan. Paste the prompt into OpenCode / Claude Code / Cursor / Codex CLI (any agent with shell + file write tools) and it will reproduce the setup with pre-flight checks. Chat-only LLMs without tools should refuse, per the embedded SAFETY clause.
Share this post:
Enjoy this post? Subscribe via RSS: English | 中文