When running Shopify CLI in a headless environment (e.g. VS Code Server / Remote SSH), shopify auth login attempts to open a browser using xdg-open, which fails and results in the following error:
Error: spawn xdg-open ENOENT
This happens because Shopify CLI assumes a local desktop environment during authentication. In remote or server-based setups, there is no browser available, even though authentication can still succeed via device authorization.
Expected behavior:
-
Detect headless or remote environments automatically
-
Avoid attempting to open a local browser
-
Clearly instruct users to complete device authentication on their local machine
Proposed improvements:
-
Default to device-auth flow when no GUI/browser is available
-
Improve messaging to avoid surfacing
xdg-openerrors -
Add a first-class flag like
--no-browseror--headless -
Document official support for using Shopify CLI (including
shopify theme dev) in VS Code Server / remote environments
This would improve developer experience for modern remote-first workflows and reduce confusion during initial CLI authentication.