Configuration file
~/.tg.json is a user-home state file. Theme Manager reads a missing or malformed file as defaults and preserves unknown keys when it writes known state. A file that exists but cannot be read or parsed (permission error, invalid JSON, not a JSON object) is never written over: commands that would save state fail with Refusing to overwrite … until the file is fixed or removed, so a transient failure cannot drop activeTheme or favorites.
| Field | Default / shape | Owner |
|---|---|---|
customThemes | string[] | Theme discovery during generation. |
lastGeneratedTheme | theme ID or null | Last theme generated by the generation flow. |
favoriteSeedColors | { color, variant }[] | Favorites flow; legacy string favorites migrate on read. |
lastUsedSeedColor | hex or null | Seed generation. |
lastUsedVariant | variant or null | Seed generation. |
activeTheme | theme ID or null | User-selected theme family; read by tman apply, which saves a configured fallback only when it is null. |
Writes use the shared same-directory temporary-file-plus-rename helper. This gives atomic replacement for the ordinary state-file path, but does not create backups or offer a global rollback.