Files and state
~/.tg.json stores generation state plus one user-selected activeTheme. Light/dark mode is runtime state, not a second theme identity. Missing or malformed state falls back to defaults rather than preventing the command from starting; legacy favorite data is migrated as configuration is loaded. A file that exists but cannot be read or parsed is never written over, so a transient failure cannot replace the user’s state with defaults.
Included custom definitions live below the installed package root’s themes/ directory. Generated sources are separate from tool-owned live destinations, which lets selection/application update stable pointers or copies without regenerating every file.
Shared text writes and copies use a same-directory temporary file followed by rename, preserving atomic replacement on the target filesystem. Theme Manager does not create backups and has no global rollback. Packaged targets and privileged adapter operations own their own exceptions; inspect the catalogue before relying on a particular filesystem guarantee.