Allow the Command-Line Interface (CLI) to act as an SSH Agent

The desktop bitwarden can now act as an ssh-agent.
This request is for a similar capability for the command-line bitwarden.
The name of the command-line bitwarden exectuable is bw.
It seems like this could be an option for bw login --agent or as a separate bw agent (and bw agent --off) command that would work only if there were an active login.

I think this behavior should be separate from the bw lock.

3 Likes

Note: I slightly changed the title. (before, it was “Allow the Command-Line Bitwarden (bw) to act as an SSH Agent”)

This is related to an older request.

Most of the earlier request has been implemented.
I want to make sure the CLI version is not forgotten.

As a workaround until the feature is available, I’ve managed to use the following to directly add a key to the OpenSSH agent.

bw get item <ssh-item-id> | jq -r '.sshKey.privateKey' | ssh-add -

Proper support in the bw CLI would be much better, of course. Even adding SSH key support to bw get (to avoid the jq call) would be an improvement: add a new object type for SSH private keys, or maybe repurpose the password object for type 5 items.

1 Like