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:
bws secret get 2863ced6-eba1-48b4-b5c0-afa30104877a --output yamlwill return the following:
object: secretid: 2863ced6-eba1-48b4-b5c0-afa30104877aorganizationId: b8824f88-c57c-4a36-8b1a-afa300fe0b52projectId: 1d0a63e8-3974-4cbd-a7e4-afa30102257ekey: Stripe API Keyvalue: osiundfpowubefpouwefnote: 'These are notes.'creationDate: 2023-02-08T15:48:33.470701ZrevisionDate: 2023-02-08T15:48:33.470702ZUsing the --output env flag, for example:
bws secret list --output envwill return the following:
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:
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:
bws secret get 2863ced6-eba1-48b4-b5c0-afa30104877a --profile devRefer 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:
bws secret get 2863ced6-eba1-48b4-b5c0-afa30104877a --config-file ~/.bws/alt_config --profile alt_devRefer 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:
bws list secrets --server-url http://my_hosted_server.comThis 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.