CLI command not working.

Topic summary

A user is experiencing a recurring authentication loop with the Shopify CLI’s shopify theme dev command. After authenticating through the provided link, the CLI immediately requests authentication again upon the next command execution.

Root Cause:
The issue began after creating a second Shopify Partner account with a different email. The CLI’s cached session tokens appear corrupted or confused between multiple accounts. Reinstalling the CLI did not resolve the problem.

Proposed Solution:

  1. Clear existing sessions: shopify logout
  2. Delete CLI cache manually: rm -rf ~/.shopify
  3. Re-authenticate with correct account: shopify login --store your-store.myshopify.com
  4. Verify logged-in account: shopify whoami
  5. Run shopify theme dev again

The responder indicates this is a common issue when switching between Partner accounts and expresses confidence the solution will resolve the authentication loop.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

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