The different sources follow a precedence order where a configuration variable from a source take precedence over the next one in the below list:
- global and local flags
- Environment variables
- configuration file
See here for a complete list of the supported global and local flags.
gnmic can also be configured using environment variables, it will read the environment variables starting with
The Env variable names are inline with the flag names as well as the configuration hierarchy.
See here for more details on environment variables.
Configuration file that
gnmic reads must be in one of the following formats: JSON, YAML, TOML, HCL or Properties.
gnmic will search for a file named
.gnmic.[yml/yaml, toml, json] in the following locations and will use the first file that exists:
The default path can be overridden with
# config file default path is : # $PWD/.gnmic.[yml, toml, json], or # $HOME/.gnmic.[yml, toml, json], or # $XDG_CONFIG_HOME/.gnmic.[yml, toml, json], or # $XDG_CONFIG_HOME/gnmic/.gnmic.[yml, toml, json] gnmic capabilities # read `cfg.yml` file located in the current directory gnmic --config ./cfg.yml capabilities
If the file referenced by
--config flag is not present, the default path won't be tried.