---
title: Migrate to Shopify CLI 4.0
description: >-
  Update your commands, deployment scripts, and Node.js environment for Shopify
  CLI 4.0.
source_url:
  html: 'https://shopify.dev/docs/api/shopify-cli/migrate/4-0'
  md: 'https://shopify.dev/docs/api/shopify-cli/migrate/4-0.md'
api_name: shopify-cli
---

# Migrate to Shopify CLI 4.​0

Shopify CLI 4.0 removes deprecated commands and flags, drops support for Node.js 20, and introduces automatic upgrades. Follow this guide to update an existing Shopify CLI 3.x installation and any scripts that use it.

***

## Requirements

* Install [Node.js](https://nodejs.org/en/download/) 22.12 or higher, including in CI environments.
* Identify any scripts that run Shopify CLI commands, including package scripts and CI workflows.

***

## Step 1: Replace removed commands and flags

Update your scripts to use the following replacements:

| Removed in 4.0 | Replacement |
| - | - |
| `shopify webhook trigger` | `shopify app webhook trigger` |
| `shopify theme serve` | `shopify theme dev` |
| `shopify app generate schema` | `shopify app function schema` |
| `shopify app scaffold extension` | `shopify app generate extension` |
| `shopify app generate extension --type` or `-t` | `shopify app generate extension --template` |
| `SHOPIFY_FLAG_EXTENSION_TYPE` | `SHOPIFY_FLAG_EXTENSION_TEMPLATE` |
| `shopify app webhook trigger --shared-secret` | `shopify app webhook trigger --client-secret` |
| `SHOPIFY_FLAG_SHARED_SECRET` | `SHOPIFY_FLAG_CLIENT_SECRET` |

***

## Step 2: Choose deployment permissions

The `app deploy` and `app release` commands no longer accept `--force`, `-f`, or `SHOPIFY_FLAG_FORCE`. Replace them with permissions that match the changes your pipeline needs to make:

| Required behavior | Flags |
| - | - |
| Allow updates without allowing deletions | `--allow-updates` |
| Allow updates and deletions without a confirmation prompt | `--allow-updates --allow-deletes` |

For guidance on avoiding accidental store data deletion, refer to [Controlling extension and configuration deployment](https://shopify.dev/docs/apps/launch/deployment/deploy-in-ci-cd-pipeline#controlling-extension-and-configuration-deployment).

For example, if an unattended deployment uses `--force`, then replace it with the following command:

## terminal

```sh
shopify app deploy --allow-updates
```

Add `--allow-deletes` only when your pipeline needs permission to delete app configuration or extensions. The `app deploy --no-release` flag continues to work and implicitly allows updates and deletions for the unreleased version.

***

## Step 3: Upgrade Shopify CLI

Upgrade Shopify CLI with the package manager that you installed it with:

## terminal

##### npm

```sh
npm install -g @shopify/cli@4
```

##### yarn

```sh
yarn global add @shopify/cli@4
```

##### pnpm

```sh
pnpm install -g @shopify/cli@4
```

##### homebrew

```sh
brew upgrade shopify-cli
```

The npm, Yarn, and pnpm commands install the latest 4.x release. Homebrew upgrades to the latest available release.

For a project-local installation, update the project's `@shopify/cli` dependency and commit the lockfile. Update the version in CI workflows that install Shopify CLI directly.

Starting with 4.0, Shopify CLI upgrades itself automatically within the current major version. It doesn't upgrade automatically in CI environments or project-local installations, or when the next release changes the major version.

To turn off automatic upgrades, run:

## terminal

```sh
shopify config autoupgrade off
```

To turn them on again, run `shopify config autoupgrade on`.

***

## Step 4: Verify your migration

Check the version from the directory where you run Shopify CLI:

## terminal

```sh
shopify version
```

Confirm that it reports 4.x. Check your package scripts and CI workflows for removed commands, flags, and environment variables. Run your usual development workflow with the updated installation.

***

## Next steps

* Review the [Shopify CLI 4.0 release notes](https://github.com/Shopify/cli/releases/tag/4.0.0).
* Look up current flags in the [Shopify CLI command reference](https://shopify.dev/docs/api/shopify-cli).

***
