cli icon indicating copy to clipboard operation
cli copied to clipboard

[Feature]: environment prompt

Open stijns96 opened this issue 10 months ago • 2 comments

What area(s) will this request affect?

Theme

What type of change do you want to see?

Substantial change to existing feature

Overview

Within our company we have built a wrapper around the Shopify CLI to e.g. build our files first and after that spin up the Shopify server. Additionally, when you execute pnpm run push, and you don't give it a environment flag, it will prompt the user to choose an environment from the shopify.theme.toml. The user can select one or even multiple environments to push to. The CLI will then do a built and pushes it to the select environment(s). When you select multiple is pushes the themes one by one.

Motivation

Speed up the releasing process and making releasing themes easier throughout multiple stores and staging environments

stijns96 avatar Feb 27 '25 07:02 stijns96

This issue 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.

P.S. You can learn more about why we stale issues here.

github-actions[bot] avatar Apr 24 '25 03:04 github-actions[bot]

👀

stijns96 avatar Apr 24 '25 04:04 stijns96

This issue 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.

P.S. You can learn more about why we stale issues here.

github-actions[bot] avatar Jun 06 '25 03:06 github-actions[bot]

👀

stijns96 avatar Jun 06 '25 05:06 stijns96

🤔 I think a prompt on every command would bring a lot of toil to the average developer because they're used to selecting the environment once and then having that environment be used automatically in subsequent commands until they decide to choose another one.

We do have some work coming down the pipe that will allow you to supply multiple environments to a command:

shopify theme push -e production -e staging

Would that solve this for you?

We also have a proposal for multi-session support but I don't think that necessarily applies to what you're talking about: https://github.com/Shopify/cli/pull/5914

graygilmore avatar Jun 24 '25 16:06 graygilmore

Well, we are actually doing the same, which makes it possible for devs to setup their package.json to use that command with the right env out of the box. Exactly like you're mentioning as well.

That is also why I'm asking for s prompt, so you can easily select one or multiple environments.

At the same time I do understand the current setup where they only have to select the right environment ones. But to be honest, what would be the problem for those devs to add a script with the environment flag so we can have a prompt everytime you don't provide one?

I'm not sure if there are any analytics about these use cases, but I can imagine that there are more cases like mine then single devs that are just working in one environment for more then a couple of months/years.

Anyways, if this would not be implemented, I'll get the point. Just thinking out loud here 🙂

P.s. if you're interested, I can check if I can give access to the CLI repo so you can have a look on it to maybe get some better idea of it.

stijns96 avatar Jun 24 '25 16:06 stijns96

I think prompting on every command is a non-starter but there are potentially some other ways to get here. I think our multi-environment flags mentioned above solves a lot of it but maybe we could do something where if you pass an -e flag without a value it then prompts you to select?

That way it's opt-in functionality but something that you could easily add to your package.json to trigger. What do you think? So it'd be shopify theme push -e.

graygilmore avatar Jun 24 '25 17:06 graygilmore

This issue 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.

P.S. You can learn more about why we stale issues here.

github-actions[bot] avatar Aug 06 '25 03:08 github-actions[bot]

Let us know if you have any further thoughts, thanks!

graygilmore avatar Aug 07 '25 16:08 graygilmore