A CLI tool to interact with Passbolt, a Open source Password Manager for Teams
Find a file
Cedric Alfonsi ffabbad31c
Some checks failed
Go / build (push) Has been cancelled
Go / lint (push) Has been cancelled
Go / test (push) Has been cancelled
Merge branch 'develop' into 'main'
PB-50004 - Go-cli: Adapt readme to create community managed version section

See merge request passbolt/groups/front-end-group/go-passbolt-cli!17
2026-06-02 09:18:34 +00:00
.github PB-51584 - Create Github secrets to use in CI 2026-06-01 08:39:56 +00:00
cmd PB-52063 - Go-cli Unify column selectors 2026-05-28 14:53:48 +00:00
folder PB-52065 - Go-cli expose more attributes from API 2026-06-02 08:47:00 +00:00
group PB-52065 - Go-cli expose more attributes from API 2026-06-02 08:47:00 +00:00
internal PB-52065 - Go-cli expose more attributes from API 2026-06-02 08:47:00 +00:00
keepass PB-50546 - Go - phase 1 - CLI test infrastructure 2026-05-08 13:36:44 +00:00
resource PB-52065 - Go-cli expose more attributes from API 2026-06-02 08:47:00 +00:00
user PB-52065 - Go-cli expose more attributes from API 2026-06-02 08:47:00 +00:00
util PB-52063 - Go-cli Unify column selectors 2026-05-28 14:53:48 +00:00
.gitignore PB-50544 - Go - phase 1 - Add unit test coverage to CI 2026-05-20 08:24:48 +00:00
.golangci.yml PB-49956 - Go: add golangci lint 2026-03-11 14:00:34 +00:00
.goreleaser.yml PB-47870 - Redesign go cli release workflow 2026-02-20 08:55:25 +00:00
cli_integration_test.go PB-50545 - Go - phase 1 - SDK and CLI integration tests 2026-06-01 11:42:55 +00:00
go.mod PB-52118 - Bump go SDK to v0.8.0 2026-06-02 08:31:07 +00:00
go.sum PB-52118 - Bump go SDK to v0.8.0 2026-06-02 08:31:07 +00:00
lefthook.yml PB-50544 - Go - phase 1 - Add unit test coverage to CI 2026-05-20 08:24:48 +00:00
LICENSE Initial commit 2021-09-08 10:42:10 +02:00
main.go Use goreleaser version if available, otherwise buildinfo 2024-04-05 21:45:57 +02:00
README.md PB-50004 - Go-cli: Adapt readme to create community managed version section 2026-03-12 09:46:13 +00:00
staticcheck.conf PB-49603 - Go-cli re-enable staticcheck rules 2026-02-25 14:51:51 +00:00
version.go Use goreleaser version if available, otherwise buildinfo 2024-04-05 21:45:57 +02:00

go-passbolt-cli

A CLI tool to interact with Passbolt, an open source password manager for teams.

If you want to do something more complicated: this Go module to interact with Passbolt from Go might interest you.

Disclaimer: This project is community driven and not associated with Passbolt SA.

Install

Homebrew

brew install passbolt/tap/go-passbolt-cli

Download Binary

Download the deb/rpm package or archive for your OS and architecture from the latest release.

For deb/rpm, install via your distro's package manager (e.g. dpkg -i).

For archives, tab completion and manpages will need to be installed manually.

Via Go

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

Note: This installs the binary as go-passbolt-cli. Tab completion and manpages will be missing.

Community Packages

The following packages are maintained by the community and not by the Passbolt team. See Repology for available packages and versions.

Getting Started

First, you need to set up basic information:

  • The server address,
  • your private key
  • and your password/passphrase.

You have these options:

  • Save it in the config file using
passbolt configure --serverAddress https://passbolt.example.org --userPassword '1234' --userPrivateKeyFile 'keys/privatekey.asc' 

or

passbolt configure --serverAddress https://passbolt.example.org --userPassword '1234' --userPrivateKey '-----BEGIN PGP PRIVATE KEY BLOCK-----' 
  • Set up environment variables
  • Provide the flags manually every time

Notes:

  • You can set the private key using the flags --userPrivateKey or --userPrivateKeyFile where --userPrivateKey takes the actual private key and --userPrivateKeyFile loads the content of a file as the private key, --userPrivateKeyFile overwrites the value of --userPrivateKey.
  • You can also just store the serverAddress and your private key. If your password is not set it will prompt you for it every time.
  • Passwordless private keys are not supported.
  • MFA settings can also be saved permanently this way.

Usage

Generally, the structure of commands are like this:

passbolt action entity [arguments]

action is the action you want to perform like creating, updating or deleting an entity. entity is a resource (e.g. password), folder, user or group that you want to apply an action to.

In Passbolt a password is usually referred to as a "resource".

To create a resource you can do the following, which will return the ID of the newly created resource:

passbolt create resource --name "Test Resource" --password "Strong Password"

You can then list all users:

passbolt list user

Note: You can adjust which columns should be listed using the flag --column or its short from -c, if you want multiple column then you need to specify this flag multiple times.

For sharing, we will need to know how we want to share, for that there are these permission types:

Code Meaning
1 Read-only
7 Can update
15 Owner
-1 Delete existing permission

Now, that we have a resource ID, know the IDs of other users and know about permission types, we can share the resource with them:

passbolt share resource --id id_of_resource_to_share --type type_of_permission --user id_of_user_to_share_with

Note: You can supply the users argument multiple times to share with multiple users.

For sharing with groups the --group argument exists.

MFA

You can set up MFA also using the configuration sub command. Only TOTP is supported. There are multiple modes for MFA: none, interactive-totp and noninteractive-totp.

Mode Description
none just errors if challenged for MFA.
interactive-totp prompts for interactive entry of TOTP Codes.
noninteractive-totp automatically generates TOTP codes when challenged. It requires the mfaTotpToken flag to be set to your TOTP secret. You can configure the behavior using the mfaDelay, mfaRetrys and mfaTotpOffset flags

Server Verification

To enable server verification, you need to run passbolt verify once, after that the server will always be verified if the same config is used.

Scripting

For scripting we have a -j or --json flag to convert the output for the create, get and list commands to JSON for easier parsing in scripts.

Note: The JSON output does not cover error messages. You can detect errors by checking if the exit code is not 0.

Exposing Secrets to Subprocesses

The exec command allows you to execute another command with environment variables that reference secrets stored in Passbolt. Any environment variables containing passbolt:// references are automatically resolved to their corresponding secret values before the specified command is executed. This ensures that secrets are securely injected into the child process's environment without exposing them to the parent shell.

For example:

export GITHUB_TOKEN=passbolt://<PASSBOLT_RESOURCE_ID_HERE>
passbolt exec -- gh auth login

This would resolve the passbolt:// reference in GITHUB_TOKEN to its actual secret value and pass it to the GitHub process.

Documentation

Usage for all subcommands is here. And is also available via man passbolt