CLI
unlayer/cli is open sourceStar, browse the source, file issues, or contribute.
Star on GitHub
@unlayer/cli lets you manage your Unlayer account from the terminal: list and pull templates, switch workspaces and projects, scaffold new apps from official starter templates, and run automation in CI.
It's unlayer on the command line.
unlayer login
unlayer template list
unlayer pull
unlayer diff ./templates/welcome-email-42.json
Looking for the programmatic API?
For calling the Unlayer Cloud API from code (Node, serverless, server-side), see the SDK — same account, different surface.
What you can do
| Group | Commands | Use For |
|---|---|---|
| Auth | login · logout · whoami | Sign in with a Personal Access Token |
| Resources | workspace · project · template | Browse, select, and inspect your account |
| Sync | pull · diff | Pull templates to local files, compare local vs remote |
| Init | init | Scaffold a new project (Next.js, Vite + React, Vite + Vue, Nuxt, vanilla) |
| Settings | config · env · status | Manage CLI configuration, environment profiles, health |
Every command supports --json for machine-readable output and --non-interactive for CI usage. See Authentication for token setup.
Quick Start
# 1. Install
npm install -g @unlayer/cli
# 2. Authenticate (opens browser)
unlayer login
# 3. Scaffold a project
unlayer init my-app
# 4. Or pull templates from an existing project
unlayer pull
Walkthrough: Installation → Authentication → Examples.
Documentation Map
Getting started
- Installation — install via npm, Node version, verify
- Authentication — Personal Access Tokens, browser login, CI usage
- Configuration — project config file, environment profiles, global flags
Command reference
- Auth commands —
login,logout,whoami - Resource commands —
workspace,project,template - Sync commands —
pull,diff - Init command —
init(with frameworks and starter templates) - Settings commands —
config,env,status
Reference
- Examples — end-to-end workflows (CI/CD, template sync, multi-environment)
- Errors — exit codes and common error messages
- Quick Reference — single-page cheat sheet
Requirements
- Node.js 20 or later
- An Unlayer account (free signup at accounts.unlayer.com)