Skip to content

Conversation

@ThanhNguyxn
Copy link

Summary

This PR adds support for the XDG Base Directory Spec as requested in #7.

Changes

Modified app/cli/fs/fs.go to check XDG_CONFIG_HOME environment variable before falling back to the home directory.

Behavior

Condition Directory Used
XDG_CONFIG_HOME set (production) $XDG_CONFIG_HOME/plandex/
XDG_CONFIG_HOME set (development) $XDG_CONFIG_HOME/plandex-dev/
XDG_CONFIG_HOME not set (production) ~/.plandex-home-v2/
XDG_CONFIG_HOME not set (development) ~/.plandex-home-dev-v2/

Backward Compatibility

Fully backward compatible - existing users without $XDG_CONFIG_HOME set will continue using ~/.plandex-home-v2/ with no changes.

Testing

Verified that the code compiles successfully. Manual testing recommended:

# Test 1: With XDG_CONFIG_HOME
export XDG_CONFIG_HOME=/tmp/xdg-test
plandex
# Should create /tmp/xdg-test/plandex/

# Test 2: Without XDG_CONFIG_HOME
unset XDG_CONFIG_HOME
plandex
# Should use ~/.plandex-home-v2/ (existing behavior)

Fixes #7

This adds support for the XDG Base Directory Spec by checking XDG_CONFIG_HOME
environment variable before falling back to the home directory.

If XDG_CONFIG_HOME is set:
- Production: uses /plandex/
- Development: uses /plandex-dev/

If XDG_CONFIG_HOME is not set, existing behavior is preserved:
- Production: uses ~/.plandex-home-v2/
- Development: uses ~/.plandex-home-dev-v2/

Fixes plandex-ai#7
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.

Make plandex use XDG configuration if it's available

1 participant