Themes

Chọn theme có sẵn hoặc tự tạo theme riêng cho OpenCode.


Tổng quan

Với OpenCode bạn có thể chọn từ nhiều themes tích hợp sẵn, dùng theme tự động theo terminal, hoặc tự định nghĩa theme riêng.

Mặc định, OpenCode dùng theme opencode.


Yêu cầu terminal

Để themes hiển thị đúng màu sắc, terminal của bạn phải hỗ trợ truecolor (24-bit):

# Kiểm tra hỗ trợ truecolor
echo $COLORTERM
# Kết quả mong đợi: truecolor hoặc 24bit

# Bật thủ công nếu cần
export COLORTERM=truecolor

Hầu hết terminal hiện đại đều hỗ trợ: iTerm2, Alacritty, Kitty, Windows Terminal, GNOME Terminal.


Built-in themes

TênMô tả
systemTự động theo terminal theme
opencodeTheme mặc định của OpenCode
tokyonightDựa trên Tokyonight theme
everforestDựa trên Everforest theme
catppuccinDựa trên Catppuccin theme
catppuccin-macchiatoCatppuccin Macchiato variant
gruvboxDựa trên Gruvbox theme
kanagawaDựa trên Kanagawa theme
nordDựa trên Nord theme
matrixHacker-style green on black
one-darkDựa trên Atom One Dark theme
ayuDựa trên Ayu dark theme

Cấu hình

Chọn theme

{
  "$schema": "https://opencode.ai/config.json",
  "theme": "catppuccin"
}

Hoặc dùng lệnh trong TUI:

/theme

Theme mặc định

{
  "theme": "catppuccin-macchiato"
}

Theme theo terminal

{
  "theme": "system"
}

Custom themes

Bạn có thể tự tạo theme riêng theo hướng dẫn.