feat(settings): honor XDG base directories for config and data on Linux (#226) - #284
Open
innocarpe wants to merge 2 commits into
Open
feat(settings): honor XDG base directories for config and data on Linux (#226)#284innocarpe wants to merge 2 commits into
innocarpe wants to merge 2 commits into
Conversation
…ux (lessweb#226) When XDG_CONFIG_HOME/XDG_DATA_HOME are set on Linux, settings.json lives in $XDG_CONFIG_HOME/deepcode and data (projects, logs, machine-id, skills, update state, AGENTS.md) in $XDG_DATA_HOME/deepcode. Falls back to ~/.deepcode otherwise, so existing setups are unaffected. (cherry picked from commit ada7144231c26a7b1fdac5beeba0543d40b581b1)
(cherry picked from commit 13ddf8a6fd2cc05f8dbf494e6441d897d3147bf7)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
$XDG_CONFIG_HOME/$XDG_DATA_HOMEare set:$XDG_CONFIG_HOME/deepcode(settings.json)$XDG_DATA_HOME/deepcode(projects, logs, machine-id, skills, update state, userAGENTS.md)~/.deepcode— existing setups are unaffected.Why
Issue #226: Linux users who follow the XDG spec expect config in
~/.configand data in~/.local/share, not a hidden~/.deepcodedirectory. This also makes config/data portable and respects common backup/cleanup tooling.Changes
packages/core/src/settings.ts: addgetUserConfigDir()/getUserDataDir()and routegetUserSettingsPath()through the config dir.packages/core/src/index.ts: export the new helpers.getUserDataDir():session.ts(projects, user skills, user AGENTS.md),openai-client.ts(machine-id),error-logger.ts/debug-logger.ts(logs),cli.tsx(sessions-index),update-check.ts(state).packages/vscode-ide-companion/src/extension.ts: usegetUserSettingsPath().packages/core/src/tests/settings-and-notify.test.ts: test for XDG env handling + fallback.Validation
npm run typecheck✅npm test— new XDG tests pass ✅Closes #226