Skip to content

dotkit-run/install

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

install.sh

Shell script to set up a new machine. It installs the dotkit CLI, clones your dotfiles repo, and runs dotkit apply on a profile.

Usage

sh install.sh [OPTIONS]

The install.sh script hosted on GitHub is also accessible at:

Options

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.

Examples

Run from the internet:

curl -fsSL https://dotkit.run/sh | sh

Pass options when running via curl:

curl -fsSL https://dotkit.run/sh | sh -s -- --username yourname

Skip all prompts:

curl -fsSL https://dotkit.run/sh | sh -s -- --username yourname --defaults

Pick a specific profile:

curl -fsSL https://dotkit.run/sh | sh -s -- --username yourname --profile work --defaults

Clone to a custom location:

curl -fsSL https://dotkit.run/sh | sh -s -- --username yourname --target ~/dotfiles

Use 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_xxx

Use 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/dotkit

Store the token in a file and load it before running:

# ~/.dotkit_pat (chmod 600, do not commit this file)
export DOTKIT_PAT=ghp_xxx
source ~/.dotkit_pat && curl -fsSL https://dotkit.run/sh | sh -s -- --repo yourname/dotkit

Use a full repo URL (GitHub, GitLab, self-hosted, etc.):

curl -fsSL https://dotkit.run/sh | sh -s -- --repo https://github.com/yourname/dotkit

Use wget instead of curl:

wget -qO- https://dotkit.run/sh | sh -s -- --username yourname

Use a local repo (already cloned):

curl -fsSL https://dotkit.run/sh | sh -s -- --repo ~/dotfiles --profile work

Preview what would happen without changing anything:

curl -fsSL https://dotkit.run/sh | sh -s -- --username yourname --dry-run

Test offline with a local CLI and repo:

sh install.sh --cli ./cli --repo ./example --profile example --defaults --dry-run

Default locations

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.

About

Bootstrapper / provisioner

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages