cli icon indicating copy to clipboard operation
cli copied to clipboard

[Feature] Add "advertise url" arguments to change server URLs output in terminal

Open alanko0511 opened this issue 9 months ago • 2 comments

WHY are these changes introduced?

We're working on a feature that allows users to run Shopify CLI in our isolated cloud container and let them access processes like the theme extension dev server and GraphiQL via our proxy. However, the GraphiQL and theme extension URLs show a hardcoded localhost URL in the terminal.

Therefore, we would like to introduce two new arguments: theme-app-extension-advertise-url and graphiql-advertise-url to the Shopify CLI, so that we can change the URL outputs via environment variables, and users can visit the modified links shown in the remote terminal.

WHAT is this pull request doing?

Introduces two new arguments when running the app dev command:

  • theme-app-extension-advertise-url - Change the theme extension dev server URL shown in the terminal
  • graphiql-advertise-url - Change the GraphiQL URL shown in the terminal

Before: CleanShot 2025-03-30 at 14 27 50

After (with the two args): CleanShot 2025-03-30 at 14 29 14

Note: this Shopify doc (https://shopify.dev/docs/api/shopify-cli/app/app-dev) might also need to include these two new arguments, but I'm not entirely sure how, so no doc-related change is included for now. Please let me know, and I'll fix the doc side.

How to test your changes?

Include the two arguments in the function/component that outputs the URLs, then ensure the URLs shown in the output are not localhost.

Measuring impact

How do we know this change was effective? Please choose one:

  • [ ] n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • [x] Existing analytics will cater for this addition
  • [ ] PR includes analytics changes to measure impact

Checklist

  • [x] I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • [x] I've considered possible documentation changes

alanko0511 avatar Mar 30 '25 18:03 alanko0511

I have signed the CLA!

alanko0511 avatar Mar 30 '25 18:03 alanko0511

ping @gordonhirsch it would be super awesome to get this in -- invaluable for anyone doing Shopify development in the cloud with Gadget or Codespaces or Replit or what have you 💖

airhorns avatar Apr 10 '25 18:04 airhorns

This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.

github-actions[bot] avatar May 11 '25 03:05 github-actions[bot]

re-opening this in https://github.com/Shopify/cli/pull/6286

infiton avatar Aug 20 '25 14:08 infiton