简体中文
vite-plugin-shopify-theme

Theme Run CLI workflows

Choose a command for development, builds, pushes, packages, diagnostics, or restoration, and understand its delivery boundary.

Theme Run connects Vite and Shopify CLI inside one run context. Choose a command from the task; build, push, and package are not interchangeable entry points.

TaskCommandCompletion condition
Local developmentdevVite and shopify theme dev run together; termination signals are forwarded and Vite closes after Shopify CLI exits
Production assetsbuildThe Vite production build finishes and the production Mixer, layout render tag, and development-client checks pass
Push a themepushOne run completes the build, production verification, and shopify theme push
Package a themepackageOne run completes the build, production verification, and shopify theme package
Read diagnosticsdoctorPlugin-owned state is reported without taking the lock, changing Git, or connecting to a store; any failed check returns exit code 1
Restore the worktreerestoreThe Mixer is restored from the Git index and its skip-worktree flag returns to its prior state

Arguments

Every command requires --path <theme> and runs from the Vite project root. Theme Run parses only the command and --path:

  • dev, push, and package forward every other argument unchanged to Shopify CLI, together with the resolved --path. Environments, stores, remote Theme IDs, authentication, and option validation stay with Shopify CLI.
  • build and restore accept no Shopify options.
  • doctor accepts only --json, which returns stable diagnostic codes.

Version 0.1 removed the old local --theme and forced --env options. Use --path and Shopify CLI's native --environment.

See the repository Theme Run CLI reference for the installed version's exact behavior. In automation, invoke the command that owns the whole task rather than running a detached Vite build and assuming a later push shares its protected context.

Use doctor to inspect a blocked state and restore to end a development Mixer state deliberately. Diagnostics do not modify Git; restoration does, and it requires the Git index to hold the current production Mixer.

Maintained by ShopZend

Verified:2026-09-23

Updated:2026-10-05