Skip to main content

CLI

@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

GroupCommandsUse For
Authlogin · logout · whoamiSign in with a Personal Access Token
Resourcesworkspace · project · templateBrowse, select, and inspect your account
Syncpull · diffPull templates to local files, compare local vs remote
InitinitScaffold a new project (Next.js, Vite + React, Vite + Vue, Nuxt, vanilla)
Settingsconfig · env · statusManage 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: InstallationAuthenticationExamples.


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

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