kbsecret-env
- access kbsecret(1) environment records
kbsecret env
[options] <record [record ...]>
kbsecret env
accesses the specified (or all) environment records in a particular
session.
It can be used to produce sh(1) eval
- or source
-able code, which can be useful for
loading important environment keys into a program without exposing them directly.
-s
, --session
<session>The session that the record(s) are under.
-a
, --all
Retrieve all environment records, instead of specifying them on the command-line.
-v
, --value-only
Print only the value for each environment record, instead of the export KEY=VALUE format.
-n
, --no-export
Print only key/value pairs of the form KEY=VALUE, instead of the export KEY=VALUE format. In this mode (and this mode only) the output is space-delimited rather than newline-delimited.
-u
, --unescape-plus
Unescape pluses ("+" characters) in the environment variable and value. Escaped pluses cause problems for some command-line utilities, so use this flag if you experience problems with an environment record that contains a plus.
$ kbsecret env -s dev-team foo-api
export FOO_API=0xDEADBEEF
$ kbsecret env -a
export BAR_API=0xFEEDFACE
export BAZ_API=thisapiusesapassword
$ kbsecret env -v baz-api
thisapiusesapassword
$ kbsecret env -n baz-api
BAZ_API=thisapiusesapassword
$ kbsecret env -n -a
BAR_API=0xFEEDFACE BAZ_API=thisapiusesapassword
kbsecret(1), kbsecret-dump-fields(1), kbsecret-login(1), kbsecret-pass(1), kbsecret-todo(1)