Theme Run CLI workflows

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

Applies to:0.1.2

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 themepackageBuild and verify, package only standard theme directories, and verify the ZIP contents before returning its final path
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
Merge for a rebuildmergeMerge full commit SHAs in order; leave the final merge uncommitted so the next build can be included

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.
  • merge accepts full commit SHAs, not Shopify CLI options.

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.

Package a distributable theme

shopify-theme package --path theme-frame builds and checks the theme, then packages a temporary copy containing only standard Shopify theme directories. Engineering instructions, tooling, source maps, and development metadata stay out of the ZIP. Before delivery, the command compares archive entries with the packaged files byte for byte. A mismatch fails the command. The completed ZIP is moved back to the Theme Target and its final path is printed.

Merge before rebuilding

shopify-theme merge --path theme-ci <demo-sha> <source-sha> merges full commit SHAs into the target’s current branch in the given order. It commits each merge except the last, allowing you to build and include regenerated assets in that final merge commit.

This command changes Git state. Review the inputs and start with a clean target worktree. Conflicts limited to plugin-generated assets and the Mixer use the current branch’s version, or its absence, and are reported; rebuild those outputs afterward. Source conflicts and other Git failures stop the command. Inspect the reported Git state and resolve or abort the merge before continuing. merge does not build, push, or publish the theme.

Maintained by ShopZend

Verified:2026-10-11

Updated:2026-10-11