skill.config

Configuration management via platformdirs and TOML.

Functions

cache_dir()

Return the platform-specific cache directory for skill.

config_dir()

Return the platform-specific config directory for skill.

config_path()

Return the path to the config TOML file.

data_dir()

Return the platform-specific data directory for skill.

load_config([path])

Load config from TOML, falling back to defaults for missing fields.

save_config(config, *[, path])

Save config to TOML.

skills_dir()

Return the canonical skills storage directory.

Classes

SkillConfig([default_agent_targets, ...])

Root configuration schema with sensible defaults for zero-config first run.

class skill.config.SkillConfig(default_agent_targets=<factory>, default_scope='project', install_method='symlink', ai_provider_model='anthropic:claude-sonnet-4-20250514', ai_api_key='$ANTHROPIC_API_KEY', github_enabled=True, smithery_enabled=True, composio_enabled=True, awesome_list_enabled=True, skillsdirectory_enabled=True, search_cache_ttl=3600)[source]

Bases: object

Root configuration schema with sensible defaults for zero-config first run.

>>> c = SkillConfig()
>>> c.default_agent_targets
['claude-code']
>>> c.install_method
'symlink'
skill.config.cache_dir()[source]

Return the platform-specific cache directory for skill.

Return type:

Path

>>> isinstance(cache_dir(), Path)
True
skill.config.config_dir()[source]

Return the platform-specific config directory for skill.

Return type:

Path

>>> isinstance(config_dir(), Path)
True
skill.config.config_path()[source]

Return the path to the config TOML file.

Return type:

Path

>>> config_path().name
'config.toml'
skill.config.data_dir()[source]

Return the platform-specific data directory for skill.

Return type:

Path

>>> isinstance(data_dir(), Path)
True
skill.config.load_config(path=None)[source]

Load config from TOML, falling back to defaults for missing fields.

Return type:

SkillConfig

>>> c = load_config(Path('/nonexistent/config.toml'))
>>> c.default_scope
'project'
skill.config.save_config(config, *, path=None)[source]

Save config to TOML.

Return type:

None

>>> import tempfile
>>> with tempfile.TemporaryDirectory() as d:
...     p = Path(d) / 'config.toml'
...     save_config(SkillConfig(), path=p)
...     p.exists()
True
skill.config.skills_dir()[source]

Return the canonical skills storage directory.

Return type:

Path

>>> skills_dir().name
'skills'