I use a LastPass CLI client that I can pass in to other scripts or bash functions like my frequently used SSH invocations. Works great.
Edit: Here’s a link https://github.com/lastpass/lastpass-cli
Edit: Here’s a link https://github.com/lastpass/lastpass-cli