OpenVoiceOS / ovos-config

OVOS configuration manager library
Apache License 2.0
2 stars 9 forks source link

CLI Improvements #29

Open NeonDaniel opened 1 year ago

NeonDaniel commented 1 year ago

As discussed in #24

JarbasAl commented 1 year ago

from the other PR comments

Maybe for a future PR, this needs an option to show different base directories/config filenames. I'd propose adding flags:

-m/--module: Module to get config for

Under the hood, this has to read submodule_mappings

-o/--override: Get config for a specific module

Arg passed here should be a valid key under module_overrides, otherwise return error

Also, another command might be useful: meta: Show meta config (ovos.conf)

we should move/deprecate the OCA utils too, so OCA is just the web ui

from ovos_config_assistant.module_helpers import pprint_core_module_info
pprint_core_module_info()
"""
## Mycroft module info
     can import mycroft     : True
     is ovos-core           : True
     mycroft module location: /home/user/ovos-core/mycroft

## Downstream ovos.conf overrides
Module: neon_core
     can import neon_core     : False
     neon_core module location: None
     xdg compliance            : True
     base xdg folder           : neon
     mycroft config filename   : neon.conf
     default mycroft.conf path :
          /home/user/NeonCore/neon_core/configuration/neon.conf
Module: hivemind
     can import hivemind     : False
     hivemind module location: None
     xdg compliance            : True
     base xdg folder           : hivemind
     mycroft config filename   : hivemind.conf
     default mycroft.conf path :
          /home/user/PycharmProjects/ovos_workspace/ovos-core/.venv/lib/python3.9/site-packages/mycroft/configuration/mycroft.conf

## Downstream module overrides:
Module: neon_speech
     uses config from   : neon_core
     can import neon_speech     : False
     neon_speech module location: None
Module: neon_audio
     uses config from   : neon_core
     can import neon_audio     : False
     neon_audio module location: None
Module: neon_enclosure
     uses config from   : neon_core
     can import neon_enclosure     : False
     neon_enclosure module location: None
Module: hivemind_voice_satellite
     uses config from   : hivemind
     can import hivemind_voice_satellite     : True
     hivemind_voice_satellite module location: /home/user/HiveMind-voice-sat/hivemind_voice_satellite
"""

from ovos_config_assistant.config_helpers import pprint_ovos_conf
pprint_ovos_conf()
"""
## OVOS Configuration
 ovos.conf exists          : True
      /home/user/.config/OpenVoiceOS/ovos.conf
 xdg compliance            : True
 base xdg folder           : mycroft
 mycroft config filename   : mycroft.conf
 default mycroft.conf path :
      /home/user/ovos-core/.venv/lib/python3.9/site-packages/mycroft/configuration/mycroft.conf
"""
NeonDaniel commented 1 year ago

Related, #47 allows global env to override defaults