Skip to content

fix: Respect XDG_CONFIG_HOME and XDG_CACHE_HOME environment variables#146

Open
ruiwarn wants to merge 2 commits intotobi:mainfrom
ruiwarn:main
Open

fix: Respect XDG_CONFIG_HOME and XDG_CACHE_HOME environment variables#146
ruiwarn wants to merge 2 commits intotobi:mainfrom
ruiwarn:main

Conversation

@ruiwarn
Copy link

@ruiwarn ruiwarn commented Feb 9, 2026

Description

This PR fixes #132 by adding proper support for XDG Base Directory Specification.

Changes

  • Added XDG_CONFIG_HOME support in getConfigDir() for index.yml location
  • Added XDG_CACHE_HOME support for model cache directory in llm.ts
  • Added verify-xdg.ts test script to validate XDG behavior

Testing

Verified that:

  • ✅ Config file (index.yml) is written to $XDG_CONFIG_HOME/qmd/ when set
  • ✅ Cache file (index.sqlite) is written to $XDG_CACHE_HOME/qmd/ when set
  • ✅ Falls back to default ~/.config/qmd/ and ~/.cache/qmd/ when XDG vars not set
  • QMD_CONFIG_DIR override still works (takes precedence)

Fixes #132

王瑞 and others added 2 commits February 9, 2026 10:36
- Add XDG_CONFIG_HOME support in getConfigDir() for index.yml location
- Add XDG_CACHE_HOME support for model cache directory
- Add verify-xdg.ts test script to validate XDG behavior

Fixes tobi#132
@seanmozeik
Copy link

Please merge, I need this for Docker security - my root file system is read only.

@HenryLoenwind
Copy link

With openclaw affected by this, this will blow up...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: qmd collection add ignores XDG_CONFIG_HOME, writes index.yml to default path

3 participants