I seemed to have nuked my entire Theme by using CLI to pull it

I’ve purchased a theme and began to use it. I wanted to edit it locally using shopify CLI.

I practiced pulling on a separate dummy account to learn the process and it worked. I tried to pull on my real account but struggled with authentication, as it seems even after logging out with shopify auth logout and getting a success message, somehow I was still trying to access my real account theme using my dummy account (using --verbose flag showed I was still logged in as dummy account).

I uninstalled and reinstalled shopify-cli, and after various commands eventually tried:
wr-shopify shopify theme pull --store [store-id] --theme [theme-id]

It said: It doesn't seem like you're running this command in a theme directory. and do I want to continue, I said yes

I’m guessing it started a blank theme?

I put in the same command again - it said success, theme xxx has been pulled.

And here is where when I open the theme, and it says theme does not exist. Logging into shopify and looking at the store theme, it’s also non existent.

This is just from pulling the theme, I have not run any commands to deploy, or build, or push.

Not sure how to fix this, please help

If you’ve purchased the theme you’ll be able to just download and install it again (fresh copy).

Thank you for reporting this, @KD_WR!

I uninstalled and reinstalled shopify-cli, and after various commands eventually tried:
wr-shopify shopify theme pull --store [store-id] --theme [theme-id]

It’s excellent you tried the --store flag, because this is the right way of switching between stores.

To download theme A from store1, we may do this:

shopify theme pull --store store1.myshopify.com -- theme A

To download theme B from store2, we may do this:

shopify theme pull --store store2.myshopify.com -- theme B

While logging out really logs out the current session, at least in the first pull (or any operation) it’s important to specify the store, so the CLI knows which store to use in the following operations.

It said: It doesn't seem like you're running this command in a theme directory. and do I want to continue, I said yes

I’m guessing it started a blank theme?

The CLI shows this warning when the directory it’s running in doesn’t look like a theme directory (for example, if it has directories that do not match with the theme architecture).

And here is where when I open the theme, and it says theme does not exist.

When you run shopify theme list, does the theme appear there? If that’s the case, you may open it with shopify theme open --theme <theme_id_or_name>


As @Luke mentioned (thank you, Luke), installing a fresh copy is indeed a good alternative to reinstalling a theme.

However, you may also create (upload) a new unpublished theme based on your local files with shopify theme push --unpublished --theme new_theme


Thanks again for reporting this, @KD_WR!

Please, if you face any other issues with Shopify CLI, feel free to report them at https://github.com/Shopify/cli/issues, then we may take an even deeper look at each individual scenario :slight_smile: