src/cli/ provides the plugin installation workflow and the utilities that generate and persist runtime configuration.
Current responsibilities:
src/cli/index.ts only dispatches:
install subcommand and flags--skills=yes|no--no-tui--dry-run--reset--helpThe CLI is intentionally non-interactive-only now; it prints usage and steps to stdout with exit codes.
paths.ts: config directory and file discovery (opencode.json/.jsonc, lite config path).config-io.ts: JSON/JSONC parsing, normalize write behavior, atomic writes (.tmp + .bak), plugin registration, default-agent disabling.providers.ts: provider model mapping + generateLiteConfig().system.ts: OpenCode binary/version/path checks.skills.ts: recommended and permission-only skill metadata and install behavior (npx skills add).custom-skills.ts: bundled skill registry and copy-to-config-directory implementation.config-manager.ts: re-export barrel for CLI config utilities.install.ts: end-to-end install orchestration and console messaging.types.ts: install/config DTOs.CLI install command
└─> install.ts (runInstall)
1) check OpenCode installed
2) add plugin entry to main OpenCode config
3) disable legacy default agents
4) write/preview generated lite config
5) optional install phase:
- installSkill(...) for each RECOMMENDED_SKILL
- installCustomSkill(...) for each CUSTOM_SKILL
generateLiteConfig(installConfig) behavior:
$schema, preset: openai, empty presetsopenaiagent-browser for designerDEFAULT_AGENT_MCPSlayout, main_pane_size) when enabledwriteLiteConfig() writes target file atomically and supports --reset/dry-run branching in install.ts.
oh-my-opencode-slim.json) is consumed by runtime config/loader.ts.agents/index.ts via cli/skills.ts.src/index.ts bootstrap.installSkills in config covers both recommended external and bundled/custom skills as separate paths.openai, kimi, copilot, zai-plan).