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

Environment Variables

dotling reads and respects the following environment variables.

User-facing variables

VariableDescription
NO_COLORDisables ANSI color output when set (follows the no-color.org standard)
DOTLING_EDITORHighest-priority editor override for dotling edit
VISUALEditor override (standard Unix convention)
EDITOREditor fallback
DOTLING_ALLOW_HOOKSSet to 1 or true to auto-trust and execute all hooks without prompting
DOTLING_NO_HOOKSSet to 1 or true to completely disable hook execution
HOSTNAMEFallback hostname for dotling.hostname built-in if the syscall fails (Unix/Linux/macOS)
COMPUTERNAMEFallback hostname for dotling.hostname built-in on Windows
USER / USERNAMEUsed for dotling.username built-in (USERNAME is the Windows fallback)

Hook context variables

These variables are set in the environment when hooks execute:

VariableDescription
DOTLING_HOOK_TYPEType of hook: global_init, global_before, global_after, entry_before, entry_after
DOTLING_REPO_ROOTAbsolute path to the dotfiles repository
DOTLING_DRY_RUN"true" if running with --dry-run, otherwise "false"
DOTLING_ENTRY_SOURCE(Entry hooks only) Repo-relative path of the entry’s source file/folder
DOTLING_ENTRY_TARGET(Entry hooks only) Target path of the entry’s deployed file/folder
DOTLING_ENTRY_ACTION(Entry hooks only) Current action being performed: "push" or "pull"

Template environment variables

Any environment variable can be accessed in templates using the {{ env.VAR }} syntax. For example, {{ env.HOME }} resolves to the value of $HOME.