You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"description": "Resume a pending non-interactive login flow.",
2611
+
"isOptional": true,
2612
+
"environmentValue": "SHOPIFY_FLAG_AUTH_RESUME"
2595
2613
}
2596
2614
],
2597
-
"value": "export interface authlogin {\n /**\n * Alias of the session you want to login to.\n * @environment SHOPIFY_FLAG_AUTH_ALIAS\n */\n '--alias <value>'?: string\n}"
2615
+
"value": "export interface authlogin {\n /**\n * Alias of the session you want to login to.\n * @environment SHOPIFY_FLAG_AUTH_ALIAS\n */\n '--alias <value>'?: string\n\n /**\n * Log in with a new account instead of choosing from existing sessions.\n * @environment SHOPIFY_FLAG_AUTH_NEW\n */\n '--new'?: ''\n\n /**\n * Resume a pending non-interactive login flow.\n * @environment SHOPIFY_FLAG_AUTH_RESUME\n */\n '--resume'?: ''\n}"
Shopify CLI authenticates developers with Shopify through a device-code OAuth flow. This works in local terminals, remote development environments, and agent-driven workflows where a browser might not be available to the CLI process.
4
+
5
+
## Recommended Flow
6
+
7
+
1. Check whether a session is already available with `shopify auth status` or `shopify auth status --json`.
8
+
2. If a session is available, continue with the command that needs authentication.
9
+
3. If no session is available, run `shopify auth login`.
10
+
4. Shopify CLI prints a verification URL and user code, or opens the verification URL in your browser.
11
+
5. The user completes login in the browser.
12
+
6. Complete the CLI flow:
13
+
- In an interactive terminal, keep the command running. It polls and continues automatically after authentication succeeds.
14
+
- In a non-TTY environment, run `shopify auth login --resume` after the user authorizes.
15
+
16
+
Agents should show the verification URL and user code to the user, ask the user to complete authentication in the browser, and then either wait for the interactive command to finish or run `shopify auth login --resume` for a non-TTY login.
17
+
18
+
## Commands
19
+
20
+
-`shopify auth status`: Check whether Shopify CLI has a usable Shopify account session. Use `--json` for stable machine-readable output.
21
+
-`shopify auth login`: Log in to a Shopify account. In a non-TTY environment, this starts the device-code flow, prints the verification URL and code, stashes the device code, and exits without waiting.
22
+
-`shopify auth login --resume`: Resume a pending non-TTY login after the user has authorized in the browser. On success, Shopify CLI exchanges the stashed device code for tokens and stores the session.
23
+
-`shopify auth login --new`: Start a new login instead of reusing or choosing from existing sessions.
24
+
-`shopify auth logout`: Clear the stored Shopify CLI session.
25
+
- Commands that need authentication may start the same login flow automatically when no usable session exists.
26
+
27
+
## Non-TTY Behavior
28
+
29
+
When `shopify auth login` runs without a TTY:
30
+
31
+
1. Shopify CLI checks for an existing usable session.
32
+
2. If a session exists, Shopify CLI prints the current account and exits without starting a new login.
33
+
3. If no session exists, Shopify CLI starts device authorization, prints the verification URL and user code, stores the pending device code, and exits immediately.
34
+
4. After the user authorizes in the browser, run `shopify auth login --resume`.
35
+
36
+
Use `shopify auth login --new` to skip the existing-session check and start a new device authorization flow.
37
+
38
+
## CI
39
+
40
+
Do not start browser-based login from CI. Use credentials provided through the supported environment variables for the command you are running.
41
+
42
+
## Scopes
43
+
44
+
Shopify CLI requests the scopes needed for CLI workflows, including access to Shopify Admin, Partners, Storefront Renderer, Business Platform, and App Management APIs. Individual commands may request additional scopes for the task being performed.
45
+
46
+
## Support
47
+
48
+
For issues with Shopify CLI authentication, see https://shopify.dev/docs/api/shopify-cli or contact Shopify support at https://help.shopify.com.
0 commit comments