Spree CLI configurator: declarative store configuration
Add a command group to @spree/cli that treats a YAML file as the desired configuration of a store and reconciles a live instance against it through the Admin API: spree config diff shows what would change, deploy applies it, introspect writes the live configuration back out as YAML, validate checks the file offline. Records are matched on natural keys (slug, code, SKU, name), never on prefixed IDs, so the same file provisions a fresh local project, a staging environment and a hosted production store.
Every project scaffolded by create-spree-app ships a skeleton spree.config.yml, and spree init deploys it during setup. The dashboard e2e suite is the first consumer, so the tool is exercised on every CI run.
The longer goal is that store setup stops being Ruby. Ruby seeds keep only the store row, the admin role, the first admin and the first API key. The per-store defaults the seeds create today, and the country-shaped defaults first-run setup builds, become configuration files deployed by the same engine, which moves into its own @spree/config package.
Status: In Progress. The engine, commands, first-release sections, e2e fixtures, scaffold and docs are built.
Depends on: the Admin API CLI (credentials, SDK transport), the Admin API conventions, first-run setup, and the CSV import's natural-key upserts.
Migration path
- Natural key audit. Done; unique indexes follow with a dedupe task.
- Engine and schemas. Done.
- Commands
validate,diff,deploy,introspect. Done. - Dashboard e2e fixtures as YAML. Done.
- Skeleton
spree.config.ymlin new projects, deployed byspree init. Done. - Docs and schema publication. Done.
- Move the engine into its own
@spree/configpackage. - Complete the Admin API request-body specs and derive section attributes from them.
- Defaults file replacing the per-store Ruby seeds, deployed by
spree init, the setup screen and hosted signup. - Country template replacing the Ruby first-run provisioning service.
Plan: https://github.com/spree/spree/blob/main/docs/plans/6.0-cli-configurator.md
Tracked in Linear as V-3633
Source: spree/spree