Settings provide per-skill persistent key-value storage backed by a JSON file.
~/.config/ovos/skills/<skill_id>/settings.json
For OVOSAbstractApplication:
~/.config/ovos/apps/<skill_id>/settings.json
self.settings is a JsonStorage dict-like object. Read and write as a normal dict:
# Read with default
name = self.settings.get("username", "stranger")
# Write
self.settings["username"] = "Alice"
# Persist immediately (normally auto-saved on shutdown)
self.settings.store()Do not replace the whole self.settings dict — update individual keys:
# WRONG
self.settings = {"key": "value"}
# CORRECT
self.settings["key"] = "value"Pass defaults as a dict to super().__init__ or set them as initial values in __init__. These are only applied if the key does not already exist in the stored settings:
class MySkill(OVOSSkill):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Prefer setting defaults in settings.json (settingsmeta.json) insteadThe __mycroft_skill_firstrun key is managed automatically to track first-run state.
Set self.settings_change_callback to a callable that will be invoked whenever settings change (either via file change or remote update):
def initialize(self):
self.settings_change_callback = self.on_settings_changed
def on_settings_changed(self):
self.log.info("Settings updated!")
self._apply_new_volume(self.settings.get("volume", 50))Settings changes can arrive two ways:
- Bus event (
ovos.skills.settings_changed) — emitted byovos-core's file watcher. This is the primary mechanism in a standard setup. - Local file watcher — the skill can also watch its own
settings.jsondirectly. Enabled by settingmonitor_own_settings: truein the skill's own settings. Useful in isolated setups (e.g. containers) where the skill and core don't share a filesystem.
Skills can receive remote settings updates via mycroft.skills.settings.changed. Only settings for this skill (keyed by skill_id) are applied. After applying remote settings the file watcher is started if not already running.
Skills also have access to self.private_settings (PrivateSettings), a separate storage for data that should not be shared or synced. Backed by a JSON file outside the standard settings path.