CLI tool to manage files and directories via symlinks, backed by your own Git repository.
init: configure a remote Git repository and create local storage/config.link: move files/directories into storage and place a symlink at the original path.unlink: restore files/directories to their original path and remove the symlink.status: show current state (including Git status).push: commit and push pending changes to the remote repository.doctor: verify setup health (config, paths, Git remote).reset: restore all tracked files and remove dotfiles storage and config entirely.uiorstatus --web: start a local, read-only control panel in the browser.
- Node.js 20+
- macOS or Linux
npm install -g dotfilesnpx dotfiles --helpFor local development in this repository:
npm install
npm run buildThen run locally with:
npx . --helpProvide your own Git remote during setup:
dotfiles init --remote git@github.com:username/dotfiles-backup.gitOptional paths:
dotfiles init --remote <git-url> --storage <path> --config <path>Defaults:
- Config: platform-specific via
env-paths(for example Linux~/.config/dotfiles/config.json) - Storage: platform-specific via
env-paths(for example Linux~/.local/share/dotfiles) - Repository:
<storage>/repo
When using a custom --config path, init prints an export hint so you do not have to pass --config on every subsequent command:
To avoid passing --config on every command, add to your shell config:
export DOTFILES_CONFIG=/path/to/config.json
All commands respect the DOTFILES_CONFIG environment variable as a fallback between --config and the default path.
dotfiles link ~/.zshrc ~/.gitconfigPer path this will:
- Move the item to
<repo>/<absolute-path-without-leading-slash>. - Create a symlink at the original location to that new location.
- Register the item in
.dotlinks.jsoninside the repository.
dotfiles unlink ~/.zshrcPer path this will:
- Verify the original location is a symlink.
- Verify the symlink target is inside the storage repository.
- Move the item back to the original location.
- Remove the entry from
.dotlinks.json.
dotfiles status
dotfiles status --jsondotfiles push
dotfiles push --message "add work config"Stages all changes in the repository, commits, and pushes to the configured remote. If the repository is already clean, it exits without doing anything.
dotfiles doctorVerifies:
- Config source (flag,
$DOTFILES_CONFIG, or default) - Config file exists and is valid
- Storage root directory exists
- Repo directory exists
- Repo is a valid Git repository
- Git remote matches the configured value
For symlink health, use dotfiles status.
dotfiles resetWithout --yes, prints a preview of what would happen and exits. To proceed:
dotfiles reset --yesThis will:
- Restore all tracked files to their original paths.
- Remove the storage root (including the Git repository).
- Remove the config file.
If any file cannot be restored, the operation aborts before removing storage or config.
dotfiles ui
# or
dotfiles status --webThe server starts on port 4321 by default, with fallback to the next available port.
dotfiles init --remote <git-url> [--storage <path>] [--config <path>]dotfiles link <paths...> [--config <path>]dotfiles unlink <paths...> [--config <path>]dotfiles status [--json] [--web] [--config <path>]dotfiles push [--message <msg>] [--config <path>]dotfiles doctor [--config <path>]dotfiles reset [--yes] [--config <path>]dotfiles ui [--config <path>]dotfiles version
0: success1: user error (for example invalid path or conflict)2: operational error (for example Git/IO/permission failure)
This version is strict:
- If the storage destination already exists during
link, the operation fails. - If a path does not match unlink expectations (not a symlink, target outside repo, missing target), the operation fails.
No automatic overwrite or backup rename is performed.
npm install
npm run typecheck
npm run test
npm run buildImportant directories:
src/commands: CLI commandssrc/core: core logic (config, link/unlink, status, git)src/web: local control paneltest: unit tests