Bootstrap Flow
Bootstrap should be boring, visible, and recoverable. A fresh-machine script is useful only if it can be rerun safely after a partial failure.
First Run
Install Homebrew first if the machine does not have it yet:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv)"Install ghq, configure the project root, and clone this repository into the canonical checkout path:
brew install ghq
git config --global ghq.root ~/repos
ghq get git@github.com:YunYouJun/workstation.git
cd "$(ghq list -p github.com/YunYouJun/workstation)"Install packages and runtime tools:
brew bundle --file Brewfile
fnm install --lts
fnm default lts-latestOptionally install desktop apps from the separate app manifest:
pnpm software:install --appsInstall workspace dependencies and build the CLI:
pnpm install
pnpm buildPreview machine-local init tasks, such as Git includeIf identity routing:
wst init --list
wst init git.include-if --git-profile 'id=github;host=github.com;name=Your Name;email=you@example.com'Run checks before writing to $HOME:
workstation dotfiles doctor
workstation dotfiles pull --dry-runAfter reviewing the dry-run output, apply the dotfiles:
workstation dotfiles pull --forceFor more copyable command blocks, see Copyable Commands.
Best Practices
- Start with
doctorchecks before mutating the machine. - Use
--dry-runfor any command that writes to$HOME. - Back up overwritten files before replacing them.
- Keep bootstrap scripts idempotent.
- Split setup into small phases: packages, dotfiles, secrets, projects, app preferences.
- Print clear next steps when a script cannot complete automatically.
Suggested Phases
- Install command-line prerequisites.
- Restore dotfiles.
- Configure local secrets.
- Clone common projects.
- Install editor extensions and language tooling.
- Run
doctoragain.
The goal is not a magical one-command setup. The goal is a setup process that can be audited, resumed, and improved over time.