I am bashdot, a minimalist dotfile management framework with support for multiple profiles and templates.
I am a single script, written entirely in bash, which requires no additional dependencies.
Bashdot works by symlinking files and directions, in a given profile, into the users home directory.
One or more profiles can be installed on a specific instance to provide the desired dotfiles for it's purpose (work, home, etc.), operating system (Linux, MacOS, Solaris, etc.) and version (Debian, RedHat, etc.).
Bashdot supports templates for replacing values in files during installation.
brew tap bashdot/tap brew install bashdot
curl -s https://raw.githubusercontent.com/bashdot/bashdot/master/bashdot > bashdot sudo mv bashdot /usr/local/bin sudo chmod a+x /usr/local/bin/bashdot
Create your initial profile directory, in this example, default.
Add any files you would like symlinked into your home directory. For example:
echo 'set -o vi' > default/env
Note, bashdot prepends a dot, in front of the filename, to the linked file.
Install the profile.
bashdot install default
The above file default/env will now be linked to ~/.env.
Continue adding your dotfiles.
mv ~/.bashrc default/bashrc
You can safely re-run
bashdot install defaultto link newly added files.
Thats it, store this directory in a cloud drive or check it into source. Repeat for additional profiles.
If you have values which need to be set in a file when bashdot is run, you can create a template.
Append .template to any files which should be rendered.
When installed, template files will have all variables replaced with the current environment variables set when bashdot is run.
The rendered files will be created in the same directory, and have .template replaced with .rendered.
If you have the file default/env.template with the below contents:
You can run the following to set the value ENV_SECRET_KEY when installing the home profile:
env ENV_SECRET_KEY=test1234 bashdot install default
This will result in the rendered file default/env.rendered being created and symlinkd to ~/.env with the below contents..
Rendered files will be removed when you uninstall their respective bashdot profile.
Be sure to include **/*.rendered in .gitignore if you will be checking your dotfiles into a Git repo.
Managing Multiple Profiles
Bashdot works by symlinking files within the given profile directory into your home directory.
For example, if you run:
bashdot install default work
Bashdot will symlink all the files in default and work into your home directory.
Profiles installed on the same system must not contain overlapping files.
Frequently Asked Questions
Q: What if I have secrets or other private information to install in my dotfile?
A: Never check in sensitive information in your dotfiles. To remove sensitive information, create a bashdot template and replace sensitive information with variables. This will the sensitive information to be provided during installation.
Q: How can I share my bashdot profiles?
A: Bashdot only manages dotfiles installation, not their distribution. To share your bashdot profile, make it available via source control, shared file system or cloud drive.
Q: Does bashdot work with zsh, fish or other shells?
A: Yes. Bashdot works by using standard unix commands and symlinks. It should work with any shell on a system that has bash installed.
Q: If bashdot supports other shells, why is it called bashdot?
A: It is a 100% self contained bash script with no dependencies.
Only requirement to run tests is docker. Once installed run:
To shell into a container to test bashdot without affecting your local environment run:
To increase logging, set the BASHDOT_LOG_LEVEL environment variable to debug.