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
- -f, --config-path <config_path>¶
Config file path, default:
~/.hckrcfg
- -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 all configurations and their key values
Example Usage:
We can also see all configuration list command
$ hckr config list
Command Reference:
hckr config list [OPTIONS]
Options
- -f, --config-path <config_path>¶
Config file path, default:
~/.hckrcfg
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
- -f, --config-path <config_path>¶
Config file path, default:
~/.hckrcfg
- -c, --config <config>¶
Config instance, default:
DEFAULT
Arguments
- KEY¶
Required argument
- VALUE¶
Required argument
show¶
This command show list of all keys available in the given configuration,
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 show
Similarly, we can also get all values in a specific configuration using -c/–config flag
$ hckr config show -c MY_DATABASE
Command Reference:
hckr config show [OPTIONS]
Options
- -f, --config-path <config_path>¶
Config file path, default:
~/.hckrcfg
- -c, --config <config>¶
Config instance, default:
DEFAULT