CLI command not working.

Whenever I type shopify theme dev, I get a auth link. If i go to auth link and confirm everything, then again if I command, shopify theme dev, again get the auth link.

Before I was working good. Whenever I created another partner account using another email, from that itme, the problem started.

I uninstalled CLI, then installed CLI again,but still the same problem.

Any solutions fellows ??

Thanks in advance.

Hey @master-oogway ,

I hope you are doing well. The issue you are facing with the Shopify CLI repeatedly asking for Authentication (even after confirming) is common and it happen when you recently switch Shopify Partner accounts to logged in with a different email and CLI cache or session tolens are corrupted or confused between accounts.

Here are the best steps you can follow.

  1. Clear Existing Shopify CLI Auth Sessions: Run the following command in your terminal to clear the previous sessions record.
shopify logout

Then also manually delete the CLI’s config and session cache by this CMD Command.

rm -rf ~/.shopify

This will clear the all Auth tokens and cached login info.

  • Re-login with the Correct Partner Account: Now authenticate again with your correct Shopify Partner account.
shopify login --store your-store.myshopify.com

Replace your-store.myshopify.com with your actual store URL.

If you are doing theme development for a dev store then you have to run this command.

shopify theme dev​

You will be redirect to the Auth page again but this time it should stick.

  • Confirm That the Logged-in Account Matches Your Store: To verify which store and account you are currently logged in then you can run this command.
shopify whoami

By following these steps I am 100% sure this will fix your issue.

If this was really helpful prove it by a like and Mark it as Solution.

Thanks