Package: ovos-config
OVOS-confighelper package to interact with mycroft configCommand Line usageA small helper tool is included to quickly show, get or set config valuesQuick rundown (cli):ovos-config getLoose search (search a key or parts therof):Given an entry of{'PHAL': {
        'ovos-PHAL-plugin-system': {
                'enabled': True
        },
        'ovos-PHAL-plugin-connectivity-events': {
                'enabled': True
        },
        ... 
}ovos-config get -k phalwould yieldallPHAL entries and present it to the user (and the path where they were found)Strict search (search keys in a distinct location):ovos-config get -k /PHAL/ovos-PHAL-plugin-system/enabledThis will output only the value or exit out if no key is found (root slash indicating a strict search)ovos-config setSearches loosely for keys containing the query string and presents a choice to the user to define a valueovos-config set -k phalThe type is derived from the joined config and thus can be safely cast into the user conf.Optionally a value (-v) can be sent as an argument.ovos-config showGet a full table of either the joined, user (-u), system (-s) or remote (-r) configuration.
This can be further refined by passing a--section, which can be listed withovos-config show -lConfiguration Structureovos.confTheovos_configpackage determines which config files to load based onovos.conf.get_ovos_configwill return default values that loadmycroft.confunless otherwise configured.ovos.conffiles are loaded in the following order, with later files taking priority over earlier ones in the list:/etc/OpenVoiceOS/ovos.conf/etc/mycroft/ovos.conf (Deprecated)XDG_CONFIG_DIRS+ /OpenVoiceOS/ovos.conf/etc/xdg/OpenVoiceOS/ovos.confXDG_CONFIG_HOME(default ~/.config) + /OpenVoiceOS/ovos.confA simpleovos_configshould have a structure like:{"base_folder":"mycroft","config_filename":"mycroft.conf","default_config_path":"<Absolute Path to Installed Core>/configuration/mycroft.conf","module_overrides":{},"submodule_mappings":{}}Note:default_config_pathshould always be an absolute path. This is generally
detected automatically, but any manual override must specify an absolute path to a json or yaml config file.Non-Mycroft modules may specify alternate config paths. A call toget_ovos_configfromneon_coreorneon_messagebuswill return a configuration like:{"base_folder":"neon","config_filename":"neon.yaml","default_config_path":"/etc/example/config/neon.yaml","module_overrides":{"neon_core":{"base_folder":"neon","config_filename":"neon.yaml","default_config_path":"/etc/example/config/neon.yaml"}},"submodule_mappings":{"neon_core.skills.skill_manager":"neon_core","neon_messagebus":"neon_core","neon_speech":"neon_core","neon_audio":"neon_core","neon_gui":"neon_core"}}Ifget_ovos_configwas called frommycroftwith the same configuration file as the last example,
the returned configuration would be:{"base_folder":"mycroft","config_filename":"mycroft.conf","default_config_path":"<Path to Installed Core>/configuration/mycroft.conf","module_overrides":{"neon_core":{"base_folder":"neon","config_filename":"neon.yaml","default_config_path":"/etc/example/config/neon.yaml"}},"submodule_mappings":{"neon_core.skills.skill_manager":"neon_core","neon_messagebus":"neon_core","neon_speech":"neon_core","neon_audio":"neon_core","neon_gui":"neon_core"}}Configurationovos_config.config.Configurationis a singleton object that loads a single config
object. The configuration files loaded are determined byovos.confas described above.
Using the above example, ifConfiguration()is called fromneon_speech, the
following configs would be loaded in this order:/etc/example/config/neon.yamlos.environ.get('MYCROFT_SYSTEM_CONFIG')or /etc/neon/neon.yamlos.environ.get('MYCROFT_WEB_CACHE')orXDG_CONFIG_PATH/neon/web_cache.json (unlessdisable_remote_config == Truein earlier config)~/.neon/neon.yaml (Deprecated)XDG_CONFIG_DIRS+ /neon/neon.yaml/etc/xdg/neon/neon.yamlXDG_CONFIG_HOME(default ~/.config) + /neon/neon.yamlConfiguring ConfigurationThere are a couple of special configuration keys that change the way the configuration stack loads.Defaultconfig refers to the config specified atdefault_config_pathinovos.conf(#1/etc/example/config/neon.yamlin the stack above).Systemconfig refers to the config at/etc/{base_folder}/{config_filename}(#2/etc/neon/neon.yamlin the stack above).protected_keysA"protected_keys"configuration section may be added to aDefaultorSystemConfig file
(default/etc/mycroft/mycroft.conf). This configuration section specifies
other configuration keys that may not be specified inremoteoruserconfigurations.
Keys may specify nested parameters with.to exclude specific keys within nested dictionaries.
An example config could be:{"protected_keys":{"remote":["gui_websocket.host","websocket.host"],"user":["gui_websocket.host"]}}This example specifies thatconfig['gui_websocket']['host']may be specified in user configuration, but not remote.config['websocket']['host']may not be specified in user or remote config, so it will only consider default
and system configurations.disable_user_configIf this config parameter is set to True inDefaultorSystemconfiguration,
no user configurations will be loaded (no XDG configuration paths).disable_remote_configIf this config parameter is set to True inDefaultorSystemconfiguration,
the remote configuration (web_cache.json) will not be loaded.