Skip to content

Automatically assign themes to OpenCode based on the LLM provider/model you're using

Notifications You must be signed in to change notification settings

Jos-few43/opencode-model-themes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OpenCode Model Theme Manager

Automatically assign themes based on the LLM provider/model you're using across multiple code editors:

  • OpenCode - Automatic theme switching
  • VS Code - Complete theme extensions for each provider
  • Claude Code - Model-aware environment configuration

Demo

Automatic Theme Switching:

# Launch with Claude - Orange theme applied
$ opencode -m anthropic/claude-sonnet-4-5
🎨 Theme: Anthropic (Orange) β€’ Model: claude-sonnet-4-5

# Launch with Gemini - Yellow theme applied
$ opencode -m google/gemini-pro
🎨 Theme: Google (Yellow) β€’ Model: gemini-pro

# Launch with local Qwen - Purple theme applied
$ opencode -m ollama/qwen2.5-coder
🎨 Theme: Ollama (Purple) β€’ Model: qwen2.5-coder

Theme Preview:

Provider Color Scheme Primary Color Use Case
🟠 Anthropic Orange warmth #FF6B35 Claude models
🟑 Google Yellow bright #F4B400 Gemini models
πŸ”΄ xAI Dark + Red #FF1744 Grok models
πŸ”΅ Perplexity Light Blue #4FC3F7 Sonar models
🟒 OpenAI Green tech #10A37F GPT models
πŸ”· DeepSeek Cyan tech #00BCD4 DeepSeek models
🟣 Ollama Purple local #9C27B0 Local models
🟑 Groq Gold speed #FFD700 Fast inference

Editor Support

🎨 OpenCode

Full theme switching with automatic model detection and 8 pre-configured provider themes.

Installation: Copy to ~/.config/opencode/ and use the wrapper script.

πŸ“– OpenCode Setup Guide

🎭 VS Code

Complete VS Code theme extensions for each AI provider with syntax highlighting, UI colors, and git decorations.

Installation: ./scripts/install-vscode-themes.sh --all

πŸ“– VS Code Setup Guide

βš™οΈ Claude Code

Model-aware environment configuration using SessionStart hooks. Sets environment variables and customizes terminal prompts.

Installation: ./scripts/setup-claude-code.sh

πŸ“– Claude Code Setup Guide

Overview

This project provides scripts and theme configurations to dynamically switch your code editor's visual theme based on which AI model you're working with. Each provider gets a unique color scheme for better visual context and brand recognition.

Features

  • Multi-editor support - OpenCode, VS Code, and Claude Code
  • Automatic theme switching based on model provider
  • 8 pre-configured themes for major AI providers
  • VS Code theme extensions with full syntax highlighting
  • Claude Code hooks for environment customization
  • Easy model addition with helper scripts
  • Environment variable support for flexibility
  • Extensible - add your own providers and themes

Supported Providers

Provider Theme Color Example Model
Anthropic (Claude) Orange claude-sonnet-4-5
Google (Gemini) Yellow gemini-pro
xAI (Grok) Dark/Red grok-1
Perplexity Light Blue sonar-reasoning
OpenAI (GPT) Green gpt-4
DeepSeek Cyan deepseek-coder
Ollama/Local Purple qwen2.5-coder
Groq Gold mixtral-8x7b

Quick Start

Choose your editor:

OpenCode Installation

# Clone or copy to your config directory
cp -r opencode ~/.config/

# Add the main script to your PATH
mkdir -p ~/bin
cp ~/.config/opencode/scripts/opencode-model-theme ~/bin/opencode
chmod +x ~/bin/opencode

# Ensure ~/bin is in your PATH
export PATH="$HOME/bin:$PATH"

OpenCode Usage

# Launch OpenCode with automatic theme selection
opencode -m anthropic/claude-sonnet-4-5    # Uses orange theme
opencode -m google/gemini-pro              # Uses yellow theme
opencode -m ollama/qwen2.5-coder          # Uses purple theme

# Force a specific theme regardless of model
opencode -t deepseek -m anthropic/claude-opus-4

# List available themes
opencode -l

# Add a new model
~/.config/opencode/scripts/opencode-add-model provider/model-name "Display Name"

VS Code Usage

# Generate themes from OpenCode theme files
python3 scripts/generate-vscode-themes.py

# Install all themes
./scripts/install-vscode-themes.sh --all

# Install specific themes
./scripts/install-vscode-themes.sh anthropic google openai

# Then in VS Code: Cmd/Ctrl+Shift+P β†’ "Color Theme" β†’ Select your AI provider theme

Claude Code Usage

# Setup for current project
./scripts/setup-claude-code.sh --local

# Setup globally for all projects
./scripts/setup-claude-code.sh --global

# The hook runs automatically on SessionStart
# Check environment variables:
echo $AI_PROVIDER        # e.g., "anthropic"
echo $AI_MODEL_THEME     # e.g., "Anthropic Claude"
echo $AI_THEME_COLOR     # e.g., "#FF6B35"

Project Structure

opencode-model-themes/
β”œβ”€β”€ README.md                           # This file
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ opencode-add-model             # Helper to add new models (OpenCode)
β”‚   β”œβ”€β”€ opencode-model-theme           # Main wrapper script (OpenCode)
β”‚   β”œβ”€β”€ generate-vscode-themes.py      # Generate VS Code theme extensions
β”‚   β”œβ”€β”€ install-vscode-themes.sh       # Install VS Code themes
β”‚   └── setup-claude-code.sh           # Setup Claude Code integration
β”œβ”€β”€ themes/                             # OpenCode theme JSON files
β”‚   β”œβ”€β”€ README.md                      # Theme documentation
β”‚   β”œβ”€β”€ anthropic.json                 # Claude/Anthropic theme
β”‚   β”œβ”€β”€ deepseek.json                  # DeepSeek theme
β”‚   β”œβ”€β”€ google.json                    # Gemini/Google theme
β”‚   β”œβ”€β”€ groq.json                      # Groq theme
β”‚   β”œβ”€β”€ ollama.json                    # Ollama/Local models theme
β”‚   β”œβ”€β”€ openai.json                    # OpenAI/GPT theme
β”‚   β”œβ”€β”€ perplexity.json                # Perplexity theme
β”‚   └── xai.json                       # xAI/Grok theme
β”œβ”€β”€ vscode-themes/                      # Generated VS Code extensions
β”‚   β”œβ”€β”€ vscode-anthropic-theme/
β”‚   β”œβ”€β”€ vscode-google-theme/
β”‚   β”œβ”€β”€ vscode-openai-theme/
β”‚   └── ... (8 themes total)
└── claude-code/                        # Claude Code integration
    β”œβ”€β”€ README.md                      # Claude Code setup guide
    └── hooks/
        └── session-start.sh           # SessionStart hook script

Adding Custom Themes

  1. Create a theme file in ~/.config/opencode/themes/yourprovider.json
  2. Edit scripts/opencode-model-theme and add your provider to the PROVIDER_THEMES mapping
  3. Use it: opencode -m yourprovider/model-name

See themes/README.md for detailed theme creation instructions.

Environment Variables

  • OPENCODE_MODEL - Set default model (format: provider/model-id)
  • OPENCODE_THEME - Force a specific theme
  • OPENCODE_CONFIG - Custom config file path

Contributing

Contributions welcome! To add a new provider theme:

  1. Create the theme JSON file
  2. Add provider mapping to the script
  3. Test with a model from that provider
  4. Submit a pull request

License

MIT

Related Projects


Note: This is a community project and is not officially affiliated with OpenCode.

About

Automatically assign themes to OpenCode based on the LLM provider/model you're using

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors