From Shell Scripts
If you already have shell scripts that set up your machine, dotkit can improve them incrementally. You don’t need to rewrite everything at once.
Progressive adoption
Section titled “Progressive adoption”-
Run your scripts through dotkit
Put your existing
.shfiles in a profile run folder. Dotkit executes them as-is (no changes required):profiles/personal/setup/install-tools.shconfigure-git.shconfigure-dock.shTerminal window dotkit apply profiles/personalYou immediately get: consistent execution order,
dotkit apply --dry-run, and the bootstrap curl command. Use a wrapper script and put everything in a subfolder ofsetup/to control execution order. -
Convert repeated commands to
mapblocksBefore:
Terminal window brew install ghbrew install ripgrepbrew install neovimbrew install fzfAfter (.sh):
Terminal window dotkit map 'brew install {{item}}' <<BODYghripgrepneovimfzfBODYAdding a new package is now one line.
dotkit add packages/brew neovimhandles both editing the file and running the install. -
Use community modules for common tools
Replace boilerplate installer scripts with community modules:
Terminal window dotkit map 'dotkit run :tools/{{item}}' <<BODYbrewrustnode-fnmBODY
Keeping scripts alongside dotkit files
Section titled “Keeping scripts alongside dotkit files”Run folders execute .sh, .txt, and .md files. Mix them freely:
profiles/personal/packages/ brew.md ← dotkit format mas.txt ← dotkit format custom-tool.sh ← plain shell, runs as-isKeep scripts you haven’t converted yet. They still run in the correct order.
What to convert, what to keep
Section titled “What to convert, what to keep”Convert to .txt / .md when:
- The script is mostly repeated commands (
brew install,git config,mas install) - You want
dotkit addto stay in sync as you install new things - The install has a clear “already installed?” check
Keep as .sh when:
- The logic is complex (conditionals, loops, string manipulation)
- It’s a one-off config script with no repetition
- You want full shell control (complex error handling, subshells, etc.)