shopify-auth is a small Go wrapper for switching between Shopify CLI accounts
using memorable local profile names.
$ shopify-auth use work
Current account: developer@example.com.
Using profile "work" (developer@example.com).It delegates authentication to Shopify CLI's native multi-account support.
Shopify CLI owns and refreshes the credentials; shopify-auth never reads,
copies, or stores access tokens.
- Shopify CLI with the
auth login --aliasflag (verified with 4.5.2) - Go 1.22 or newer only when installing with
go installor building from source
Install Shopify CLI if needed:
npm install -g @shopify/cli@latestbrew install frknue/tap/shopify-authHomebrew keeps shopify-auth updated with brew upgrade. If Shopify CLI is
not installed yet, install its official formula as well:
brew install shopify/shopify/shopify-cligo install github.com/frknue/shopify-auth/cmd/shopify-auth@latestMake sure Go's bin directory is on PATH.
Prebuilt archives for macOS, Linux, and Windows are available on the
GitHub Releases page.
Download the archive for your operating system and architecture, then place
the shopify-auth executable somewhere on PATH.
git clone https://github.com/frknue/shopify-auth.git
cd shopify-auth
make build
./bin/shopify-auth --helpRun use without a name to choose a profile or add an account:
$ shopify-auth use
? Choose a profile
> work (developer@example.com)
personal (personal@example.com)
Add accountUse the ↑/↓ arrow keys and press Enter. When standard input or output is redirected, the command falls back to a numbered prompt for compatibility.
You can also switch directly by profile name:
shopify-auth use work
shopify-auth use personalWhen creating a profile, enter a name such as work, choose or log in to the
account using Shopify's native arrow-key picker. shopify-auth captures the
account Shopify confirms and creates a mapping such as work →
developer@example.com; there is no alias to retype.
Shopify's --alias flag selects an existing session rather than renaming it.
See the auth login command reference.
List saved profiles:
$ shopify-auth list
* work developer@example.com
personal personal@example.comThe * marks the last selected profile. Shopify CLI doesn't currently expose
an auth list command, so this mapping is maintained by shopify-auth; it
contains no tokens.
Every saved switch is verified against Shopify CLI's reported Current account: value before the local profile is marked current. If Shopify no
longer knows a saved alias, the native picker opens once so the mapping can be
repaired.
All later shopify ... commands use the selected account. To remove every
saved Shopify CLI session (with confirmation):
shopify-auth logoutFor scripts, the confirmation can be skipped explicitly with
shopify-auth logout --force.
logoutis Shopify CLI's global logout operation; it removes all saved account sessions, not only the currently selected one.
Run shopify-auth --help for the complete command list.
After resolving a local profile, the switch is equivalent to:
shopify auth login --alias developer@example.comUsing Shopify's public command keeps this tool independent of the CLI's private
credential format and the operating system keychain implementation. For the
list command, it stores only profile names, Shopify session aliases, and the
last selected profile in the operating system's user configuration directory.
Writes are atomic and locked so simultaneous commands cannot overwrite one
another. Older name-only configurations are preserved and linked through the
native Shopify picker when selected. Set SHOPIFY_AUTH_CONFIG to override the
metadata file location.
go test ./...
go test -race ./...
go vet ./...