kbsecret-configuration
- configuration formats for kbsecret(1)
This manual page documents configuration files and formats for kbsecret(1) and its subcommands.
There are currently two standard kbsecret(1) configuration files, both of which are kept under /keybase/private/<user>/kbsecret/.config:
kbsecret.yml: Mandatory. Stores basic information about KBFS's location, session configuration, and generator configuration. This file is YAML formatted and should not be modified by hand.
commands.ini: Optional. Stores per-command configuration, including default arguments for particular commands and command aliases. This file is INI formatted and can be modified by hand.
As per above, users should not modify kbsecret.yml manually. Instead, users should use commands like kbsecret-session(1) and kbsecret-generator(1) to modify the contents of this file. KBSecret itself may rewrite this file from an in-memory representation at any point, so do not save comments in it.
commands.ini, on the other hand, is meant to be edited by users. Its primary purpose is to provide command-specific configuration in a central location. In particular, keybase(1) will read commands.ini to supply user-specified default arguments to commands.
The following is an example of a valid commands.ini file:
[list]
args = --show-all --type login
aliases = l ls
[new]
args = --force
aliases = n
[custom-command]
args = --frobulate 'bar "quux"'
customkey = customvalue
Note that the args
keys specify default arguments to pass to each subcommand (list
, new
,
etc.), and that the value of each args
key is a string following normal shell quoting
and escaping rules. These arguments are passed automatically to kbsecret(1) subcommands,
regardless of the language used to write subcommand. For example, if the user ran
kbsecret list
with this configuration present, kbsecret(1) would expand the invocation to:
kbsecret list --show-all --type login
Note also the aliases
keys, which specify custom names for their respective subcommands. Aliases
are space-separated. For example, with the given configuration, each of these invocations is
equivalent:
kbsecret l
kbsecret ls
kbsecret list
The precedence of overlapping aliases is not guaranteed, which means that you shouldn't define overlapping aliases.
Commands may also define additional keys under their sections, as can be seen
with customkey
under custom-command
. KBSecret's Config
class provides a standard mechanism
for accessing these, but the command may also choose to open the file and parse it independently.
/keybase/private/<user>/kbsecret/.config/kbsecret.yml
/keybase/private/<user>/kbsecret/.config/commands.ini
YAML specification: http://www.yaml.org/spec/1.2/spec.html
INI format (INIH): https://github.com/benhoyt/inih
kbsecret(1), kbsecret-session(1), kbsecret-generator(1)