# CLI command not working.

**URL:** <https://community.shopify.com/t/cli-command-not-working/409492>\
**Category:** Technical Q&A\
**Tags:** liquid, shopify-theme\
**Created:** [April 18, 2025, 9:23am UTC](https://community.shopify.com/t/cli-command-not-working/409492 "2025-04-18T09:23:58Z")\
**Posts on this page:** 2\
**Page:** 1

## AI-generated 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.

<div class="post-metadata">

**Author:** ![master-oogway](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@master-oogway](https://community.shopify.com/u/master-oogway)\
**Post date:** [April 18, 2025, 9:23am UTC](https://community.shopify.com/t/cli-command-not-working/409492/1 "2025-04-18T09:23:58Z")

</div>

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.

 ![masteroogway_0-1744968172575.png](https://canada1.discourse-cdn.com/shopifyforum/original/2X/9/94b9001eed6b3614936cc5f622a2a5e257c73129.png)

---

<div class="post-metadata">

**Author:** ![TheScriptFlow](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/thescriptflow/32/346527_2.png) [@TheScriptFlow](https://community.shopify.com/u/TheScriptFlow)\
**Post date:** [April 18, 2025, 9:48am UTC](https://community.shopify.com/t/cli-command-not-working/409492/2 "2025-04-18T09:48:42Z")

</div>

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.

```markup
shopify logout

```

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

```markup
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.

```markup
shopify login --store your-store.myshopify.com

```

Replace **[your-store.myshopify.com](http://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.

```markup
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.

```markup
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**
