Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Reference

dotr [OPTIONS] [COMMAND]

Global options

FlagDescription
-w, --working-dir <PATH>Run as if invoked from <PATH> instead of the current directory. Accepted by every command.
-h, --helpPrint help for the current command.
-V, --versionPrint the dotr version (top-level only).

dotr init

Initialize a dotfiles repository in the working directory: writes config.toml, creates dotfiles/, and writes a .gitignore. Safe to re-run — if config.toml already exists, it’s left untouched.

dotr import <PATH>

Copy a file or directory into the repository and register it as a package.

FlagDescription
-s, --symlinkDeploy as a symlink instead of a copy, and deploy immediately. See Symlinks.
-n, --name <NAME>Override the auto-derived package name.
-p, --profile <NAME>Add the package to this profile’s dependencies instead of default.

dotr deploy

Deploy packages from the repository to their destinations.

FlagDescription
-p, --packages <NAMES>...Deploy only these packages (plus their dependencies, unless --ignore-dependencies). Omit to deploy the active profile’s packages.
-P, --profile <NAME>Use this profile instead of the resolved default. See Profiles.
--ignore-errorsKeep deploying remaining packages if one fails, instead of aborting.
--clean <true|false>Override the clean mode setting for this run.
--dry-runPreview without changing anything — see Dry Run Mode.
--skip-actionsSkip both pre- and post-actions. See Actions.
--skip-pre-actionsSkip only pre-actions.
--skip-post-actionsSkip only post-actions.
--ignore-dependenciesDeploy only the named/selected packages, without pulling in dependencies. See Dependencies.

dotr update

Copy changes from deployed files back into the repository.

FlagDescription
-p, --packages <NAMES>...Update only these packages. Omit for the active profile’s packages.
-P, --profile <NAME>Use this profile instead of the resolved default.
--ignore-errorsKeep updating remaining packages if one fails.
--clean <true|false>Override clean mode for this run.
--dry-runPreview without changing anything.

Templated packages are skipped by update — see Templating.

dotr diff

Show a colored, line-by-line diff between the repository and what’s currently deployed.

FlagDescription
-p, --packages <NAMES>...Diff only these packages.
-P, --profile <NAME>Use this profile instead of the resolved default.
--ignore-errorsKeep diffing remaining packages if one fails.

dotr remove [PACKAGES]...

Remove one or more managed packages: deletes their config.toml entry and their files under dotfiles/. Equivalent to dotr packages remove.

FlagDescription
-f, --forceRemove even if another package or profile still depends on it.
--remove-orphansAlso remove dependencies that end up unreferenced after this removal. See Dependencies.
--dry-runPreview what would be removed.
-P, --profile <NAME>Profile context for dependency checks.

dotr print-vars

Print every variable resolved for the given (or default) profile — see Variables.

FlagDescription
-p, --profile <NAME>Resolve variables for this profile.

dotr packages

Groups package-scoped commands under one namespace. Each behaves the same as its top-level equivalent, plus list:

dotr packages list [-v|--verbose]
dotr packages import <IMPORT_PATH> [-s|--symlink] [-n|--name <NAME>] [-p|--profile <NAME>]
dotr packages deploy [same flags as `dotr deploy`]
dotr packages update [same flags as `dotr update`]
dotr packages diff   [same flags as `dotr diff`]
dotr packages remove [same flags as `dotr remove`]

dotr packages itself also accepts -P, --profile <NAME> as context for its subcommands. packages list --verbose additionally prints each package’s src, dest, dependencies, and other fields.

dotr profiles

Manage profiles — see Profiles.

dotr profiles list [-v|--verbose]
dotr profiles add <PROFILE_NAME> [--set-as-current]
dotr profiles remove <PROFILE_NAME> [--dry-run] [--remove-orphans]
  • add --set-as-current writes DOTR_PROFILE into .uservariables.toml, making the new profile the implicit default on this machine.
  • remove cannot remove the default profile. --remove-orphans also removes packages that were only referenced by the removed profile.