evershop seed command populates your EverShop store with demo data including products, categories, collections, pages, and widgets.
Usage
Options
Seed product attributes (color, size, material, etc.)Alias:
-aSeed product categoriesAlias:
-cSeed product collectionsAlias:
--colSeed demo products with imagesAlias:
-pSeed CMS widgetsAlias:
-wSeed CMS pagesAlias:
--pgSeed all demo data (attributes, categories, collections, products, widgets, pages)
Examples
Seed All Demo Data
- Product attribute groups and attributes
- Categories
- Collections
- Demo products with images
- CMS widgets
- CMS pages
Seed Specific Data Types
Seed only products and categories:Using Aliases
What Gets Seeded
Attributes
Creates a demo attribute group with common product attributes:- Color - Select attribute with options (Red, Blue, Green, etc.)
- Size - Select attribute with options (S, M, L, XL)
- Material - Select attribute (Cotton, Polyester, etc.)
Categories
Creates a sample category hierarchy:- Men’s Clothing
- Women’s Clothing
- Accessories
- Electronics
Collections
Creates featured collections:- New Arrivals
- Best Sellers
- Sale Items
Products
Seeds demo products with:- Product names and descriptions
- SKUs and pricing
- Product images (downloaded from demo URLs)
- Attribute values
- Category assignments
- Inventory levels
Pages
Creates sample CMS pages:- About Us
- Privacy Policy
- Terms of Service
- Shipping Information
Widgets
Creates demo widgets:- Hero banners
- Featured product widgets
- Text blocks
Prerequisites
Before running seed:- Complete installation:
evershop install - Configure database connection
- Ensure database is accessible
Use Cases
Development & Testing
Seed demo data for development:Demo Stores
Create a demo store for presentations:Testing Specific Features
Test product catalog features:Data Source
Demo data is seeded from:- Data files - Located in
packages/evershop/src/bin/seed/data/ - Image URLs - Product images are downloaded from external URLs
- Predefined structures - Categories and attributes follow common ecommerce patterns
Seeding Process
The seed command:- Creates attribute group (if seeding attributes or products)
- Seeds attributes (color, size, material)
- Seeds categories (product category tree)
- Seeds collections (featured collections)
- Seeds products (demo products with images)
- Seeds widgets (CMS widgets)
- Seeds pages (CMS pages)
Image Handling
Product images are:- Downloaded from external URLs
- Processed and optimized
- Stored in the media directory
- Associated with products
Image downloading requires internet connectivity and may take time depending on your connection speed.
Idempotency
To re-seed:- Drop and recreate the database
- Run
evershop install - Run
evershop seed --all
Error Handling
If seeding fails:- Database not configured - Run
evershop installfirst - Database connection error - Check database credentials
- Missing permissions - Ensure database user has write permissions
- Network issues - Images may fail to download if offline
Performance
Seeding all data typically takes:- Attributes & Categories: < 1 second
- Collections: < 1 second
- Products: 30-60 seconds (depends on image downloads)
- Pages & Widgets: < 1 second
Best Practices
- Fresh database - Seed on a fresh installation to avoid conflicts
- Development only - Don’t use seed command in production
- Selective seeding - Only seed what you need for testing
- Clear before re-seed - Drop database before re-seeding
Related Commands
install
Run before seeding to set up database
dev
Start development server to view seeded data
See Also
- Installation Guide - Complete installation process
- Catalog Module - Managing products and categories
- CMS Module - Managing pages and widgets