Skip to content
Bitwarden Logo

options

-o, —output

By default, the Secrets Manager CLI will return a JSON object or array of JSON objects in response to commands. Output format can be altered to fits your needs using the -o, --output flag along with one of the following options:

json: Default. Output JSON.

yaml: Output YAML.

table: Output an ASCII table with keys as column headings.

tsv: Output tab-separated values with no keys.

none: Only output errors and warnings.

env: Output secrets in KEY=VALUE format.

For example, the command:

Terminal window
bws secret get 2863ced6-eba1-48b4-b5c0-afa30104877a --output yaml

will return the following:

Terminal window
object: secret
id: 2863ced6-eba1-48b4-b5c0-afa30104877a
organizationId: b8824f88-c57c-4a36-8b1a-afa300fe0b52
projectId: 1d0a63e8-3974-4cbd-a7e4-afa30102257e
key: Stripe API Key
value: osiundfpowubefpouwef
note: 'These are notes.'
creationDate: 2023-02-08T15:48:33.470701Z
revisionDate: 2023-02-08T15:48:33.470702Z

Using the --output env flag, for example:

Terminal window
bws secret list --output env

will return the following:

Terminal window
this_is_a_keyname="this is a key value"
CLOUDFLARE_API_TOKEN="123412341234123412341234"
# This is an invalid keyname="this will get commented-out"
# one or more secrets have been commented-out due to a problematic key name

-c, —color

Output can further be customized by indicated whether you would like colorized output. Available values for this option are yes, no, and auto.

—access-token

You can authenticate individual CLI requests using the -t, --access-token option with any individual command, for example:

Terminal window
bws secret list --access-token 0.48c78342-1635-48a6-accd-afbe01336365.C0tMmQqHnAp1h0gL8bngprlPOYutt0:B3h5D+YgLvFiQhWkIq6Bow==

—profile

Use the --profile option with the list or get commands to specify which profile to use, for example:

Terminal window
bws secret get 2863ced6-eba1-48b4-b5c0-afa30104877a --profile dev

Refer to the config command (here) for help understanding and setting up alternate profiles.

—config-file

Use the --config-file option with the --profile option and list or get commands to specify which profile from which configuration file to use, for example:

Terminal window
bws secret get 2863ced6-eba1-48b4-b5c0-afa30104877a --config-file ~/.bws/alt_config --profile alt_dev

Refer to the config command (here) for help understanding and setting up alternate config files and profiles.

—server-url

This option can be used to set the server URL that the CLI will send the request associated with a given command to, for example:

Terminal window
bws list secrets --server-url http://my_hosted_server.com

This option will override any URLS configured via the config command (see here).

—help

Use this option to print help for any given bws command.

—version

Use this option to print the version of the bws client you’re using.