Shoplazza CLI theme development overview
Shoplazza CLI is a command-line interface tool that helps you build Shoplazza themes and apps. This document explains how to use Shoplazza CLI for theme development.
For the full CLI documentation (app development, API commands, shortcuts, and more), refer to the Shoplazza CLI documentation.
Features
Shoplazza CLI accelerates your theme development process with the following features:
- Safely preview, test, and share changes to themes using development themes
- Automatically reload the page in connected browsers on every file change when previewing a theme
- Initialize a new theme using Nova 2023 as a starting point
- Push and publish themes from the command line
- Work against several stores or themes with environments defined in
shoplazza.theme.toml
Development themes
Development themes are unpublished themes that are connected to the Shoplazza store that you're using for development. When you connect your theme to a store as a development theme, you can use that store's data for local testing.
You can create a development theme using the shoplazza themes serve command. When you run it without --theme-id, the first run creates a theme named Development - <theme name> and saves its ID in .shoplazza/theme-state.json in your theme directory (one per store). Later runs from the same directory reuse it.
Your development theme stays on the store until you delete it; shoplazza auth logout only clears your local credentials. If you want a preview link that doesn't change while you keep developing, then you should push your theme to another unpublished theme on your store, or run shoplazza themes share.
Your development theme can be used to perform the following tasks:
- View changes in real-time to a theme that you're developing locally
- Customize and interact with the theme using the Shoplazza admin theme editor
- Share a password-protected preview of the theme with other developers
Installation
To learn how to install Shoplazza CLI on Windows, macOS, or Linux, refer to Install Shoplazza CLI.
Getting started
Start building a theme
Customize an existing theme
Command reference
Refer to the Theme commands to explore the theme commands available in Shoplazza CLI.
For the full command reference (all topics), see the CLI command reference.
Authentication
Shoplazza CLI v2 uses OAuth 2.0. To authenticate:
shoplazza auth login --store-domain my-store.myshoplaza.com --domain themes
For full authentication details, see Authentication.
Switching between stores
shoplazza auth store use --store-domain another-store.myshoplaza.com
Logging out
shoplazza auth logout
Directory structure
You can run certain theme commands, such as shoplazza themes serve, only if the directory you're using matches the default Shoplazza theme directory structure. The CLI checks for config/settings_schema.json.
└── project
├── assets
├── config
├── layout
├── locales
├── sections
├── snippets
└── templates
└── customers
Upgrade
npm update -g shoplazza-cli
Or run shoplazza update, which also refreshes the API metadata.
To check your CLI version:
shoplazza --version