Important
DEFAULT config is the parent of all other configurations and others will inherit its values if not overridden
hckr config¶
Config commands
hckr config [OPTIONS] COMMAND [ARGS]...
get¶
This command returns value for a key in a configuration
Example Usage:
Getting a value for key in DEFAULT config
Note - DEFAULT config is parent of all other configurations and others will inherit its values if not overridden
$ hckr config get database_host
Similarly, we can also get a value in specific configuration
$ hckr config get database_host --config MY_DATABASE
Command Reference:
hckr config get [OPTIONS] KEY
Options
- -c, --config <config>¶
Config instance, default: DEFAULT
Arguments
- KEY¶
Required argument
init¶
This command Initializes the configuration for the application,
we can also use this option to overwrite existing config and reinitialize.
Example Usage:
Initialising config file .hckrcfg with default settings
$ hckr config init
Similarly, we can also delete existing file and recreate using -o/–overwrite flag
$ hckr config init --overwrite
Command Reference:
hckr config init [OPTIONS]
Options
- -o, --overwrite¶
Whether to delete and recreate .hckrcfg file (default: False)
list¶
This command show list of all keys available in given configuration, we can also see values in all configurations by providing -a/–all flag
Example Usage:
Getting values for keys in DEFAULT config
Note - DEFAULT config is parent of all other configurations and others will inherit its values if not overridden
$ hckr config list
Similarly, we can also get all values in a specific configuration using -c/–config flag
$ hckr config list -c MY_DATABASE
Additionally, we can also see all configurations using -a/–all flag
$ hckr config list --all
Command Reference:
hckr config list [OPTIONS]
Options
- -c, --config <config>¶
Config instance, default: DEFAULT
- -a, --all¶
Whether to shows a list of all configs (default: False)
set¶
This command adds a new entry to the config file with key and value
Example Usage:
Setting a value inside DEFAULT config
$ hckr config set database_host 127.0.0.1
Similarly, we can also set a value in specific configuration, configuration will be created if not exists
$ hckr config set database_host 127.0.0.1 --config MY_DATABASE
Command Reference:
hckr config set [OPTIONS] KEY VALUE
Options
- -c, --config <config>¶
Config instance, default: DEFAULT
Arguments
- KEY¶
Required argument
- VALUE¶
Required argument