config
The config command specifies server settings for the Secrets Manager CLI to use. A primary use of bws config is to connect the CLI to a self-hosted Bitwarden server.
Available settings include server-base, server-api, and server-identity, for example:
bws config server-base https://my_hosted_server.comWhen done this way, your specified server values will be saved to a default profile in a ~/.bws/config file. You can use subsequent options to create alternate profiles and config files:
config —profile
Use the --profile option with the config command to save specified server values to alternate profiles, for example:
bws config server-base http://other_hosted_server.com --profile devOnce created, you can use that profile with other commands to route requests to the specified server, for example:
bws secret get 2863ced6-eba1-48b4-b5c0-afa30104877a --profile devconfig —config-file
Use the --config-file option with the config command to save specified server values to alternate config files, for example to save values to a default profile in a new config file:
bws config server-base http://third_hosted_server.com --config-file ~/.bws/alt_configYou can chain --config-file with --profile to save values to alternate profiles in alternate config files, for example:
bws config server-base http://third_hosted_server.com --config-file ~/.bws/alt_config --profile alt_devOnce created, you can use that profile with other commands to route requests to the specified server, for example:
bws secret get 2863ced6-eba1-48b4-b5c0-afa30104877a --config-file ~/.bws/alt_config --profile alt_devConfig Docker
Pass config file into Docker container with run command:
docker run -it -v /PATH/TO/YOUR/CONFIGFILE:/home/app/.bws/config -e BWS_ACCESS_TOKEN=<ACCESS_TOKEN_VALUE> bitwarden/bws secret list