Skip to content

feat: sin config — Unified configuration management #34

@Delqhi

Description

@Delqhi

Description

Add a sin config command for unified management of all SIN-Code configuration files, eliminating manual JSON/YAML editing.

Current Pain Point

Users must manually edit multiple config files:

  • ~/.config/opencode/opencode.json — providers, models, MCP servers, agents, skills, permissions
  • ~/.config/opencode/skills/*.md — skill configurations
  • ~/.pcpm/ — project brain files
  • AGENTS.md — global/project rules
  • MCP server env vars scattered across shell profiles

Requirements

sin config show                          # Show all effective config (merged view)
sin config show --source opencode        # Show only opencode.json
sin config show --source skills          # Show only skill configs
sin config get providers.fireworks-ai.models  # Get nested value
sin config set providers.fireworks-ai.models.gpt-4o.max_tokens 8192
sin config add mcp-server myserver '{"command": "uvx myserver-mcp"}'
sin config remove mcp-server myserver
sin config add skill my-skill --from-github OpenSIN-Code/SIN-Code-MySkill
sin config enable skill my-skill
sin config disable skill my-skill
sin config migrate --from-version 1.0.0  # Auto-migrate config schema
sin config validate                      # Validate all configs against schemas
sin config backup                        # Backup all configs to ~/.config/sin/backups/
sin config restore <backup-file>         # Restore from backup
sin config edit                          # Open in $EDITOR (opencode.json)

Configuration Sources (Priority Order)

  1. Project-local: .sin/config.json (highest priority)
  2. Global: ~/.config/sin/config.json
  3. opencode: ~/.config/opencode/opencode.json
  4. Skills: ~/.config/opencode/skills/*.md
  5. Project brain: ~/.pcpm/
  6. Defaults: Built-in defaults

Features

  • Schema validation: JSON Schema for each config source
  • Merge logic: Deep merge with clear precedence
  • Diff view: sin config diff shows changes vs defaults
  • Import/Export: sin config export > config.json, sin config import < config.json
  • Secrets handling: Never print API keys (show as ***), use Infisical/Keyring for storage
  • Completion: Shell completion for config paths

Acceptance Criteria

  • sin config show displays merged config from all sources
  • sin config get/set works with dot-notation paths
  • sin config add/remove mcp-server modifies opencode.json correctly
  • sin config validate catches schema violations
  • sin config backup/restore works round-trip
  • Secrets never leaked in output (masked as ***)
  • Shell completion for config keys

Priority

HIGH — Eliminates #1 configuration friction; currently 100% manual JSON editing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions