A simple dotfiles manager written in Rust.
- Initialize Repository: Create a new dotfm repository to manage your dotfiles
- Add Files: Track dotfiles by copying them to the repository (or moving and symlinking)
- Remove Files: Stop managing files and restore them to their original locations
- Push Files: Deploy your dotfiles from the repository to their target locations (copy or symlink)
- Pull Files: Update your repository with the latest changes from your local dotfiles
- Diff Files: Check that your configuration matches your deployed dotfiles
- Package Management: Declare system packages with install commands and dependency tracking
- TOML Configuration: Configuration file for easy editing and version control
cargo build --releaseThe binary will be available at target/release/dotfm.
dotfm initUse --force to initialize in a non-empty directory:
dotfm init --forceAdd a file (copies it to the repository):
dotfm add ~/.bashrcAdd a file and create a symlink (moves it to the repository):
dotfm add ~/.bashrc --linkSpecify a custom name for the managed file:
dotfm add ~/.config/nvim/init.vim --name nvim-initdotfm remove bashrcThis will restore the file to its original location (overwriting local changes with the repo version) and stop managing it.
To stop managing a file without restoring (keeping your local version):
dotfm remove bashrc --no-restoreDeploy files from the repository to your system (copies by default):
dotfm pushUse --force to overwrite existing files:
dotfm push --forceUse --link to use symlinks instead of copying:
dotfm push --linkUpdate the repository with changes from your local files:
dotfm pullPull specific files only:
dotfm pull bashrc vimrcDiff your repository against local dotfiles:
dotfm diff bashrcThe configuration is stored in dotfm.toml in your repository root. Example:
name = "dotfiles"
author = "dotfm"
[files]
bashrc = "~/.bashrc"
vimrc = "~/.vimrc"
[packages.pacman]
install_cmd = "sudo pacman -S"
dependencies = ["neovim", "git", "zsh"]
optional = ["fastfetch"]
[packages.apt]
install_cmd = "sudo apt install"
dependencies = ["build-essential"]
optional = ["neofetch"]dotfm can track system packages alongside your dotfiles, making it easy to set up a new system.
dotfm package manager add pacman "sudo pacman -S"
dotfm package manager add apt "sudo apt install"dotfm package manager remove aptAdd a required dependency:
dotfm package add neovim pacmanAdd an optional package:
dotfm package add fastfetch pacman --optionaldotfm package remove neovim pacman
dotfm package remove fastfetch pacman --optionalInstall all required packages from all managers:
dotfm package installInstall from specific package managers:
dotfm package install pacman aptInclude optional packages:
dotfm package install --optional-
dotfm diff <name>: Compare deployed file vs repo version--tool <TOOL>flag for external diff tools
-
dotfm list: Lists all managed files, packages, etc -
Template variables: Variable substitution in config files
- Built-in:
{{ USER }},{{ HOSTNAME }},{{ OS }}, ... - Custom variables in
dotfm.toml dotfm push --renderto process templates
- Built-in:
-
Machine profiles: Context-specific configurations
[profiles.laptop],[profiles.work], etc.- Override variables, files, and packages per profile
dotfm push --profile laptop
-
Hooks: Run scripts at lifecycle events
pre_push,post_push,pre_pull,post_pull- Per-file or global hooks
-
Remote repository support: Bootstrap from a git URL
- ?
dotfm clone <URL>- Clone and setup dotfiles repo - ?
dotfm git-push- Commit and push changes
- ?