dotling init
Initialize a new dotfiles repo or adopt an existing one.
Usage
dotling init [PATH|URL]
Default: ~/dotfiles
Description
dotling init sets up a dotfiles repository. Depending on the argument:
- A local path — creates the directory, writes a default
dotling.toml, runsgit init, and registers the repo root - A git URL — clones the repo to
~/dotfiles, registers the repo root, and suggests runningdotling syncto deploy entries
After initialization, the repo root is stored in ~/.dotling/state.toml so dotling knows where to find it.
What happens
- Creates the repo directory (or clones from URL)
- Writes a default
dotling.tomlwith empty sections - Runs
git init(for new repos) - Registers the repo root in
~/.dotling/state.toml - Runs the
[hooks] initcommand if defined - For cloned repos: suggests running
dotling syncto deploy entries
Examples
# Create a new dotfiles repo
dotling init ~/dotfiles
# Create at the default location
dotling init
# Clone an existing repo
dotling init git@github.com:you/dotfiles.git
dotling init https://github.com/you/dotfiles.git