Installation
Install the CLI as a development dependency in your project:Quick Start
Create anemails directory in your project and add your first template:
emails/welcome.tsx
http://localhost:3000 to see the live preview.
Available Commands
The React Email CLI includes the following commands:dev
Start the development server with live preview and hot reloading
build
Build the preview app for production deployment
export
Export email templates as static HTML files
start
Run the production build of the preview app
Resend Integration Commands
The CLI also includes commands for integrating with Resend:react-email resend setup- Configure Resend API key for CLI integrationreact-email resend reset- Remove Resend API key from CLI configuration
These commands store your Resend API key locally for use with the React Email CLI features.
Directory Structure
By default, React Email looks for templates in the./emails directory:
--dir flag on most commands.
Common Workflows
Development
For active development with live preview:Exporting Templates
To generate production-ready HTML files:out/ directory with your rendered templates.
Production Preview
To build and serve the preview app in production:Next Steps
Development Server
Learn about the dev command and its options
Exporting Templates
Export your templates as HTML for production use