Theme Run CLI workflows
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.
| Task | Command | Completion condition |
|---|---|---|
| Local development | dev | Vite and shopify theme dev run together; termination signals are forwarded and Vite closes after Shopify CLI exits |
| Production assets | build | The Vite production build finishes and the production Mixer, layout render tag, and development-client checks pass |
| Push a theme | push | One run completes the build, production verification, and shopify theme push |
| Package a theme | package | One run completes the build, production verification, and shopify theme package |
| Read diagnostics | doctor | Plugin-owned state is reported without taking the lock, changing Git, or connecting to a store; any failed check returns exit code 1 |
| Restore the worktree | restore | The 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, andpackageforward 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.buildandrestoreaccept no Shopify options.doctoraccepts 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.
Configuration ownership
Separate host Vite settings, plugin responsibilities, and Shopify CLI options so each fact has one owner, with every plugin option and its default.
Mixer Snippet and Git
Understand development and production Mixer forms, the Git-index prerequisite, and restoration after an interrupted run.