The open source coding agent.
TypeScript
feat(tui): theme override with OPENCODE_THEME
adamelmorebb17d14665de
diff --git a/packages/tui/cmd/opencode/main.go b/packages/tui/cmd/opencode/main.goindex 73fd37ed984..8e387d21b2d 100644--- a/packages/tui/cmd/opencode/main.go+++ b/packages/tui/cmd/opencode/main.go@@ -70,7 +70,6 @@ func main() {}()// Create main context for the application-app_, err := app.New(ctx, version, appInfo, modes, httpClient, model, prompt, mode)if err != nil {panic(err)@@ -79,7 +78,6 @@ func main() {program := tea.NewProgram(tui.NewModel(app_),tea.WithAltScreen(),- // tea.WithKeyboardEnhancements(),tea.WithMouseCellMotion(),)diff --git a/packages/tui/internal/app/app.go b/packages/tui/internal/app/app.goindex a481cd10198..0c90257b3cd 100644--- a/packages/tui/internal/app/app.go+++ b/packages/tui/internal/app/app.go@@ -3,6 +3,7 @@ package appimport ("context""fmt"+ "os""path/filepath""sort""strings"@@ -103,6 +104,10 @@ func New(if configInfo.Theme != "" {appState.Theme = configInfo.Theme}+ themeEnv := os.Getenv("OPENCODE_THEME")+ if themeEnv != "" {+ appState.Theme = themeEnv+ }var modeIndex intvar mode *opencode.Mode