~/
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, simple-bar, Ghostty terminal, and Catppuccin Mocha theme.

macOS desktop with Aerospace tiling window manager, simple-bar status bar, Ghostty terminal with tmux, and Catppuccin Mocha theme

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 only)
Installs chezmoi
Applies dotfiles configuration
Installs Homebrew packages from Brewfile
Builds gauth from packages/gauth to ~/.local/bin
Installs Bun global packages from bunfile
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 applywarns and skips the secret-backed files — ~/.extra.zshand 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 (gauth)

A Go CLI built from packages/gauth that picks the right GitHub account per directory and per remote.

gauth picks a work or personal identity from gitconfig includeIfmarkers and repo owners, then hands git a live token from the GitHub CLI's keyring — stateless and fail-closed, so an unknown profile aborts rather than using the wrong account. Full reference: packages/gauth/README.md.

sh
gauth status                      # which profile applies here, and whygauth resolve --explain           # step-by-step resolution tracegauth doctor                      # verify gitconfig wiring (--online also checks gh logins)gauth exec personal -- git push   # one-shot run with a pinned profile

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 and gauth blocks in the gitconfig template only render when the 1Password CLI is installed. Without it, set your identity manually with git config --global user.name and user.email; to keep using gauth, hand-write the [gauth] definitions per packages/gauth/README.md.

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

simple-bar

A customisable macOS status bar widget for Übersicht, themed with Catppuccin Mocha.

The default setup enables pill-styled Spotify, Music, sound, battery, date, and time widgets (in that visual order). The battery widget's caffeinate toggle is disabled — use a dedicated app like Lungo instead.

sh
# simple-bar is installed automatically via chezmoi externals.# To refresh after config changes:cp ~/Code/dotfiles/home/dot_simplebarrc ~/.simplebarrcosascript -e 'tell application id "tracesOf.Uebersicht" to refresh widget id "simple-bar-index-jsx"'

Included Features

Opinionated tooling and configuration included in this dotfiles repository.

tmuxTerminal multiplexer configuration
zshShell configuration
CatppuccinUnified Mocha theme across tools
AerospaceTiling window manager (optional)
1PasswordSecret management via chezmoi templates
AI ToolsClaude, OpenCode, Codex, Continue, Gemini and Pi; themed status lines for Claude, Codex and Pi
macOS / Linux