Skip to content

app: custom themes from ~/.config/opencode/themes are not listed in the GUI theme picker #54235

Open

Description

@EuCaue

Summary

Custom theme files placed in ~/.config/opencode/themes/*.json are correctly discovered and listed by the TUI, but the desktop/web UI never loads them: its theme picker lists only the themes embedded in packages/ui/src/theme/themes/. The UI exposes a registerTheme() extension point in packages/ui/src/theme/context.tsx, but nothing calls it, so user-defined desktop themes (the desktop-theme.json format used by https://opencode.ai/theme/) cannot be used in the GUI.

Environment

  • opencode version: 2.0.26
  • OS: Fedora 44 (Linux 7.2.8-200.fc44.x86_64 x64)
  • Terminal: ghostty (custom theme is written for the GUI, not the TUI)
  • Shell: zsh
  • Install/channel: release (latest)
  • Active plugins: @dietrichgebert/ponytail, superpowers (local git install)

Reproduction

  1. Create a valid desktop theme file with name/id/light/dark (palette + overrides), e.g. export it from https://opencode.ai/theme/
  2. Save it as ~/.config/opencode/themes/adwaita.json
  3. Open the desktop app, open settings → theme picker
  4. Theme does not appear in the list (only built-in themes)

Expected Behavior

Custom themes in the global themes directory (~/.config/opencode/themes/*.json, and project .opencode/themes/) should show up in the GUI theme picker, like they already do in the TUI via /themes.

Actual Behavior

The picker shows only embedded themes. No error is shown; the file is silently ignored.

Observed in the code (tag v2.0.26):

  • packages/tui/src/theme/discovery.ts — TUI discovers themes/*.json in Global.Path.config and .opencode/ dirs ✔
  • packages/ui/src/theme/context.tsx — GUI ids() list comes from import.meta.glob("./themes/*.json") (embedded only); registerTheme is exported but has no callers anywhere in the repo ✖

Additional Context

  • A single file that satisfies both formats (TUI defs/theme keys and desktop name/id/light/dark) is accepted by the TUI but ignored by the GUI, so swapping file locations does not help.
  • Request: make the app read the same themes directories as the TUI (or call registerTheme for custom files found at startup), so https://opencode.ai/theme/ exports are usable in the GUI.
  • Feature is highly desirable for the GUI since the theme tool outputs the desktop format.

Activity

  1. opencode-agent commented on Oct 10, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed write-up and for tracing it to registerTheme! You're asking for the desktop and web app to load custom theme files from ~/.config/opencode/themes/ and .opencode/themes/, as the TUI already does, so themes exported from https://opencode.ai/theme/ can be picked in the GUI. Maintainers will consider it.

    Related:

    This can't be done with a plugin for now, because plugins can only reach themes in the TUI, not in the desktop or web app.

  2. LeonMueller-OneAndOnly commented on Oct 12, 2026

    @LeonMueller-OneAndOnly
    Contributor

    This would be a very welcome addition!

  3. r4mp commented on Oct 13, 2026

    @r4mp

    Still present in 2.0.28, and also on macOS (26.2, arm64), so this isn't
    Linux-specific.

    One addition that may help rule out the format question: I used an
    unmodified copy of the built-in default theme as a negative control.
    I extracted the default theme object from the shipped opencode-cli
    binary, wrote it verbatim to ~/.config/opencode/themes/zztest.json,
    and fully quit and restarted the desktop app. It does not appear in the
    picker either.

    Since that file is byte-for-byte a theme the application itself ships
    and accepts, this rules out schema, format and validation problems
    entirely — the directory is simply never read. That matches your finding
    that registerTheme has no callers: the string "themes" does not occur
    anywhere in the shipped app.asar, while the directory scan is present
    in opencode-cli.

    Two smaller points:

    • Setting theme.name in ~/.config/opencode/cli.json to a custom theme
      silently falls back to a built-in theme. No warning, no toast, and
      nothing in ~/.local/share/opencode/log/. Surfacing an "unknown theme"
      hint would have made this self-diagnosable.
    • The docs at https://opencode.ai/v2/docs/themes/ describe
      ~/.config/opencode/themes/ as the global theme directory without
      noting that this applies to the terminal client only. Until feat(app): discover TUI themes in Desktop #53041
      lands, a sentence there would save people the debugging round-trip.

    Happy to see #53041 merged — it would make existing TUI-format files work
    in the GUI unchanged.

  4. abulak9999-star commented on Oct 21, 2026

    @abulak9999-star

    YES please add this
    the text is full white is burning my eyes, it should be hsv (0, 0%, 80%)
    it would be nice if we can make the bold text has different color also

  5. dluc commented on Oct 28, 2026

    @dluc

    This would be a very welcome addition!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions