Add shopify store open command#7955
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
25ca7d1 to
5ea31e3
Compare
|
/snapit |
|
🫰✨ Thanks @amcaplan! Your snapshot has been published to npm. Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260629202701Caution After installing, validate the version by running |
There was a problem hiding this comment.
Pull request overview
Adds a new shopify store open --store <domain> command to open a store’s storefront URL in the default browser, resolving preview-store tokenized URLs via the existing getStoreInfo service.
Changes:
- Introduces
store opencommand (store:open) and registers it in the store package command map. - Implements
openStore()service that resolves the correct storefront URL (preferringaccessUrl) and falls back to printing a link when the browser can’t be opened. - Adds unit tests for both the service behavior and the command wiring, plus a changeset and updated oclif manifest entry.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/store/src/index.ts | Registers the new store:open command in the store package command map. |
| packages/store/src/cli/services/store/open.ts | Adds openStore() service to resolve and open/print the storefront URL. |
| packages/store/src/cli/services/store/open.test.ts | Unit tests for URL selection and “browser didn’t open” fallback behavior. |
| packages/store/src/cli/commands/store/open.ts | New oclif command definition and flag parsing for shopify store open. |
| packages/store/src/cli/commands/store/open.test.ts | Unit tests verifying the command passes the --store flag through to the service. |
| packages/cli/oclif.manifest.json | Adds the generated manifest entry for store:open. |
| .changeset/store-open-command.md | Declares a user-facing minor release note for the new command. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| '@shopify/store': minor | ||
| --- | ||
|
|
||
| Add `shopify store open` to open a store's storefront in your default browser. |
There was a problem hiding this comment.
As the command is hidden and therefore not user facing I don't think we should add a change set entry
| "examples": [ | ||
| "<%= config.bin %> <%= command.id %> --store shop.myshopify.com" | ||
| ], | ||
| "flags": { |
There was a problem hiding this comment.
Would it make sense to include a password flag for those non preview stores that ask for password to get in?
There was a problem hiding this comment.
I would treat that as an optional later enhancement. It still works for preview stores, which is the main focus at present, and for other stores they'll have to enter the password manually.
Opens a store's storefront in the default browser. Reuses the store info lookup so preview stores open their tokenized access URL. Assisted-By: devx/14c34c82-e316-418f-9255-474db36c1b87
Assisted-By: devx/14c34c82-e316-418f-9255-474db36c1b87
5ea31e3 to
0ca8964
Compare

WHY are these changes introduced?
Opening a store today means hunting for the right URL. Agents and humans working with stores (especially preview stores, which surface long tokenized access URLs) need a quick, reliable way to jump straight into a storefront without copying URLs around by hand.
This implements the
shopify store opendesign shared in #proj-agentic-store-preview.WHAT is this pull request doing?
Adds a new
shopify store open --store <domain>command that opens a store's storefront in your default browser.packages/store/src/cli/commands/store/open.tsopenStore():packages/store/src/cli/services/store/open.tsstore:openinpackages/store/src/index.tsURL resolution goes through the existing
getStoreInfoservice rather than naively building a URL from the domain string. This matters for preview stores, which expose a tokenizedaccessUrlthat can't be reconstructed from the domain alone. Regular stores resolve tohttps://<subdomain>. If the browser can't auto-open (e.g. cloud/headless environments), the command prints a clickable URL instead.How to test your changes?
shopify store open --store <your-store>.myshopify.com— opens the storefront.Unit tests:
pnpm exec vitest run packages/store/src/cli/services/store/open.test.tsChecklist
minorchangeset