The Gofer CLI accepts configuration through flags, environment variables, or a configuration file.
When multiple configuration sources are used the hierarchy is (from lowest to highest) config file values -> environment variables -> flags. Meaning that if you give the same configurations different values through a configuration file and through flags, the value given in the flag will prevail.
You can view Gofer's global flags by simply typing
You can also set configuration values through environment variables. Each environment variable has a prefix
For example, setting your API token:
gofer service token whoami
Each environment variable available is just the flag with a prefix of
For convenience reasons Gofer can also use a standard configuration file. The language of this file is HCL. Most of the options are simply in the form of
You can put your CLI configuration file in any of the following locations and Gofer will automatically detect and read from it(in order of first searched):
- The path given to the
The options available in the configuration file are the same as the global flags:
# The flag 'detail' maps back to the configuration file as the same name
detail = false
|The namespace ID of the namespace you'd like to default to. This is used to target specific namespaces when there might be multiple.
|Show extra detail for some commands (ex. Exact time instead of humanized)
|Can be one of three values:
silent. Controls the output of CLI commands.
|The URL of the Gofer server; used to point the CLI and that correct host.
|Turns off color globally for all CLI commands.
|The authentication token passed Gofer for Ident and Auth purposes.
namespace = "myNamespace"
detail = false
format = "pretty"
host = "localhost:8080"
no_color = false
token = "mysupersecrettoken"