sunztech-theme
v1.0.6
Published
CLI tool for SunzTech theme development — scaffold, watch, and sync theme files to your store
Downloads
357
Maintainers
Readme
sunztech-theme
CLI tool for SunzTech theme development. Edit Liquid templates locally, see changes instantly on your store.
Installation
npm install -g sunztech-themeRequires Node.js 18 or higher.
Quick Start
# 1. Scaffold a new theme
sunztech-theme init my-theme
# 2. Connect to your store
cd my-theme
sunztech-theme auth
# 3. Start developing
sunztech-theme devCommands
sunztech-theme init [name]
Creates a new theme directory with all required files:
layout/theme.liquid— Main layout wrappertemplates/*.liquid— All 15 page templates (index, product, collection, cart, checkout, etc.)assets/style.css— Starter stylesheetassets/app.js— Starter JavaScriptconfig/settings_schema.json— Theme settings schemasnippets/— Directory for reusable Liquid partialssunztech.config.json— CLI configuration (placeholder values)
sunztech-theme auth
Interactive setup that connects your local theme to a store:
- Asks for your store URL (e.g.
https://ahmad.com) - Asks for your developer token
- Verifies the connection
- Lets you pick an existing theme or create a new one
- Writes
sunztech.config.jsonwith the correct values
sunztech-theme dev
Starts development mode:
- Reads
sunztech.config.jsonfrom the current directory - Verifies the server connection and theme
- Pushes all local files to the server (full sync)
- Watches for file changes and pushes them instantly
- Prints a preview URL to open in your browser
$ sunztech-theme dev
Connecting to server...
Connected. Theme: "my-theme" (019abc...)
Syncing all files...
[synced] layout/theme.liquid
[synced] templates/index.liquid
...
Sync complete: 19 files pushed, 0 failed
Watching for changes... (press Ctrl+C to stop)
Preview: https://ahmad.com/storefront/?_themeId=019abc...
[pushed] templates/index.liquid
[pushed] assets/style.cssConfiguration
sunztech.config.json is created by sunztech-theme auth or manually:
{
"server": "https://ahmad.com",
"token": "your-developer-token",
"themeId": "your-theme-id"
}| Field | Description |
|-------|-------------|
| server | Your store's URL |
| token | Developer token (created in the admin panel) |
| themeId | ID of the theme to sync files to |
Theme Structure
my-theme/
├── layout/
│ └── theme.liquid
├── templates/
│ ├── index.liquid
│ ├── product.liquid
│ ├── collection.liquid
│ ├── page.liquid
│ ├── cart.liquid
│ ├── checkout.liquid
│ ├── thank-you.liquid
│ ├── 404.liquid
│ └── account/
│ ├── login.liquid
│ ├── register.liquid
│ ├── dashboard.liquid
│ ├── orders.liquid
│ ├── order-detail.liquid
│ └── profile.liquid
├── snippets/
├── assets/
│ ├── style.css
│ └── app.js
├── config/
│ └── settings_schema.json
└── sunztech.config.jsonDeveloper Token
A developer token is required to authenticate CLI requests. Create one from the admin panel:
POST /shops/:shopId/developer-tokensThe token is sent as the X-Developer-Token header on every request.
Workflow
- Admin creates a developer token in the store dashboard
- Developer runs
sunztech-theme init my-themeto scaffold files - Developer runs
cd my-theme && sunztech-theme authto connect - Developer runs
sunztech-theme devto start watching - Edit any
.liquid,.css, or.jsfile — changes push automatically - Refresh the browser to see updates
- When done, zip the theme and upload as a production theme
License
MIT
