Skip to content
Zid partners
Developer programsAn overview of every way to build on ZidApp PartnersPublish your app in the Zid App MarketTheme PartnersLaunch your theme in the Zid Theme Market
App MarketApps available to Zid merchantsTheme MarketThemes ready to install
Support
Partner help centreHow-to guides and troubleshootingDeveloper docsAPIs, SDKs and integration guidesBook a meetingA business or technical support call
What's new
BlogGuides and updates for developersChangelogThe latest partner platform updatesSuggest a featureThe feedback and ideas board
Partner enablement
Partner Ads SoonVisibility packages on Zid’s channelsCustom themesThemes built for one merchantPartner communityConnect with developers building on Zid
Zid library
Zid reportsEverything you need to know about the marketDeveloper guidesOfficial references to build on
العربيةLog inJoin as a partner

Partner programs

Developer programsApp PartnersTheme Partners

Browse the market

App MarketTheme Market

Support & enablement

Partner help centreDeveloper docsBook a meetingBlogChangelogSuggest a featurePartner Ads SoonCustom themesPartner communityZid reportsDeveloper guides

Language

العربية
Log inJoin as a partner
Home/Blog/Themes
Themes

Vitrin CLI in depth: from login to preview, push and troubleshooting

The core Vitrin CLI commands: install, login, creating a theme, previewing on a development store, install and activate, build and push, and fixing common errors.

Oct 25, 20265 min read

What the CLI gives you

Vitrin CLI is Zid's command-line tool for theme developers. It lets you develop, validate and publish themes from your local environment, and it's published on npm as @zidsa/vitrin-cli.

npm install -g @zidsa/vitrin-cli

vitrin   # Launch the interactive TUI (recommended)

