loteoo / ks

Command-line secrets manager powered by macOS keychains
MIT License
46 stars 3 forks source link

Multiline secret #3

Closed ghost closed 10 months ago

ghost commented 11 months ago

Is there a way to add a multiline secret such as a SSH key? Copying and pasting directly in the keychain access app Secrets keychain works after which ks correctly lists and shows the entry.

Edit: ks add ssh "$(cat ./.ssh/id_ed25519)"

loteoo commented 10 months ago

Which version are you using? Multi-line should work, however it may be hard to see it from the UI.

I released a new version today (0.4.0) that has an option to make a secret a "secure note" in Keychain Access app, which has a nicer multi-line UI.

ex: cat ~/.ssh/id_ed25519 | ks add -n ssh

Can you upgrade and let me know if that works? Thank you!

ghost commented 10 months ago

Upgraded. The secure note indeed has a nicer ui but as someone who prefers the command line, "ks show ssh" produces the same output after running your example command either with or without the -n switch. The -n switch may be useful for people who check the keychain access app. But this is a nice tool to avoid those long "security" commands. Great job!