Acceptance Criteria
--site <name> selects the target site; inferred when exactly one site exists; when multiple exist and --site is absent, list the site names and exit cleanly (no dead end)readThemeFromConfig / writeThemeIntoConfig accept an explicit site key and can create a new site entry, not only update an existing one- Adding a second site to a singular
site: config rewrites it to plural sites: { default, <new> } - Helpers are shared so the theme / template / preset apply-modes reuse them
- Tests cover single-site infer, multi-site select, missing-flag listing, and singular→plural rewrite
Approach
Extend the helpers in packages/cli/src/commands/theme.ts / config-file.ts to take a site key and to distinguish "update existing" from "create new" (the latter is what full-site template install needs). Normalise singular↔plural config shapes in one place.
References
- SPEC-110 §3
packages/cli/src/commands/theme.ts, packages/cli/src/config-file.ts, packages/types/src/theme.ts
Resolution
Completed: 2026-06-23
Branch: claude/v0.25.0-impl
What was done
install.ts site helpers: listSiteKeys, resolveTargetSite(raw, --site, 'existing'|'new'), setSiteTheme(key), appendSitePreset(key), createSite(key) (migrates singular site: → plural sites:{default,<new>}).themeInstallCommand/themeInfoCommand take --site; ambiguous multi-site lists keys and exits cleanly instead of the old hard error.bin.ts parses --site/--registry for the theme subcommand.- Tests cover single-site infer, multi-site select, missing-flag listing, collision on new-site, and singular→plural rewrite.
Notes
- Helpers live in the shared install module so template (new-site) and preset (append) apply-modes reuse them.