Repository navigation
Export and import device settings as a JSON file #22929
Replies: 3 comments
|
Draft implementation: #23045 Two details changed from the post while building it. When the file carries a custom theme with the same ID as a local one, the file's version replaces the local theme without asking, and the import preview lists it as a replacement. "Follow system" also isn't a separate value, it's the inayayousfi directed the work and made every decision. |
|
Update after review on #23045: import now merges. Each value in the file that passes its check replaces the current one, and anything the file leaves out or sets wrongly keeps its current value, with a warning for the latter. Export writes every device setting, so a file still reproduces a whole setup. The file also names the theme instead of embedding custom theme definitions. Custom themes move with the existing per-theme export. inayayousfi directed the work and made every decision. |
|
Written and posted by Claude (Anthropic's AI assistant) on behalf of this account's owner, at their request. +1 from a Windows 11 desktop user (0.1.7 nightly). I'd like to move my whole T3 Code setup to a new PC without setting every option again by hand: device settings, favorites, default model, keybindings and the environment preferences such as the commit message style. One export file and one import with a preview, as proposed here and in #23045, would cover that. Please keep machine-bound data (keys, environment identity) out of the file, so two machines never share an identity. |
Uh oh!
There was an error while loading. Please reload this page.
Device settings live in the browser's localStorage (or in the desktop app's client-settings.json), so every new browser, hostname or machine starts from defaults. I use the web app on several machines and set the same preferences by hand on each one. This is a narrower follow-up to #6802, which asked for configuration files that can live in a dotfiles repo.
I'd like to add an export and an import next to the "Restore device defaults" button in Settings. Export downloads a JSON file. Import reads one back, shows what it is about to change, and applies it after confirmation. Is this direction wanted, and is the scope below acceptable?
What the file holds
Only values that differ from their defaults, so a file written today keeps working when a default changes later. It covers settings that describe how someone likes the client to behave, and nothing tied to one machine or to one environment's data:
ClientSettingsSchemakeys that are plain preferences (the 49 that Restore device defaults resets, pluslegacySidebarEnabled,planModeEnabled,fontSmoothing,sidebarThreadSortOrder,loadBalancingEnabledand the sevensnapShot*keys)serializeThemeFileLeft out are
onboardingCompletedAt,dismissedProviderUpdateNotificationKeys,browserProfilesandbrowserDefaultProfileId, the legacyfavorites,providerModelPreferencesandpullRequestMergeMethodOverrides, and the overrides keyed by project or environment (sidebarProjectGroupingOverrides,loadBalancingWeights). Server settings stay out as well, sincesettings.jsonalready gives them a file form.The file is a plain JSON object of setting names and values, with no format marker or version, so it stays easy to write by hand.
How import behaves
Import replaces. Every setting the file covers takes the file's value, or goes back to its default when the file leaves it out, and the nine excluded settings are never touched. Before anything is applied, a dialog lists each change with its current and new value. Keys the client doesn't recognize are ignored, and a known key whose value fails its schema is skipped. Both appear as warnings at the bottom of that dialog, so a file exported by another version still applies everything it can instead of being rejected.
Custom themes are added or updated, never removed. When an embedded theme has the same ID as a local one with different colors, the dialog offers the same "Update existing" or "Keep both" choice as the theme import.
Settings go through
persistClientSettingsPatchand appearance through theuseThemesetters, so the desktop app's client-settings.json follows without extra work. Mobile doesn't readClientSettings, so it's out of scope.Questions
Related
inayayousfi directed the work and made every decision.
Claude Opus 5.5, running in Claude Code through T3 Code, carried inayayousfi's decisions out.
All reactions