Skip to content

Feature request: Symlink-based profile switching for config directories #29

@bjesuiter

Description

@bjesuiter

I have a setup where I use Bridle to manage OpenCode configuration profiles. My configuration directory (~/.config/opencode) is managed through a dotfiles repository using stow.

Current situation:

  • Bridle stores profiles in a dedicated directory (e.g., ~/.config/bridle/profiles/)
  • Each profile contains OpenCode configuration
  • ~/.config/opencode should point to the currently active profile

Symlink structure:

~/.config/                          # stow symlinks → ~/jb-home/home/.config/
└── opencode/                       # current active profile
    ├── config.json
    └── ...

~/.config/bridle/profiles/          # profile storage (under git in jb-home)
├── default/
│   ├── config.json
│   └── ...
├── work/
│   ├── config.json
│   └── ...
└── personal/
    ├── config.json
    └── ...

The problem:

  1. When ~/.config/opencode is a regular directory under git control, every profile change results in git detecting changes and creating commits for the same files repeatedly.

  2. When ~/.config/opencode is a symlink to the profile directory, Bridle's smart detection of config updates sees the symlink change and interprets this as the user having modified the configuration externally. It then deletes its own profile files when trying to sync, causing data loss.

Desired behavior:
When the OpenCode config directory is a symlink, Bridle should:

  • Detect that it's a symlink
  • Simply replace the symlink target when switching profiles
  • Not attempt to sync or compare contents with the profile storage
  • Keep the actual profile data safely stored in its profile directory

Proposed solution:
Add an option to enable "symlink mode" for config directories. When enabled:

  1. Bridle checks if the config directory is a symlink
  2. If so, instead of syncing/copying files, it just updates the symlink target
  3. This keeps git history clean (all changes happen in the profile storage directory)
  4. No risk of Bridle deleting profile data due to external changes

This would be useful for anyone using:

  • Stow or similar dotfile managers
  • Git-controlled configuration repositories
  • A setup where the config directory needs to be shared or symlinked

Would this feature be feasible to implement? I'm happy to discuss further or contribute if guidance is provided.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions