@mailcrate/cli
v0.1.0
Published
CLI tool for compiling and pushing React Email templates to Mailcrate
Readme
@mailcrate/cli
CLI tool for compiling and pushing React Email templates to Mailcrate.
Installation
npm install -g @mailcrate/cliOr use directly with npx:
npx @mailcrate/cli <command>Setup
mailcrate login --api-key YOUR_API_KEYOr run mailcrate login interactively to be prompted for your API URL and key.
Your configuration is saved to ~/.mailcrate/config.json.
Usage
Push templates
Push a single template:
mailcrate push ./emails/welcome.tsxPush an entire directory:
mailcrate push ./emails/Templates are identified by a templateSlug export in each file:
export const templateSlug = "welcome-email";You can override the slug for single-file pushes:
mailcrate push ./emails/welcome.tsx --slug welcome-emailAuto-creating templates
If a template doesn't exist in Mailcrate yet, the CLI will ask if you want to create it. The slug is converted to a readable name automatically (e.g. welcome-email becomes "Welcome Email").
Use -y to skip the prompt and auto-create — useful for CI/CD:
mailcrate push ./emails/ -yList templates
mailcrate listOptions
| Command | Option | Description |
|---------|--------|-------------|
| push | --slug <slug> | Override template slug (single file only) |
| push | -y, --yes | Auto-create missing templates without prompting |
| login | --api-url <url> | Mailcrate API URL |
| login | --api-key <key> | Workspace API key |
