docs/developer/cli/quickstart.mdx
The Spree CLI (@spree/cli) manages Docker-based Spree projects created with create-spree-app.
The CLI is included automatically when you scaffold a project with create-spree-app. You can also install it globally:
npm install -g @spree/cli
Then run commands from your project directory:
spree dev
Or use npx without installing:
npx @spree/cli dev
spree initFirst-run setup. Starts Docker services, seeds the database, generates an API key, and optionally loads sample data.
spree init
spree init --no-sample-data # Skip sample data
spree init --no-open # Skip opening browser
spree devStart services and stream logs.
spree dev
spree stopStop all services.
spree stop
spree updatePull the latest Spree Docker image and recreate containers. Migrations run automatically on startup.
spree update
spree ejectSwitch from the prebuilt Docker image to building from your local backend/ directory. This lets you customize the Rails app — add gems, override models, add migrations, etc.
spree eject
After ejecting, the Docker image is built from backend/Dockerfile. Edit files in backend/ and run spree dev to rebuild and restart with your changes.
See Customizing the Backend for details on what you can customize.
spree logsStream service logs.
spree logs # Web service (default)
spree logs worker # Worker service
spree consoleOpen a Rails console.
spree console
spree openOpen the admin dashboard in the browser.
spree open
spree seedSeed the database.
spree seed
spree sample-dataLoad sample products, categories, and images.
spree sample-data
spree user createCreate an admin user. Prompts for email and password interactively, or pass them as flags:
spree user create
spree user create --email [email protected] --password secret123
spree api-keyManage Store and Admin API keys.
spree api-key list # List all keys
spree api-key create # Interactive
spree api-key create --name "Storefront" --type publishable # Store API key
spree api-key create --name "Admin" --type secret # Admin API key
spree api-key revoke <id> # Revoke a key