Introduce ‘shopify theme duplicate’ command
What area(s) will this request affect?
Theme
What type of change do you want to see?
New feature
Overview
Introduce a theme duplicate command in the cli, so developers can duplicate a theme in the library.
Motivation
Pushing an entire new theme via cli takes considerably longer than duplicating a pre existing theme - especially in cases where the merchant has lots of assets.
In my workflow, I never overwrite the live theme directly. Instead, when deploying, I create a new theme and allow the merchant to review it before making the decision to publish.
With the duplicate command, I could simply duplicate the live theme and push any changes to it - in that case only the files that have changed will be overwritten.
This is a clone of the (closed) issue here: https://github.com/Shopify/cli/issues/2000
Just to reiterate, this would be very useful for CI/CD workflows.
+1 for this!
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.
Still relevant
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.
still relevant
This issue is still relevant. We actually have another reason for it - to keep all theme translations. We tried the long way to first download current published theme and then publish it as a new theme. In that case theme translations get removed and lost. But if we use theme duplicate, all theme translations are kept in the duplicated theme. CLI command that would behave the same would actually enable us to use CI/CD the way we need, because currently we need to work directly on the published theme.
We are just starting our shopify implementation and being able to duplicate a theme programmatically seems like a critical requirement for CI/CD and general deployment automation.
I would also love for this command to be available with ability to rename the theme at the same time.
A use case could be, making a backup before deploying changes via CI/CD.
Something like ⤵︎
shopify theme duplicate --environment production --rename-to "📦 Pre Deployment Backup"
Bonus points:
If it could return a theme id in some way, so we can use automate something like ⤵︎
- duplicate a theme -> outputs new theme id
- Use theme id to run test suite against it
- Use theme id to delete it
Just a thought 💡
This should absolutely be a feature of the CLI. As @mgrbec noted, if it ever does get implemented it's imperative that translations are copied over, the same way they are when using the duplicate button in Shopify admin (related issue: https://github.com/Shopify/cli/issues/4486)
Agreed, setting up our CI/CD pipelines right now and surprised this is not a feature of the CLI.
Another vote for this.
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.
Any update on this request? While this issue is only 8 months old, there was a previous issue that was 2 years old when it was auto closed despite there being consistent feedback from users indicating it was still relevant.
I am really surprised that this still has not been implemented after three years. I would think that this feature would not be difficult to implement and the need for it is clear.
Does Shopify ever provide feedback on these requests?
Pushing an entire new theme via cli takes considerably longer than duplicating a pre existing theme - especially in cases where the merchant has lots of assets.
Would it be accurate to say that you're looking for the Admin API to support duplications?
The command you're describing would require a server-side change.
@jeffreyguenther I will leave @knjshimi to elaborate more but for my usecase it will be amazing if you could more easily do the following in our CI/CD pipelines:
- Duplicate the published theme
- cli watches for when the job completes (as some duplication can take a longer than expected time) with a timeout that can be overwritten
- Get
theme idas returned value once it has been complete
shopify theme duplicate --environment production --rename-to "📦 Pre Deployment Backup" --timeout 90
+1 - Another vote for this.
+1 - Another vote. This is really needed
Absolutely needed. Please add this feature.
+1 vote
+1 We need this please. :)
+1 as well
+1 as well
This issue is still relevant. We actually have another reason for it - to keep all theme translations. We tried the long way to first download current published theme and then publish it as a new theme. In that case theme translations get removed and lost. But if we use theme duplicate, all theme translations are kept in the duplicated theme. CLI command that would behave the same would actually enable us to use CI/CD the way we need, because currently we need to work directly on the published theme.
@c-lambert See this related issue, which was closed without a fix yesterday: https://github.com/Shopify/cli/issues/4486
It seems the CLI team is recommending to use the "support channel" in the Translate & Adapt app to request this feature. Doesn't exactly inspire confidence that this is a priority for them to address...
That said, I submitted a ticket to Translate & Adapt and did get a response that they will submit a feature request, so maybe there is hope if enough people request it.
+1 vote
+1 vote!
Please do this Shopify, we need this!