cli icon indicating copy to clipboard operation
cli copied to clipboard

Introduce ‘shopify theme duplicate’ command

Open knjshimi opened this issue 1 year ago • 27 comments

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.

knjshimi avatar May 19 '24 00:05 knjshimi

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.

JeriverGAP avatar May 20 '24 17:05 JeriverGAP

+1 for this!

jonXmack avatar Jun 13 '24 07:06 jonXmack

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.

github-actions[bot] avatar Jul 26 '24 03:07 github-actions[bot]

Still relevant

jonXmack avatar Jul 26 '24 07:07 jonXmack

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.

github-actions[bot] avatar Sep 07 '24 03:09 github-actions[bot]

still relevant

knjshimi avatar Sep 07 '24 04:09 knjshimi

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.

mgrbec avatar Sep 09 '24 08:09 mgrbec

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.

dalgarin avatar Oct 24 '24 21:10 dalgarin

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 💡

sergeifilippov avatar Oct 25 '24 04:10 sergeifilippov

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)

nboliver-ventureweb avatar Oct 30 '24 18:10 nboliver-ventureweb

Agreed, setting up our CI/CD pipelines right now and surprised this is not a feature of the CLI.

ishevch avatar Dec 05 '24 19:12 ishevch

Another vote for this.

mcarter-astronautdev avatar Dec 17 '24 16:12 mcarter-astronautdev

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.

github-actions[bot] avatar Jan 29 '25 03:01 github-actions[bot]

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?

dalgarin avatar Jan 29 '25 05:01 dalgarin

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 avatar Jan 29 '25 17:01 jeffreyguenther

@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:

  1. Duplicate the published theme
  2. cli watches for when the job completes (as some duplication can take a longer than expected time) with a timeout that can be overwritten
  3. Get theme id as returned value once it has been complete
shopify theme duplicate --environment production --rename-to "📦 Pre Deployment Backup" --timeout 90

sergeifilippov avatar Jan 29 '25 20:01 sergeifilippov

+1 - Another vote for this.

benjidata avatar Feb 06 '25 14:02 benjidata

+1 - Another vote. This is really needed

valentinobaraldo avatar Feb 11 '25 15:02 valentinobaraldo

Absolutely needed. Please add this feature.

vw-anne-price avatar Feb 11 '25 17:02 vw-anne-price

+1 vote

tim-vw avatar Feb 11 '25 17:02 tim-vw

+1 We need this please. :)

Maxtasy avatar Feb 24 '25 22:02 Maxtasy

+1 as well

gbcatrinoiu avatar Mar 06 '25 10:03 gbcatrinoiu

+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 avatar Mar 14 '25 06:03 c-lambert

@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.

nboliver-ventureweb avatar Mar 14 '25 17:03 nboliver-ventureweb

+1 vote

marklauyq avatar Mar 21 '25 10:03 marklauyq

+1 vote!

G-rant88 avatar Apr 08 '25 16:04 G-rant88

Please do this Shopify, we need this!

dcrawsh avatar Apr 08 '25 16:04 dcrawsh