OpenCode Themes
OpenCode supports multiple theme systems; you can choose built-in themes, auto-adapt to your terminal theme, or fully customize a theme for a consistent and comfortable terminal experience.
The simplest way is to type the /themes command in the TUI input box:
/themes

Then select your favorite theme in the pop-up window:

Terminal requirements
To ensure themes display the full color range correctly, your terminal must support true color (24-bit color)。
- Check support:
echo $COLORTERM
The output should be:
truecolor
或
24bit
- Enable true color:
export COLORTERM=truecolor
-
Common supporting terminals:
-
iTerm2
-
Alacritty
-
Kitty
-
Windows Terminal
-
GNOME Terminal (newer versions)
If the terminal doesn't support true color, the theme will fall back to 256 colors, which may cause color distortion.
Built-in themes
OpenCode has several built-in themes ready to use:
| Theme name | Description |
|---|---|
| system | Auto-adapt to terminal theme |
| tokyonight | Tokyonight style |
| everforest | Everforest style |
| ayu | Ayu dark theme |
| catppuccin | Catppuccin theme |
| catppuccin-macchiato | Catppuccin variant |
| gruvbox | Gruvbox style |
| kanagawa | Kanagawa style |
| nord | Nord style |
| matrix | Hacker style (green text on black background) |
| one-dark | Atom One Dark |
system theme (recommended)
system The theme automatically adapts to your terminal color scheme:
- Generate grayscale levels based on the terminal background
- Use ANSI standard colors
- Keep the terminal's default text and background
Suitable for:
- Users who use custom terminal themes
- Users who want all terminal tools to have a unified style
Using themes
Method 1: Select a theme in the TUI
/themes

Method 2: Configure via a config file
tui.json
{
"$schema": "https://opencode.ai/tui.json",
"theme": "tokyonight"
}
Custom themes
OpenCode supports fully custom themes defined via JSON.
Theme load priority
- Built-in themes
- User directory: ~/.config/opencode/themes/
- Project directory: .opencode/themes/
- Current directory: ./.opencode/themes/
Later-loaded themes override earlier ones.
creating themes
User-level themes:
mkdir -p ~/.config/opencode/themes
vim ~/.config/opencode/themes/my-theme.json
Project-level themes:
mkdir -p .opencode/themes
vim .opencode/themes/my-theme.json
Theme format description
The following formats are supported:
- Hexadecimal color: #ffffff
- ANSI color: 0-255
- Color reference: primary
- Light/dark mode:
{
"dark": "#000000",
"light": "#ffffff"
}
- Inherit terminal default:
"text": "none"
Complete example
my-theme.json
{
"$schema": "https://opencode.ai/theme.json",
"defs": {
"bg": "#1e1e2e",
"fg": "#cdd6f4",
"primary": "#89b4fa",
"accent": "#f38ba8",
"success": "#a6e3a1",
"warning": "#f9e2af"
},
"theme": {
"primary": {
"dark": "primary",
"light": "#005f87"
},
"accent": {
"dark": "accent",
"light": "#d7005f"
},
"background": {
"dark": "bg",
"light": "#ffffff"
},
"text": {
"dark": "fg",
"light": "#000000"
},
"border": {
"dark": "#313244",
"light": "#cccccc"
},
"syntaxKeyword": {
"dark": "primary",
"light": "#0000ff"
},
"syntaxString": {
"dark": "success",
"light": "#008000"
},
"syntaxComment": {
"dark": "#6c7086",
"light": "#999999"
}
}
}
Summary
The OpenCode theme system has the following features:
- Supports built-in themes, ready to use out of the box
- Supports system for automatic terminal adaptation
- Supports JSON custom themes
- Supports multi-level override mechanism
If you pursue the ultimate experience, it is recommended:
- Enable truecolor in the terminal
- Prefer using the system theme or a custom theme