~/
dotfiles.hongy.dev
chezmoiidempotent

Bootstrap Scripts

Copy-and-paste commands to bootstrap a fresh macOS, Linux, or Windows machine. Managed with chezmoi, designed for fast and repeatable setup.

Screenshot

macOS desktop with Aerospace tiling and Ghostty terminal.

macOS desktop with Aerospace tiling window manager and Ghostty terminal with tmux

Quick Setup

Run the one-liner to clone the repo and bootstrap everything: Homebrew, chezmoi, dotfiles, packages, and diagnostics.

one-linersh
sh
curl -fsSL https://dotfiles.hongy.dev/install.sh | bash

Or clone manually and run the bootstrap script directly:

manualsh
sh
git clone https://github.com/hongymagic/dotfiles.git ~/Code/dotfilescd ~/Code/dotfiles./bootstrap.sh
# Optional: Configure macOS settings./scripts/macos.sh

The one-liner honours DOTFILES_DIR and DOTFILES_REPO environment overrides (set them after the pipe), and bootstrap.sh accepts --skip-packages / --skip-upgrade flags (see --help).

chezmoi Source Directory

This repository uses a non-standard chezmoi source directory for a smoother editing workflow.

How it workssh
sh
# bootstrap.sh runs chezmoi init --source ~/Code/dotfiles/home, which# renders home/.chezmoi.toml.tmpl into ~/.config/chezmoi/chezmoi.toml:sourceDir = "~/Code/dotfiles/home"
# After bootstrap, these work from anywhere:chezmoi apply -v    # Apply changes from repochezmoi diff        # See pending changeschezmoi cd          # Jump to source directory

What bootstrap.sh Does

The bootstrap script is idempotent and handles the entire setup process automatically.

Installs Homebrew (macOS and Linux)
Installs chezmoi
Applies dotfiles configuration
Installs Homebrew packages from Brewfile
Installs mise runtimes and macOS/Linux-only npm CLIs
Installs Bun global packages from bunfile
Installs Claude Code with its self-updating native installer
Fetches external dependencies
Provides comprehensive diagnostics

Manual Control

For granular control, run individual components separately.

sh
# Install/update Homebrew packages only./scripts/brew.sh
# Apply dotfiles onlychezmoi apply -Rv
# Configure macOS system settings./scripts/macos.sh

Secrets via 1Password

Secrets are stored in 1Password and pulled automatically during chezmoi apply.

sh
# Ensure 1Password CLI is installedbrew install 1password-cli
# Apply dotfiles (will prompt for 1Password sign-in)chezmoi apply -Rv

If 1Password is locked, offline, or unreachable (e.g. a closed-lid MacBook), chezmoi apply warns and skips the secret-backed files — ~/.extra.zsh and the git identity configs — leaving them unchanged, rather than failing outright. Re-run once 1Password responds, or pass --skip-secrets to do so deliberately.

Git Identity and Credentials

The git identity comes from 1Password, and the GitHub CLI answers git's credential requests.

The gitconfig template renders user.name and user.email from 1Password and makes gh auth git-credential the only credential helper for github.com, so HTTPS pushes and pulls use your GitHub CLI login.

sh
gh auth login    # once per machinegh auth status   # the account git authenticates as

Manual Secrets (Without 1Password)

Create ~/.extra.zsh manually if you don't use 1Password.

~/.extra.zshsh
sh
cat >> ~/.extra.zsh <<'EOF'# Add any API keys or other secrets hereexport OPENAI_API_KEY=EOF
chmod 600 ~/.extra.zsh

The git identity block in the gitconfig template only renders when the 1Password CLI is installed. Without it, set your identity in ~/.gitconfig, which git reads after the chezmoi-managed ~/.config/git/config. Plain git config --global writes into the managed file instead, and the next chezmoi apply overwrites it.

sh
git config --file ~/.gitconfig user.name "Your Name"git config --file ~/.gitconfig user.email "you@example.com"

Custom PATH

Add custom directories to your PATH via ~/.path.zsh.

~/.path.zshsh
sh
cat >> ~/.path.zsh <<'EOF'# Add custom paths to $PATH# export PATH="$HOME/.local/bin:$PATH"EOF

Aerospace (Optional)

Disable the Aerospace tiling window manager if you don't want it.

sh
# Uninstallbrew uninstall aerospace
# Or disable via configchezmoi edit --apply ${XDG_CONFIG_HOME}/aerospace/aerospace.toml# Set start-at-login to false, then:chezmoi apply -Rv

Included Features

Opinionated tooling and configuration included in this dotfiles repository.

tmuxTerminal multiplexer configuration
zshShell configuration
CatppuccinMocha theme, with Genesis Crest for Starship, Ghostty, tmux and btop
AerospaceTiling window manager (optional)
1PasswordSecret management via chezmoi templates
AI ToolsClaude, Codex, Gemini and Pi; themed status lines for Claude, Codex and Pi
macOS / Linux