Shell script to set up a new machine. It installs the dotkit CLI, clones your dotfiles repo, and runs dotkit apply on a profile.
sh install.sh [OPTIONS]The install.sh script hosted on GitHub is also accessible at:
| Option | Description |
|---|---|
-d, --defaults |
Skip all prompts and use default answers. |
-u, --username NAME |
GitHub username. Clones NAME/dotkit from GitHub. |
-r, --repo REPO |
Repo to use. Can be a GitHub user/repo, a full URL, or a local path. |
-p, --profile NAME |
Profile to apply. Skips the profile selection prompt. |
-t, --target DIR |
Where to clone the repo. Default: ~/dotkit. |
--no-sudo |
Do not use sudo at any point. |
--cli PATH |
Use a local CLI directory or tarball instead of downloading from GitHub. |
--pat TOKEN |
GitHub personal access token for private repos. Use the DOTKIT_PAT environment variable instead to keep it out of shell history. |
--dry-run |
Print what would happen. Do not change the system. |
Run from the internet:
curl -fsSL https://dotkit.run/sh | shPass options when running via curl:
curl -fsSL https://dotkit.run/sh | sh -s -- --username yournameSkip all prompts:
curl -fsSL https://dotkit.run/sh | sh -s -- --username yourname --defaultsPick a specific profile:
curl -fsSL https://dotkit.run/sh | sh -s -- --username yourname --profile work --defaultsClone to a custom location:
curl -fsSL https://dotkit.run/sh | sh -s -- --username yourname --target ~/dotfilesUse a private repo with a token (inline - token will appear in shell history):
curl -fsSL https://dotkit.run/sh | sh -s -- --repo yourname/dotkit --pat ghp_xxxUse a private repo with a token via environment variable (does not appear in shell history):
DOTKIT_PAT=ghp_xxx curl -fsSL https://dotkit.run/sh | sh -s -- --repo yourname/dotkitStore the token in a file and load it before running:
# ~/.dotkit_pat (chmod 600, do not commit this file)
export DOTKIT_PAT=ghp_xxxsource ~/.dotkit_pat && curl -fsSL https://dotkit.run/sh | sh -s -- --repo yourname/dotkitUse a full repo URL (GitHub, GitLab, self-hosted, etc.):
curl -fsSL https://dotkit.run/sh | sh -s -- --repo https://github.com/yourname/dotkitUse wget instead of curl:
wget -qO- https://dotkit.run/sh | sh -s -- --username yournameUse a local repo (already cloned):
curl -fsSL https://dotkit.run/sh | sh -s -- --repo ~/dotfiles --profile workPreview what would happen without changing anything:
curl -fsSL https://dotkit.run/sh | sh -s -- --username yourname --dry-runTest offline with a local CLI and repo:
sh install.sh --cli ./cli --repo ./example --profile example --defaults --dry-run| Path | Description |
|---|---|
~/.local/bin/ |
Where the CLI scripts are installed. |
~/.local/share/dotkit/ |
State files (active profile, exported env vars). |
~/dotkit |
Default location for the cloned repo. |