Work
$KeyPath = Join-Path "$env:USERPROFILE" ".ssh" "id_ed25519"
dcli note 'SSH Private Key' > $KeyPath
ssh-add $KeyPath
Constraints
This can't be automated through chezmoi, and the ssh-add above won't run on a fresh Windows host. Surfaced while wiring up the SSH-based ~/Code git-repo externals (#6).
chezmoi init --ssh clones the dotfiles over SSH, so the key must exist before chezmoi runs at all — a provisioning step inside this repo runs too late (you can't clone the repo that holds it without the key).
- The git-repo externals (
PSRSA is private; the git-unpicked / git-add-mergetool gists use git@gist.github.com) authenticate over SSH during chezmoi apply. GitHub has no anonymous SSH, so they need the key mid-apply too.
ssh-add needs the OpenSSH agent, but on Windows the agent (and the canonical OpenSSH client) isn't installed/started until the winget manifest runs during apply — so ssh-add fails pre-init.
Possible direction
- Split it: before init, write only the key file to its default identity path (
~/.ssh/id_ed25519) so ssh uses it directly for the init clone and the externals (passphrase prompted per connection, no agent needed). Defer ssh-add until after the first apply configures OpenSSH.
- On Windows this is likely a documented manual pre-init step rather than anything chezmoi-managed.
TODO
- Non-interactive password for
ssh-add on Windows (moot if done by hand).
Work
Constraints
This can't be automated through chezmoi, and the
ssh-addabove won't run on a fresh Windows host. Surfaced while wiring up the SSH-based~/Codegit-repo externals (#6).chezmoi init --sshclones the dotfiles over SSH, so the key must exist before chezmoi runs at all — a provisioning step inside this repo runs too late (you can't clone the repo that holds it without the key).PSRSAis private; thegit-unpicked/git-add-mergetoolgists usegit@gist.github.com) authenticate over SSH duringchezmoi apply. GitHub has no anonymous SSH, so they need the key mid-apply too.ssh-addneeds the OpenSSH agent, but on Windows the agent (and the canonical OpenSSH client) isn't installed/started until the winget manifest runs during apply — sossh-addfails pre-init.Possible direction
~/.ssh/id_ed25519) sosshuses it directly for the init clone and the externals (passphrase prompted per connection, no agent needed). Deferssh-adduntil after the first apply configures OpenSSH.TODO
ssh-addon Windows (moot if done by hand).