pull the latest dotfiles and re-apply:
chezmoi updateor manually:
chezmoi git pull && chezmoi applymacos:
brew install chezmoi
chezmoi init --apply brendanleeslinux:
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply brendanleeswindows:
winget install -e --id twpayne.chezmoi --accept-source-agreements --accept-package-agreements
chezmoi init --apply brendanleeson first run, chezmoi will prompt you to configure the machine type.
certain scopes inherit secrets and require bitwarden to be installed and logged in prior to init (see scoping for more detail).
mise pulls tools from github releases. without auth, you're limited to 60 req/hr which fails during init. a zero-permission fine-grained PAT bumps this to 5,000 req/hr.
ansible passes the vault-encrypted token during chezmoi init and chezmoi update — no action needed.
prerequisites:
- bw installed and on PATH before running
chezmoi init - bw signed in once:
bw login.
first-time setup:
- requires export of bw unlock to prevent continous password prompting for each secret token
export BW_SESSION=$(bw unlock --raw)
chezmoi init --apply brendanleesonce dotfile environment is configured, the same command is stored a helper for future use
cz-bw-init # zsh helper: bw unlock --raw → BW_SESSION → chezmoi initto refresh after rotating any cached field: re-run cz-bw-init (or the manual equivalent).
secrets use the namespace .bw_$name, using the item id and are stored within relevant scope guards.
each [data.bw_*] table is populated by ranging over the items custom fields in .chezmoi.toml.tmpl.
adding a new custom field in bw only requires referencing it as {{ .bw_<group>.<field_name> }} in the template — no schema enumeration needed on the chezmoi side.
after editing a value in Bitwarden, re-run chezmoi init to refresh the cache. chezmoi apply alone won't see the change.
pass the token as an env var:
GITHUB_TOKEN=ghp_xxx chezmoi init --apply brendanleesGITHUB_TOKEN is no longer eager-exported into every shell — it's pulled lazily from gh auth when needed:
GITHUB_TOKEN=$(gh-token) some-toolif a tool requires GITHUB_TOKEN to be present unconditionally, opt in to the old behavior by setting GH_TOKEN_AUTOEXPORT=1 before zsh sources its config (e.g. in ~/.zshenv or a launchd EnvironmentVariables entry).
- create a new fine-grained PAT (zero permissions) on github
- update
vault_github_tokenin ansible vault - run ansible update playbook to propagate to all machines