A flexible dotfile manager: Go implementation of flexdot.
- Declarative dotfile management using YAML index files
- Safe symlink creation with backup and restore
- Backup retention and cleanup
- Colorized output
Download the latest release from the GitHub Releases page and extract the archive for your platform. The binary name is flexdot
.
If you want to build from source (requires Go 1.24 or later):
git clone https://github.com/hidakatsuya/flexdot-go.git
cd flexdot-go
go build -o flexdot ./cmd
$HOME/dotfiles/
├── common/
│ ├── bin/
│ │ └── myscript
│ └── vim/
│ └── .vimrc
├── macOS/
│ └── bash/
│ └── .bash_profile
├── ubuntu/
│ └── bash/
│ └── .bashrc
├── macOS.yml
├── ubuntu.yml
common:
bin:
myscript: bin
vim:
.vimrc: .
macOS:
bash:
.bash_profile: .
This will link $HOME/dotfiles/common/bin/myscript
to $HOME/bin/myscript
, and so on.
flexdot install [-H|--home_dir path] <index.yml>
- Use
--home_dir
or-H
to specify the home directory. - If
<index.yml>
or--home_dir
is omitted, the value fromconfig.yml
will be used.
flexdot clear-backups
install [-H|--home_dir path] <index.yml>
Install dotfiles as specified in the index file.--home_dir
/-H
: Set the home directory (overrides config.yml)<index.yml>
: Path to the index YAML file (overrides config.yml)- If omitted, values are taken from
config.yml
. - Both must be set either via CLI or config.yml.
clear-backups
Remove all backup directories under./backup/
.
You can place a config.yml
in your dotfiles directory to set default options:
You can also generate a template config.yml
with default values by running:
flexdot init
keep_max_count: 10 # (optional) Number of backup directories to keep (default: 10)
home_dir: /home/yourname # (optional) Default home directory for install command
index_yml: ubuntu.yml # (optional) Default index YAML file for install command
- CLI options take precedence over config.yml.
- If
keep_max_count
is omitted, the default value 10 is used.
When a file is replaced, it is moved to a timestamped backup directory under ./backup/YYYYMMDDHHMMSS/
.
Run all tests:
go test ./...
Contributions are welcome! Please open issues or pull requests.
This project is licensed under the MIT License.
- flexdot - Original Ruby implementation and inspiration.