Start ssh-agent when adding a key and none is running

ysm starts its own agent on $XDG_RUNTIME_DIR/ysm-agent.sock, reconnects
to it on later runs, and shows agent status in the header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aleksey ShakhmatovandClaude Opus 5.5 committed 2026-10-30 15:18:59 +03:00
1 parent 9408ab31a9
commit f680bf3b9d
4 files changed
+119 -7

No files matched your search

+5 -1
View File
@@ -13,7 +13,7 @@ For YubiKey detection it uses `ykman` if installed, otherwise `lsusb`.
| `n` | new key (ed25519 / rsa-4096 / ecdsa) |
| `y` | new key on the YubiKey (ed25519-sk / ecdsa-sk, resident, PIN-per-use) |
| `i` | import resident keys from the YubiKey (`ssh-keygen -K`) |
| `a` / `x` | add to / remove from ssh-agent |
| `a` / `x` | add to / remove from ssh-agent (`a` starts an agent if none is running) |
| `c` | copy public key (wl-copy, xclip, xsel, pbcopy, or OSC 52) |
| `s` | install the public key on a server (`ssh-copy-id`) |
| `p` | change passphrase |
@@ -23,3 +23,7 @@ For YubiKey detection it uses `ykman` if installed, otherwise `lsusb`.
Passphrases, PINs and touch are handled by `ssh-keygen` itself. ysm hands it the
terminal, so secrets never pass through the app. The YubiKey is polled every 2s,
so plugging it in or removing it shows up in the header.
If no ssh-agent is running, `a` starts one on `$XDG_RUNTIME_DIR/ysm-agent.sock`.
It keeps running after you quit, and later ysm runs reuse it. To use it from your
shell, run the `export SSH_AUTH_SOCK=…` line shown in the header.