Commit your config to dotfiles
Goal: version-control your agentsync config and carry it across machines — without ever committing a cleartext secret or your private key.
-
Make sure secrets are referenced, not embedded. Scan your source for anything that looks like a raw credential and convert it to a
${secret:…}reference (see Secrets).verifywill flag unresolved references:Terminal window agentsync verify -
Add the directory to chezmoi:
Terminal window chezmoi add ~/.agentsync -
Confirm
.state/is ignored. agentsync gitignores its.state/bookkeeping directory inside~/.agentsync/. The encrypted vault (secrets/secrets.age) is tracked — that’s intentional and safe. -
Commit and push through chezmoi as usual:
Terminal window chezmoi cdgit add . && git commit -m "agentsync config" && git push
On a new machine
Section titled “On a new machine”-
Pull your dotfiles with chezmoi, which restores
~/.agentsync/. -
Place the age identity (your private key) at the path your
agentsync.tomlpoints to — distribute it through 1Password or your machine-setup flow, never git:Terminal window mkdir -p ~/.config/agentsync# copy age.key into place, then:chmod 600 ~/.config/agentsync/age.key -
Apply. The first apply re-establishes ownership of any pre-existing native config (backing it up first):
Terminal window agentsync apply --dry-run # preview the backups + translation reportagentsync apply