Implementation:AMAP ML SkillClaw SetupWizard ConfigStore
| Knowledge Sources | |
|---|---|
| Domains | Configuration, Developer_Tools |
| Last Updated | 2026-10-22 00:00 GMT |
Overview
Concrete tool for interactive configuration setup and YAML persistence provided by the SkillClaw client package.
Description
The SetupWizard class provides an interactive terminal wizard that collects LLM provider settings, skill directory paths, PRM configuration, and sharing options from the user. It writes the result as a YAML file via ConfigStore, which handles loading, merging with defaults, and saving the configuration. The config file defaults to `~/.skillclaw/config.yaml` but can be overridden for multi-instance isolation via `SKILLCLAW_HOME`.
Usage
Import and use when you need to:
- Run first-time setup: `skillclaw setup` CLI command
- Programmatically read or modify SkillClaw configuration
- Check whether configuration exists before starting the proxy
Code Reference
Source Location
- Repository: SkillClaw
- File: `skillclaw/setup_wizard.py`, `skillclaw/config_store.py`
Signature
class SetupWizard:
"""Interactive configuration wizard."""
def run(self) -> None:
"""Run the interactive setup wizard, writing config to disk."""
class ConfigStore:
"""Read/write ~/.skillclaw/config.yaml."""
def __init__(self, config_file: Path | None = None):
"""Resolve config file path (defaults to ~/.skillclaw/config.yaml)."""
def exists(self) -> bool:
"""Check if the config file exists."""
def load(self) -> dict:
"""Load config, merging with defaults. Returns the merged dict."""
def save(self, data: dict) -> None:
"""Write config data as YAML to the config file."""
def get(self, dotpath: str) -> Any:
"""Get a nested value via dot-separated path (e.g. 'llm.api_base')."""
def set(self, dotpath: str, value: Any) -> None:
"""Set a nested value via dot-separated path and save."""
def to_skillclaw_config(self) -> SkillClawConfig:
"""Convert the loaded dict into a SkillClawConfig dataclass."""
def describe(self) -> str:
"""Return a human-readable summary of the current config."""
Import
from skillclaw.setup_wizard import SetupWizard
from skillclaw.config_store import ConfigStore
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| config_file | None | No | Override path for config file |
| data | dict | Yes (save) | Full config structure with keys: claw_type, llm, proxy, skills, prm, sharing |
| dotpath | str | Yes (get/set) | Dot-separated path to nested config key |
| value | Any | Yes (set) | Value to set at the dotpath |
Outputs
| Name | Type | Description |
|---|---|---|
| load() returns | dict | Merged config dict (defaults + user values) |
| save() writes | File | YAML file on disk at config_file path |
| to_skillclaw_config() returns | SkillClawConfig | Typed config dataclass for runtime use |
Usage Examples
First-Time Setup
from skillclaw.setup_wizard import SetupWizard
# Run interactive wizard (prompts user in terminal)
wizard = SetupWizard()
wizard.run()
# Config is now saved to ~/.skillclaw/config.yaml
Programmatic Config Access
from skillclaw.config_store import ConfigStore
cs = ConfigStore()
if cs.exists():
config = cs.load()
print(f"LLM model: {config.get('llm', {}).get('model_id', 'unknown')}")
print(f"Skills dir: {config.get('skills', {}).get('dir', 'unknown')}")
# Modify and save
cs.set("llm.api_base", "https://api.openai.com/v1")
cs.set("prm.enabled", True)
Multi-Instance Configuration
from skillclaw.config_store import ConfigStore
from pathlib import Path
# Use a custom config path for isolated instances
cs = ConfigStore(config_file=Path("/opt/skillclaw-instance2/config.yaml"))
config = cs.load()