Skip to content

Add shopify store open command#7955

Merged
amcaplan merged 3 commits into
mainfrom
store-open-command
Jul 1, 2026
Merged

Add shopify store open command#7955
amcaplan merged 3 commits into
mainfrom
store-open-command

Conversation

@amcaplan

@amcaplan amcaplan commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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 open design 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.

  • New command: packages/store/src/cli/commands/store/open.ts
  • New service openStore(): packages/store/src/cli/services/store/open.ts
  • Registered as store:open in packages/store/src/index.ts

URL resolution goes through the existing getStoreInfo service rather than naively building a URL from the domain string. This matters for preview stores, which expose a tokenized accessUrl that can't be reconstructed from the domain alone. Regular stores resolve to https://<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?

  1. shopify store open --store <your-store>.myshopify.com — opens the storefront.
  2. Try with a preview store — confirm it opens the tokenized access URL.
  3. In an environment where the browser can't open, confirm a clickable URL is printed.

Unit tests: pnpm exec vitest run packages/store/src/cli/services/store/open.test.ts

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — added a minor changeset

amcaplan commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Jun 29, 2026
@amcaplan amcaplan force-pushed the store-open-command branch 2 times, most recently from 25ca7d1 to 5ea31e3 Compare June 29, 2026 20:18
@amcaplan

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

Copy link
Copy Markdown
Contributor

🫰✨ 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-20260629202701

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@amcaplan amcaplan marked this pull request as ready for review June 30, 2026 16:04
@amcaplan amcaplan requested a review from a team as a code owner June 30, 2026 16:04
Copilot AI review requested due to automatic review settings June 30, 2026 16:04
@amcaplan amcaplan requested a review from a team as a code owner June 30, 2026 16:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 open command (store:open) and registers it in the store package command map.
  • Implements openStore() service that resolves the correct storefront URL (preferring accessUrl) 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.

Comment thread packages/store/src/cli/commands/store/open.ts
Comment thread .changeset/store-open-command.md Outdated
'@shopify/store': minor
---

Add `shopify store open` to open a store's storefront in your default browser.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to include a password flag for those non preview stores that ask for password to get in?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

amcaplan added 3 commits July 1, 2026 12:06
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
@amcaplan amcaplan force-pushed the store-open-command branch from 5ea31e3 to 0ca8964 Compare July 1, 2026 09:06
@github-actions github-actions Bot added no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. and removed Area: @shopify/cli @shopify/cli package issues labels Jul 1, 2026

@alfonso-noriega alfonso-noriega left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎩, great work!

@amcaplan amcaplan added this pull request to the merge queue Jul 1, 2026
Merged via the queue into main with commit b4cd637 Jul 1, 2026
29 checks passed
@amcaplan amcaplan deleted the store-open-command branch July 1, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants