Run shopify theme dev server without going to external browser for OAuth

Hi, I’m new to Shopify theme development. I understand that I need to use the Shopify CLI to run a theme development server, but I’m facing an issue.

Whenever I use a different browser or machine, I have to go through the OAuth login process again. Is there a way to authenticate through an environment variable or CLI option, such as:

shopify theme dev --store storename --auth-token YOUR_TOKEN

This would allow me to avoid logging in through the browser every time.

I’m aware of an app called Shopify Theme Access App. Is it possible to build something similar, where installing the app generates an environment variable or access token that I can use to work on a Shopify theme and run the development server?

This would be especially useful for ai agent or developers who usages cloud-hosted VS Code environments or virtual machines. Each time the machine starts, I could simply provide the required environment variable instead of completing the OAuth process again.

Is there any solution have for this? Or how can i build such an Shopify Access App?

Why would you want to build an app similar to Theme Access? Could you not just install the app on your store?

I am trying to build an AI agent Shopify app that can edit a store theme or create a new theme and modify it. So users can simply ask the AI agent to create a theme or edit their existing theme.

Also, I am not sure about this, but according to the docs, even if you create a Shopify app with write_themes permission, you cannot see the actual live changes until you push the theme to the store and then refresh the browser.

So, I am thinking about creating a similar experience like ChatGPT interface, where the user can tell the AI agent what they want, the AI agent changes the theme code according to their instructions, and a live preview of the changes is shown on the right side. When the changes are completed, the user can then push that theme to the store.

In that case you’d be looking at building an app that will need to request an exception to use the write_themes scope as noted here: themeFilesUpsert - GraphQL Admin

I cannot comment on whether or not an exception will be granted, however.