Repository navigation
Replies: 1 comment
|
google-gemini/gemini-cli#1825 (comment)
It's 2026 and we're still debating this. Outstanding. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Idea: respect the XDG Base Directory spec on Linux instead of a single ~/.dsh root
The problem
dshkeeps everything under one hardcoded root:~/.dshon every platform. Configuration, API keys, raw session transcripts, SQLite indexes, profiles, and skills all share one directory. The XDG Base Directory Specification defines a separate location for each of those classes, and the pre-release stance of this repo makes now the cheapest possible time to adopt it. A tagged release and a pile of community docs pointing at~/.dshwould turn this from a small change into a migration.What XDG says
The spec splits user files by purpose:
$XDG_CONFIG_HOME$HOME/.config/etc$XDG_DATA_HOME$HOME/.local/share/usr/share$XDG_STATE_HOME$HOME/.local/state/var/lib$XDG_CACHE_HOME$HOME/.cache/var/cache$XDG_RUNTIME_DIRpam_systemd0700Mixing those classes in one directory has real costs:
$HOMEis the user's namespace. Each app that creates its own dot-directory adds permanentls -anoise the user cannot reorganize without breaking the app..credentials.yamland raw session logs are sensitive.settings.yamland profiles are shareable. Splitting config from state lets users apply different encryption, permission, and sync policies per class.Current behavior
defaultDshHome()isjoin(homedir(), '.dsh')with no platform split: packages/util/home-paths/src/index.ts:60-62. Resolution precedence is an explicit configured path, then$DSH_HOME, then that default. Everything lands under the one root:settings.yaml,.credentials.yaml,.env,cordis.patch.yml,profiles/,sessions/,skills/, and the SQLite query database. The default JSONL persistence root isdshHomePath('sessions'): packages/bundle/base/cordis.patch.yml:101.Why now
The root AGENTS.md is explicit: pre-release means "foundation over blast radius". Rename freely, reject old on-disk formats,
SESSION_FORMAT_VERSIONstays at0with no compatibility promise. Every month of preview accumulates docs, tutorials, and tooling that point at~/.dsh, so the migration cost grows monotonically. Today it is a rename. After the first tagged release it becomes a migration story with legacy fallbacks.Precedent
OpenCode, the closest peer in this space, already resolves its paths through the
xdg-basedirlibrary at packages/core/src/global.ts:3-14:The library's own README is blunt about scope: XDG is a Linux convention. On macOS and Windows you follow the platform's own conventions, and it recommends
env-pathsfor cross-platform resolution. I think that split is right fordshtoo. Linux gets the XDG layout, and the other platforms can get their native paths either in the same change or later, without one blocking the other.Proposal
Split the home into XDG classes on Linux and keep
$DSH_HOMEas the single-root collapse override, so nothing that works today breaks:settings.yaml,.credentials.yaml,.env,cordis.patch.yml,profiles/,skills/$XDG_CONFIG_HOME/dsh/, default~/.config/dsh/sessions/transcripts and attachments,storage/$XDG_DATA_HOME/dsh/, default~/.local/share/dsh/$XDG_STATE_HOME/dsh/, default~/.local/state/dsh/$XDG_CACHE_HOME/dsh/, default~/.cache/dsh/$XDG_RUNTIME_DIR/dshResolution precedence, highest first: an explicit configured path, then
$DSH_HOMEwith its current single-root semantics, then the XDG split on Linux, then the platform convention elsewhere. The change should be contained inhome-pathsplus the default persistence and query roots in the base bundle patch, so most packages keep using the same path API.Open questions:
.credentials.yamlbelong in config, where a dotfiles repo picks it up like.env, or in state, where it stays machine-local like session history? I lean config, but it is a policy question more than a technical one.data/reposanddata/log. The SQLite index is derived state.~/.dshbe read as a legacy fallback with a warning, or dropped outright? Given the pre-release stance I would drop it, but a one-line warning during preview costs nothing.Alternatives considered
$DSH_HOMEonly. Today's behavior. It pushes the configuration burden onto every user for something the ecosystem already standardizes, and it does nothing for macOS and Windows.$XDG_CONFIG_HOMEonly. The common half-measure. It still mixes session logs and credentials into config, which defeats the backup and encryption separation that makes XDG worth doing at all.All reactions