Passbolt – Command Line Interface Go Application For MacOS (With TAB Completion)

With Passbolt installed and running, including Firefox add-on and iOS App, there is something missing.. What about. The terminal? Here’s how you install the terminal application on MacOs.

First, make sure you have Go installed. If not, follow the install instructions on: https://go.dev/dl/

Second, update your .zshrc to make use of the correct $GOPATH:

export GOPATH=$HOME/go
export PATH="...:...:$GOPATH/bin:$PATH"

and update env..

~$ source $HOME/.zshrc

Third, Install go-passbolt-cli with Go

~$ go install github.com/passbolt/go-passbolt-cli@latest

Fourth, Install Passbolt-cli tab completion file

~$ go-passbolt-cli completion zsh > "${fpath[1]}/_passbolt"

Remap go-passbolt-cli to passbolt in .zshrc

alias passbolt='go-passbolt-cli'
compdef go-passbolt-cli=passbolt

Update env once again..

~$ source $HOME/.zshrc

Fifth, Authenticate to Passbolt deployment

~$ passbolt configure --serverAddress https://PASSBOLTURL --userPassword 'USERPASSWORD' --userPrivateKeyFile 'path/to/passbolt-recovery-kit.asc'

Verify connection..

~$ passbolt verify

Now Passbolt CLI can be used for all of your passbolting needs.

Examples:

~$ passbolt list resources | grep "RESOURCE"
~$ passbolt get resource --id RESOURCE_ID
~$ passbolt create resource --name "MyResource" --password "P4ssb0lTStr0nGP4zZWrD" --uri "https://myportal.com"
~$ passbolt share resource --id "RESOURCE_ID" --type 1 --user "USER_ID"
~$ passbolt delete resource --id "RESOURCE_ID"

Get Password for resource one-liner

~$ passbolt get resource --id $(passbolt list resources -c ID -c Name | grep -i RESOURCE_NAME | cut -d'|' -f1)

Terminal secrets ?

Leave a Reply

Your email address will not be published. Required fields are marked *