The interactive TUI is what the docs recommend: a dashboard with quick access to commands, real-time build status, and theme and authentication info. It lets you create, browse and select themes, deploy a preview in one click, and detects the theme in the current directory automatically. Everything is also available as direct commands, which is what this guide covers.

  • VITRIN_API_URL: API endpoint (default https://api.zid.sa).
  • VITRIN_PARTNER_URL: Partner Dashboard URL (default https://partner.zid.sa).
  • LOG_LEVEL: logging level (debug, info or error).

Sign in: vitrin login

vitrin login opens the Partner Dashboard in your browser for the OAuth flow, then saves your credentials locally. While it waits, the CLI listens for the callback on http://localhost:4444/auth/callback:

$ vitrin login
Opening Zid Partner Dashboard in your default browser...
Listening for authentication callback on http://localhost:4444/auth/callback

✅ Authentication successful!
Token saved to ~/.vitrin/config.json
  • The token is stored in ~/.vitrin/config.json. To log out, run vitrin logout (in version 1.3.0), or delete the file as the docs describe: rm ~/.vitrin/config.json.
  • To check you're still authenticated, run vitrin list themes. If you see "Authentication required", run vitrin login again.
A good practice is to treat ~/.vitrin/config.json as a secret: don't commit it to a repository or share it.

Create a theme: vitrin new

vitrin new <theme-name> [options] creates a new theme. In version 1.3.0 on npm it clones the official Growth theme template from zidsa/growth-theme by default, -e or --from-existing <path> registers a directory you already have as a Vitrin theme instead of cloning, and --no-git skips Git initialization. The -t or --template option (basic, minimal or advanced) listed on the docs commands page isn't in version 1.3.0. Once it's created, the CLI suggests you cd into the folder and run vitrin push. This is the structure the CLI expects, per the docs introduction page:

my-theme/
├── assets/
│   ├── styles.css
│   ├── scripts.js
│   └── images/
├── templates/
│   ├── home.jinja
│   ├── product.jinja
│   └── cart.jinja
├── layout.jinja
├── footer.jinja
├── header.jinja
├── package.json
└── theme.json

The Architecture page in the docs adds sections/, components/, the translation file locale/ar/LC_MESSAGES/messages.po, and layout.schema.json, header.schema.json and footer.schema.json. Treat the CLI's tree as the minimum.

The CLI pages in the docs don't document a command that pulls an existing theme from Zid down to your machine, but version 1.3.0 on npm adds vitrin download to fetch a version's .zip, and vitrin link to link the unzipped folder to the theme. To start from existing work, the docs point to the sample themes on GitHub (zidsa/soft-theme-vitrin and the Growth theme at zidsa/growth-theme), and the TUI lets you browse and select your existing themes.

Preview on a development store

List your development stores to get the store ID, then preview on it. With --build, the CLI builds the theme, creates it, creates a version, uploads the package and installs it on the store, then prints three IDs:

vitrin list stores
vitrin preview 123 --build

# From the preview output:
# Theme ID: 45678
# Version: 90123
# Installation: 11111

Preview ends with the theme installed but not active, and the CLI suggests the activation command. To install a specific version yourself, use vitrin install with the store, theme and version IDs, then activate with the installation ID:

vitrin install <store-id> <theme-id> <version-id>
vitrin activate <store-id> <installation-id>

# Example
vitrin activate 123 11111
The commands page describes a temporary way to upload draft settings during preview: add a .json file named after the template (such as home.json, layout.json, header.json or footer.json) containing the settings, and it's uploaded to the store during preview. Then add /validate to your preview link to read the validation report.

Build and push: vitrin build and vitrin push

vitrin build [theme-path] validates the structure and packages the theme as a distributable .zip. The docs example shows dist/theme.zip; in version 1.3.0 the file is named after the theme folder plus a timestamp (for example my-theme-1714492800000.zip), and -o or --output <path> sets the output directory. vitrin push builds the theme and pushes it to Zid's servers, creating or updating it:

vitrin build
vitrin build --validate

vitrin push --store 123 --activate
  • -s or --store <id>: the development store ID to install on (the docs page says email; version 1.3.0 takes the store ID).
  • -a or --activate: activate the theme after installation.
  • -v or --version <version>: version number (default: from theme.json).
  • -c or --changelog <text>: version changelog.
  • -n or --new-version (version 1.3.0): creates a new theme version; by default push updates the latest version in place.

A good practice is to pass --changelog on every push, and an explicit --version whenever you create a new version, so each version is easy to trace. Keep in mind that push doesn't submit your theme for Theme Market review; that's a separate step: Submit to Publish under My Themes → Themes Management in the Partner Dashboard, or vitrin status --target pending_review in version 1.3.0. Our pre-submission checklist article covers the steps.

Common errors and fixes

  • Authentication required: the token is missing or expired. Run vitrin login.
  • Build fails: run vitrin build --validate. Common causes are missing assets/ or templates/ directories, or an invalid or missing package.json. .DS_Store files are cleaned automatically during the build.
  • Preview fails: an expired token (run vitrin login), an invalid store ID (check with vitrin list stores), or a theme name conflict, which the CLI resolves by generating a unique name.
  • Undefined-variable errors in the preview: since December 2025 these are shown in the development preview. Add fallbacks, handle optional values and use safeget.

For more detail, run the preview with debug logging:

# macOS
LOG_LEVEL=debug vitrin preview 123

# Windows
$env:LOG_LEVEL="debug"; vitrin preview 123
If you find a bug in the CLI itself, report it on the GitHub tracker: zidsa/vitrin-cli/issues.

Key takeaways

  • Install with npm install -g @zidsa/vitrin-cli, and run vitrin alone for the interactive TUI.
  • vitrin login stores the token in ~/.vitrin/config.json; vitrin logout (or deleting the file) logs you out.
  • Use vitrin list stores, then vitrin preview <id> --build, and activate with the installation ID via vitrin activate.
  • vitrin push takes --store, --activate, --version and --changelog, and does not submit for review.
  • When something breaks, start with LOG_LEVEL=debug and vitrin build --validate.

Sources

  1. Vitrin CLI: Introduction
  2. Vitrin CLI: CLI Commands
  3. Theme Development
  4. Architecture
  5. Vitrin Changelog
  6. @zidsa/vitrin-cli 1.3.0 README (npm)
  7. Publish Your Theme - Zid Partner Help Centre

Start building on Zid

Sign up in the partner portal, then build and test on a development store.

Create your account →

Contents

  1. What the CLI gives you
  2. Sign in: vitrin login
  3. Create a theme: vitrin new
  4. Preview on a development store
  5. Build and push: vitrin build and vitrin push
  6. Common errors and fixes

Share

Start building

Related articles

→
Themes

Build your first Theme Market theme: from structure to publishing

A practical walkthrough: how Zid themes are structured, local development and preview with Vitrin CLI, testing on a development store, submission and support.

5 min read
APIs & integration

Rate limits and errors on the Zid API: pace your requests, handle 429s and read error responses

How the 60-requests-per-minute limit works, how to back off on 429s, what error responses look like, and how pagination, caching and webhooks keep you under the limit.

6 min read
APIs & integration

The Zid ERP integration guide: what to build, in what order

A new 53-page partner guide: what an ERP, accounting or WMS integration needs from a Zid store — push vs pull, OAuth, money, returns and a go-live checklist.

5 min read
Zid Partners

Partner programs

Developer programsApp PartnersTheme PartnersCreate your account

Resources

BlogZid reportsDeveloper docsPartner help centerChangelogRequest a feature

Enablement

Partner Ads Soon

Browse the market

App MarketTheme Market

Terms & policies

Partner terms and conditionsPrivacy policy

Get in touch

Book a business callBook a technical support callPartners community
Zid — Al-Qudrah Al-Taqniyah for Technology and Communicationالعربية
Al-Qudrah Al-Taqniyah for Technology and Communication CompanyCR No. 1010365366VAT No. 300827827900003