Skip to content

feat(cli): add config autoupgrade [on|off|status] commands#7328

Open
alfonso-noriega wants to merge 5 commits intomainfrom
add-autoupgrade-to-config
Open

feat(cli): add config autoupgrade [on|off|status] commands#7328
alfonso-noriega wants to merge 5 commits intomainfrom
add-autoupgrade-to-config

Conversation

@alfonso-noriega
Copy link
Copy Markdown
Contributor

@alfonso-noriega alfonso-noriega commented Apr 16, 2026

What

Adds shopify config autoupgrade [on|off|status] commands so users can manage the auto-upgrade preference directly, without having to first run shopify upgrade.

Why

Previously, the only way to configure auto-upgrade was through the interactive prompt that appears during shopify upgrade. This is now a first-class config command, consistent with how config autocorrect works.

Changes

  • shopify config autoupgrade on — enables auto-upgrade
  • shopify config autoupgrade off — disables auto-upgrade
  • shopify config autoupgrade status — shows current state (on / off / not yet configured)

Re-exports getAutoUpgradeEnabled and setAutoUpgradeEnabled from the public @shopify/cli-kit/node/upgrade module so the new commands can consume them.

Updates promptAutoUpgrade() to skip the prompt when the preference is already set, so shopify upgrade won't re-prompt after the user configures it via these commands (or from a previous upgrade run).

Copy link
Copy Markdown
Contributor Author

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

@alfonso-noriega alfonso-noriega marked this pull request as ready for review April 16, 2026 13:33
@alfonso-noriega alfonso-noriega requested a review from a team as a code owner April 16, 2026 13:33
Copy link
Copy Markdown
Contributor

/snapit

@github-actions
Copy link
Copy Markdown
Contributor

🫰✨ Thanks @gonzaloriestra! 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-20260416141350

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.

@alfonso-noriega alfonso-noriega requested a review from a team as a code owner April 16, 2026 14:45
Copy link
Copy Markdown
Contributor

/snapit

@github-actions
Copy link
Copy Markdown
Contributor

🫰✨ Thanks @gonzaloriestra! 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-20260416144658

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.

@alfonso-noriega alfonso-noriega force-pushed the add-autoupgrade-to-config branch from 1c1f0bb to bd32cfd Compare April 16, 2026 14:52
Copy link
Copy Markdown
Contributor

@gonzaloriestra gonzaloriestra left a comment

Choose a reason for hiding this comment

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

Working great!

Comment thread packages/cli/src/cli/commands/config/autoupgrade/constants.ts Outdated

static descriptionWithMarkdown = `Enable automatic upgrades for Shopify CLI.

When auto-upgrade is enabled, Shopify CLI automatically updates to the latest version after each command.
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.

What about explaining that it only happens once per day and that it skips major versions?

- Add shopify config autoupgrade on/off/status commands to manage the
  auto-upgrade preference without needing to run shopify upgrade first
- Re-export getAutoUpgradeEnabled and setAutoUpgradeEnabled from the
  public @shopify/cli-kit/node/upgrade module
- Skip the upgrade prompt in promptAutoUpgrade() when already configured,
  so shopify upgrade no longer re-prompts after the preference is set
- Add shopify config autoupgrade on/off/status commands to manage the
  auto-upgrade preference without needing to run shopify upgrade first
- Re-export getAutoUpgradeEnabled and setAutoUpgradeEnabled from the
  public @shopify/cli-kit/node/upgrade module
- Skip the upgrade prompt in promptAutoUpgrade() when already configured,
  so shopify upgrade no longer re-prompts after the preference is set
@alfonso-noriega alfonso-noriega force-pushed the add-autoupgrade-to-config branch from bd32cfd to 2540ab8 Compare April 16, 2026 15:13
@alfonso-noriega alfonso-noriega force-pushed the add-autoupgrade-to-config branch from f1995d9 to dde281e Compare April 16, 2026 15:53
@github-actions
Copy link
Copy Markdown
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/upgrade.d.ts
@@ -1,3 +1,5 @@
+import { getAutoUpgradeEnabled, setAutoUpgradeEnabled } from '../../private/node/conf-store.js';
+export { getAutoUpgradeEnabled, setAutoUpgradeEnabled };
 /**
  * Utility function for generating an install command for the user to run
  * to install an updated version of Shopify CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants