doy / rbw

unofficial bitwarden cli
https://git.tozt.net/rbw
Other
620 stars 83 forks source link

Feature Request: Copy password to clipboard on flag #27

Closed TheOneValen closed 1 year ago

TheOneValen commented 3 years ago

e.g.

rbw get entry -c

Copies the password of 'entry' to the clipboard.

Greetings!

hoshsadiq commented 3 years ago

You can use xclip or the like; rbw get entry | xclip -sel clip

jedahan commented 3 years ago

on wayland rbw get entry | wl-copy --paste-once (paste-once for a little more safety)

lukalot commented 3 years ago

I wrote this Fish shell script to make copying passwords from rbw even easier, though I'm not sure you use Fish: https://gist.github.com/Lukalot/9493492624b6d31c8d2169f216a5d74e

It could probably be converted to Bash without too much effort.

as3ii commented 3 years ago

(if clipmenu is not installed, the two lines that disable and enable clipctl can be removed)

clipctl disable    # disable clipboard history
rbw get "$entry" | xsel -ibn &
xsel_pid=$!
clipctl enable     # re-emable clipboard history
# kill xsel after 30 seconds
sleep 30
timeout -k 3 2 kill -15 "$xsel_pid" || kill -9 "$xsel_pid"

^ taken from a script i wrote which uses dmenu to choose the entry

doy commented 1 year ago

fixed in #120