Shopify CLI for Experiment Drafts
Use the target repository's supported Shopify CLI and build commands. Check the installed command help before adapting flags. Do not install or upgrade a toolchain, connect a new account, or copy credentials between stores merely to bypass a missing capability. Report the missing capability and continue local work when possible.
Preflight and local checks
Resolve ab_store to the verified permanent store domain and ab_theme_path to the complete deployable theme directory. Resolve ab_theme_name to a unique treatment name associated with this task. These are non-secret task variables, not values to infer from an ambient login.
Illustrative read-only/local commands, after those values are established:
shopify theme list --store "$ab_store" --json
shopify theme check --path "$ab_theme_path"
Inspect applicable CLI environments and non-secret target flags without dumping credentials or the process environment. Ensure a repository wrapper, shopify.theme.toml, or inherited options cannot select a different store/destination or publish the theme. Never use a wrapper that publishes as part of its build or preview command. Authentication alone does not authorize writes.
Use host-provided credentials through the approved CLI authentication mechanism. Do not include passwords/tokens in command arguments, prompts, reports, logs, or screenshots. Avoid verbose output that could reveal sensitive details.
Create the treatment theme
After the complete artifact is validated and the exact unpublished upload is authorized, use explicit store, path, and a new theme name. The following command removes inherited publish and destination switches; retain the host's authentication mechanism and check for any additional configuration override before execution:
env -u SHOPIFY_FLAG_PUBLISH -u SHOPIFY_FLAG_LIVE -u SHOPIFY_FLAG_ALLOW_LIVE \
-u SHOPIFY_FLAG_UNPUBLISHED -u SHOPIFY_FLAG_DEVELOPMENT \
-u SHOPIFY_FLAG_DEVELOPMENT_CONTEXT -u SHOPIFY_FLAG_THEME_ID \
-u SHOPIFY_FLAG_ENVIRONMENT \
shopify theme push --store "$ab_store" --path "$ab_theme_path" \
--unpublished --theme "$ab_theme_name" --strict --json
--unpublished creates a new theme. In this form --theme supplies its name. --strict requires Theme Check to pass without errors but still permits warnings. The CLI returns a theme object including its ID, shop, role, editor URL, and preview URL; capture those actual values and verify the destination through a fresh theme list.
Do not use --publish, --live, --allow-live, theme publication/role-change commands, or an implicit interactive destination selection. A development theme or local server is not the durable unpublished treatment required for the review handoff. Starting theme dev also syncs remotely and needs applicable authorization.
Update or recover an owned draft
Resolve ab_theme_id only from this task's recorded theme artifact or safely reconciled creation result. Read the exact store/theme role again and verify ownership and absence from scheduled or active rollouts through available read-only API/admin evidence. theme list alone does not prove that the theme is outside a rollout. Withhold the update if that evidence is unavailable.
For an authorized correction to that verified destination:
env -u SHOPIFY_FLAG_PUBLISH -u SHOPIFY_FLAG_LIVE -u SHOPIFY_FLAG_ALLOW_LIVE \
-u SHOPIFY_FLAG_UNPUBLISHED -u SHOPIFY_FLAG_DEVELOPMENT \
-u SHOPIFY_FLAG_DEVELOPMENT_CONTEXT -u SHOPIFY_FLAG_THEME_ID \
-u SHOPIFY_FLAG_ENVIRONMENT \
shopify theme push --store "$ab_store" --path "$ab_theme_path" \
--theme "$ab_theme_id" --strict --json
Do not include --unpublished on an update: it would create another theme. A full push can delete destination files missing locally, so review the complete local/remote manifest first. Use scoped file flags or --nodelete only when consistent with the reviewed artifact; neither flag proves baseline parity or removes obsolete files that could affect the experiment.
When initial creation has an unknown outcome, inspect the store and reconcile ownership before any retry. Retain any safely identified partial theme and report its actual state. Do not silently create duplicates, delete themes to make room, or upload to a convenient pre-existing draft.
Official sources
Verified 2026-10-05. Recheck installed help and current documentation when behavior differs.
- Shopify CLI for themes: authentication, development-theme lifecycle, and theme workflows.
- Theme push: unpublished creation, target flags, strict validation, JSON output, and deletion behavior.
- Theme list: target-bound theme inventory and roles.
- Theme Check: local theme validation.