Hosted Theme Sync
Use this workflow if you want to edit a real Shoppex-hosted theme locally instead of using the builder. The workflow: create a theme development API key in the dashboard, pull the hosted theme locally, develop with real storefront data, push your changes back as a draft, then preview and publish.What You Need
You need:- a hosted Shoppex theme ID like
theme_123 - a Shoppex API key with
themes.readandthemes.write - Bun installed locally
Step 1: Create A Theme Development Key
In the Shoppex dashboard:- open
Settings->Developer - open the
API Keyssection - click
Create API Key - choose the
Theme Developmentpreset - copy the secret immediately
themes.readthemes.write
Step 2: Run The CLI
If your environment uses the published package, start with:Step 3: Pull The Hosted Theme
pull does:
- downloads the current hosted theme source as a ZIP
- extracts it into your local folder
- writes
.shoppex/theme.jsonwith the linkedthemeIdandsourceRevision
push checks whether the remote draft changed since your last pull.
Step 4: Run The Theme Locally
If you want real storefront data without running the backend locally:localhost while data comes from https://api.shoppex.io β the hosted theme remains your source of truth for push and publish.
Step 5: Push Your Local Changes
When you are ready to sync your local draft back to Shoppex:push does:
- uploads the full local source snapshot
- replaces the current remote draft source
- deletes remote draft files that you deleted locally
- runs validation automatically
- never publishes automatically
Step 6: Preview And Publish
Start a preview after a successful push:push to start preview immediately:
Safety Rules
These rules matter for the local sync model:pushis a full replace of the remote draft source- deleted local files are deleted remotely too
pushvalidates automaticallypushnever publishes automatically- blocked paths like
.git/,node_modules/,dist/, and lockfiles are ignored
Revision Mismatch
If someone changed the remote draft after your lastpull, push stops with a revision mismatch.
Say you pulled revision r12, then another developer changes the draft in the dashboard (now r13). Your push is blocked so you donβt silently overwrite their work.
The safe fix is:
--force on push if you intentionally want to overwrite the newer remote draft:
Validation Errors After Push
If your upload contains build or validation errors, the draft is still saved. That means:- your exact uploaded draft is preserved on the server
- the CLI returns the validation errors
- publish stays blocked until you fix the draft
Recommended Daily Workflow
Next Steps
Local Development
Understand
VITE_API_BASE_URL, VITE_SHOP_SLUG, and localhost behavior.Theme Control Plane
Learn the shared model behind dashboard, Dev API, CLI, and MCP.
AI Workflows
Use MCP and CLI together when you want an AI assistant to drive the edits.
Troubleshooting
Fix common local-development, sync, and validation issues.