CLI Connection gives 401 error

I have reproduced the issue on the latest CLI version.

Yes, I am on the latest version

I have searched existing posts and this report is not a duplicate.

Yes, this isn’t a duplicate

In which of these areas are you experiencing a problem?

Other

Expected behavior

When I run any command to connect with CLI it should be authenticated.

Actual behavior

It’s giving 401 error

Reproduction steps

shopify auth logout
shopify theme dev --store DOMAIN_NAME.myshopify.com --password shptka_SECRET_PASSWORD

Verbose output

╭─ error ──────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  Error connecting to your store DOMAIN_NAME.myshopify.com: GraphQL Error    │
│  (Code: 401): {"response":{"errors":"[API] Invalid API key or access token   │
│  (unrecognized login or wrong                                                │
│  password)","status":401,"headers":{}},"request":{"query":"query             │
│  publicApiVersions {\n  publicApiVersions {\n    handle\n    supported\n     │
│   __typename\n  }\n}","variables":{}}} 401 undefined                         │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

Operating system

Windows 11

CLI version

4.4.0

Shell

Powershell

Nodejs version

v24.18.0

What language and version are you using in your application?

Plain basic shopify template

Are you certain that the password you’re using for the store is correct? The error message in the response suggests that it isn’t.

Yes, I set it up via the Theme Access app with the help of live support. Later, when I tried to connect using the password obtained via the link sent to my email, I encountered this error. I don’t have second account just 1 email for everything but maybe it got confused because I logged in with google

Do you have any request IDs that you can share?

Are you sure that the store you’re providing is the correct one?

I ran this command:
shopify theme pull --store=DOMAIN_NAME.myshopify.com --password=shptka_*** --verbose

and there is 2 diffrent request ids
x-request-id: 38c45403-ead5-4554-bf8c-ce1578409078-1783629705
x-request-id: 75d8ec04-6076-4f9a-93a2-b9232592b8bc

Are these the request IDs you asked?

I looked at the request ID and the shop that you are passing to --store has no Theme Access records.

Are you sure you installed the Theme Access app on the same store that you’re passing to --store?

I’m new to the Shopify ecosystem, and I currently have only one store. It’s using my own domain. I’m wondering if there might be some confusion between my custom domain and the myshopify.com domain.

If I want to start over from scratch using my local theme files, what steps should I follow?

If you’re working on your own store you don’t need the Theme Access app at all. Instead run your command and authenticate through the default CLI flow.

The domain that you pass to --store needs to be your myshopify.com domain, not your custom domain.

You can continue to use the Theme Access app if you want. Just make sure that you pass your myshopify.com domain.

But when I log in using the same email address on the login page that appears after this command

shopify theme info --store DOMAIN_NAME.myshopify.com

I got this error

╭─ error ───────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ You are not authorized to use the CLI to develop in the provided store: DOMAIN_NAME.myshopify.com │
│ │
│ Next steps │
│ • Ensure you have logged in to the store using the Shopify admin at least once. │
│ • Ensure you are the store owner, or have a staff account if you are attempting to log in to a dev store. │
│ • Ensure you are using the permanent store domain, not a vanity domain. │
│ │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

oauth request ids:
x-request-id: bbec42c5-eec1-4f07-8a76-7357fad8f6cb-1783634193
x-request-id: 4d0973c5-5dfd-44b6-b3ca-3e2a536a44b7-1783634199
x-request-id: 2de741f0-648f-484e-8ae8-1cf2941235f2-1783634199

/v1/produce request id:
x-request-id: da946ee0-fcea-4bf4-ad76-aff54d1a324c

As the error message says, you need to make sure you’re using your myshopify.com domain. Do you know what that is?

Just adding some additional information.

I have the issue as well, so far only noticed it on one store that I am collaborating on. I do not get the issue on other stores I’ve worked on within the same day.

I tried auth logout and auth loginbut with no luck. It is a live store, so no password. I also tried login into the store through the Dev Dashboard in case the login was expired, still no luck.

I only work through the CLI, so no access token within the shopify.theme.toml file

x-request-id: 3b1dcc9c-485e-4f7f-aac8-3d4370826f22

Okay, I found the solution.

Under Domains in my Shopify admin, there were two different Shopify domains: one was custom_domain.myshopify.com, and the other was random_string.myshopify.com.

I changed the command to:

shopify theme info --store random_string.myshopify.com

and it worked.