How can I publish a development theme using CLI?

Topic summary

A developer is encountering an error when attempting to publish their locally developed theme to production using Shopify CLI.

The Issue:

  • Using shopify theme serve for local preview works successfully
  • Running shopify theme push --publish triggers a 422 error: “You cannot publish a development theme”

Error Details:

  • The CLI (version 2.8.0) prevents publishing themes marked as “development” themes
  • Full stack trace indicates the error originates from the theme publish API request

Proposed Solution:

  • Another user suggests first pushing the theme without the publish flag: shopify theme push --unpublished
  • This would upload the theme as an unpublished version, which can then potentially be published through the Shopify admin or subsequent commands

The discussion remains open, awaiting confirmation whether this workaround resolves the issue.

Summarized with AI on November 8. AI used: claude-sonnet-4-5-20250929.

I am developing a theme locally using the shopify-cli. I can preview the theme using the

shopify theme serve

However, when i try to publish my local changes to the live theme using the following flow:

shopify theme push --publish

I get this error:

/usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/lib/shopify_cli/api.rb:80:in `block in request': 422 (ShopifyCLI::API::APIRequestClientError)
{"errors":{"base":["You cannot publish a development theme."]}}
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/util.rb:172:in `retry_after'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/lib/shopify_cli/api.rb:89:in `request'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/lib/shopify_cli/admin_api.rb:92:in `block in rest_request'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/util.rb:172:in `retry_after'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/lib/shopify_cli/admin_api.rb:95:in `rest_request'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/lib/shopify_cli/theme/theme.rb:133:in `publish'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/lib/project_types/theme/commands/push.rb:74:in `call'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/lib/shopify_cli/command/sub_command.rb:14:in `call'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/lib/shopify_cli/command.rb:24:in `call'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/lib/shopify_cli/core/executor.rb:17:in `block (2 levels) in call'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:37:in `block (2 levels) in with_logging'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb:169:in `with_id'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:36:in `block in with_logging'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/vendor/deps/cli-ui/lib/cli/ui.rb:176:in `log_output_to'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:35:in `with_logging'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/lib/shopify_cli/core/executor.rb:16:in `block in call'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:45:in `block (2 levels) in with_traps'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:55:in `twrap'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:44:in `block in with_traps'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:55:in `twrap'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:43:in `with_traps'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/lib/shopify_cli/core/executor.rb:15:in `call'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/lib/shopify_cli/core/entry_point.rb:24:in `block in call'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/lib/shopify_cli/core/monorail.rb:30:in `log'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/lib/shopify_cli/core/entry_point.rb:23:in `call'
        from /usr/local/Cellar/shopify-cli/2.8.0/gems/shopify-cli-2.8.0/bin/shopify:37:in `block (2 levels) in 

Can someone tell me what I am doing wrong?
1 Like

Have you already pushing the theme with

shopify theme push --unpublished

?

Edit: didn’t saw the date