CLI utility to manage dotfiles symlinks
Packages in deb
and rpm
formats
There is a one-liner to install dotfiles
package using remote script:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/avakarev/dotfiles-cli/master/scripts/install.sh)"
Running command from above downloads a script and runs it.
Script might ask you for sudo password cause package managers like apt
and yum
require it to install the package.
It's a good idea to review the script before running it, so please feel free to do it.
NOTE:
If you are installing dotfiles
on older RaspberryPi models and encounter error like:
dpkg: error processing archive:
package architecture (armel) does not match system (armhf)
Then run this command and retry installation script:
sudo dpkg --add-architecture armel
With Homebrew: brew tap avakarev/tap && brew install dotfiles
Binaries for Linux and macOS
Make sure you have a working Go environment (Go 1.12 or higher is required). See the install instructions.
Compiling dotfiles
is easy, simply run:
git clone https://github.com/avakarev/dotfiles-cli.git
cd dotfiles-cli
make build
You can simply start with checking status of symlinks from configuration file:
dotfiles status
To link dotfiles use link
command:
dotfiles link
To delete symlinks use unlink
command:
dotfiles unlink
Each command supports optional group(s) filter argument:
dotfiles status group1 group2
dotfiles
needs configuration file describing symlink groups.
File path could be specified either with flag --config=/path/to/file
or using environment variable $DOTFILES_CONFIG=/path/to/file
.
If none from options above is set, dotfiles
will try to load .dotfilesrc
from working directory.
dotfiles
uses the following precedence order. Each item takes precedence over the item below it:
--config
/-c
flagDOTFILES_CONFIG
environment variable.dotfilesrc
file in working directory
Configuration file format is JSON
and could be either a flat list of symlinks (the group "default" is assigned implicitly)
or an object of groups each listing its own list.
Example of configuration file with no groups:
[
"vim",
"vimrc"
]
Example of configuration file with groups:
{
"zsh": [
"zsh",
"zshrc",
],
"git": [
"gitconfig",
"gitignore-global",
"gitattributes-global"
]
}
Each symlink entry consists of source (mandatory) and target path (optional) separated by colon: "source:target"
.
If source path just a filename, it's expected to be located in the same directory where the configuration file is.
If target part is missing, it's assumed as "~/.<source>"
.
Both source
and target
path can include ~
or $HOME
, which is interpreted as home directory path.
dotfiles
is licensed under MIT license. (see LICENSE)