Summary
When running dwell setup capture (or a new dwell setup detect subcommand), automatically scan the system for existing dotfile management setups and report what is found — then offer to import/migrate into dwell.
Motivation
Users switching to dwell from other tools need a way to discover what they already have configured. Currently they must manually check for chezmoi, stow, yadm, bare git repos, and other setups. Auto-detection makes migration seamless.
What to detect
Existing dotfile managers
| Manager |
Detection |
Migration |
| chezmoi |
~/.local/share/chezmoi/ exists, or chezmoi source-path |
Copy dot_ prefixed files directly into dwell source dir |
| GNU Stow |
~/.stow dir or stow packages in ~/dotfiles/ |
Copy package files, preserve hierarchy |
| yadm |
~/.config/yadm/ exists, or yadm list |
Iterate tracked files, add via dwell add |
| bare git repo |
~/.dotfiles/ with git config status.showUntrackedFiles = no |
Add tracked files |
| dotbot |
install.conf.yaml or install.conf.json in common paths |
Parse config, add listed files |
| dotter |
~/.config/dotter/ exists, or .dotter/ in home |
Parse dotter.toml, add mapped files |
Manual dotfile patterns
Beyond specific tools, also detect:
~/dotfiles/ or ~/.dotfiles/ directories (common convention)
~/.config/ dirs that look like configs (already partially done by dwell)
- Shell rc files that
source external scripts from custom paths
- Existing
.gitconfig includes pointing to custom configs
Proposed design
dwell setup detect
dwell setup detect # Scan and report all found setups
dwell setup detect --json # Machine-readable output
dwell setup detect --migrate # Auto-import everything into dwell
Output format:
→ Detecting existing dotfile setups...
✓ chezmoi found at ~/.local/share/chezmoi (48 tracked files)
✓ yadm found at ~/.config/yadm (23 tracked files)
✓ bare git found at ~/.dotfiles (repository)
✓ dotter found at ~/.config/dotter (config present)
ℹ ~/dotfiles/ directory exists (15 files)
dwell setup detect --migrate
Auto-import detected setups into the dwell source directory:
→ chezmoi: importing 48 files...
✓ dot_bashrc, dot_gitconfig, dot_config/nvim/init.lua ...
→ yadm: importing 23 files...
✓ dot_zshrc, dot_ssh/config ...
→ done: 71 files imported from 2 setups
dwell setup detect integration with capture
When running dwell setup capture, also run detection and include results:
{
"captured_at": "...",
"detected_setups": {
"chezmoi": { "path": "~/.local/share/chezmoi", "file_count": 48 },
"yadm": { "path": "~/.config/yadm", "file_count": 23 }
}
}
Implementation notes
- Detection is read-only — never modifies existing setups
--migrate copies files, does not remove originals
- Uses
dwell add logic internally to ensure correct dot_ prefixing
- chezmoi: reuse existing
SourceDir::detect_chezmoi() method
- dotter: reuse existing
SourceDir::detect_dotter() method
- Stow: parse package dirs from
~/dotfiles/stow/ or ~/.stow/
- yadm: shell out to
yadm list -a if available
- bare git: check for
~/.dotfiles/.git with bare config
Acceptance criteria
Summary
When running
dwell setup capture(or a newdwell setup detectsubcommand), automatically scan the system for existing dotfile management setups and report what is found — then offer to import/migrate into dwell.Motivation
Users switching to dwell from other tools need a way to discover what they already have configured. Currently they must manually check for chezmoi, stow, yadm, bare git repos, and other setups. Auto-detection makes migration seamless.
What to detect
Existing dotfile managers
~/.local/share/chezmoi/exists, orchezmoi source-pathdot_prefixed files directly into dwell source dir~/.stowdir or stow packages in~/dotfiles/~/.config/yadm/exists, oryadm listdwell add~/.dotfiles/with git configstatus.showUntrackedFiles = noinstall.conf.yamlorinstall.conf.jsonin common paths~/.config/dotter/exists, or.dotter/in homedotter.toml, add mapped filesManual dotfile patterns
Beyond specific tools, also detect:
~/dotfiles/or~/.dotfiles/directories (common convention)~/.config/dirs that look like configs (already partially done by dwell)sourceexternal scripts from custom paths.gitconfigincludes pointing to custom configsProposed design
dwell setup detectOutput format:
dwell setup detect --migrateAuto-import detected setups into the dwell source directory:
dwell setup detectintegration with captureWhen running
dwell setup capture, also run detection and include results:{ "captured_at": "...", "detected_setups": { "chezmoi": { "path": "~/.local/share/chezmoi", "file_count": 48 }, "yadm": { "path": "~/.config/yadm", "file_count": 23 } } }Implementation notes
--migratecopies files, does not remove originalsdwell addlogic internally to ensure correctdot_prefixingSourceDir::detect_chezmoi()methodSourceDir::detect_dotter()method~/dotfiles/stow/or~/.stow/yadm list -aif available~/.dotfiles/.gitwith bare configAcceptance criteria
dwell setup detectscans and reports all common setupsdwell setup detect --jsonoutputs structured JSONdwell setup detect --migrateimports files into dwell sourcedot_prefix