How to install Shopify CLI and use it for theme work

Shopify CLI installs with one command from npm, Yarn, pnpm or Homebrew, once Node.js 22.12 or higher and Git are on your machine. For theme work you pull the theme, preview your changes with shopify theme dev, and push them to an unpublished copy before anything reaches the live store.

A flat drawing of a terminal window with a purple prompt arrow, a lime green cursor line and three lines of text, on a pale lilac background.

Shopify CLI is the tool we use on the themes of the stores we look after under a support retainer. It changes often, so every command below was checked against Shopify’s documentation in November 2026, with the CLI at version 4.

What you need

  • Node.js 22.12 or higher
  • a package manager: npm, Yarn 1.x or pnpm
  • Git 2.28.0 or higher
  • access to the store as the owner, or with a staff or collaborator account that has the Themes permission

The CLI runs on Windows, macOS and Linux.

Install it

Pick the line for your package manager:

npm install -g @shopify/cli@latest
yarn global add @shopify/cli@latest
pnpm install -g @shopify/cli@latest

On macOS you can use Homebrew:

brew tap shopify/shopify
brew install shopify-cli

Check that it works:

shopify version

From version 4.0 the CLI upgrades itself with the package manager you installed it with. To upgrade right away, run shopify upgrade.

Log in

There is no setup step. The first command that needs the store opens the login in your browser. A good first command is the list of themes:

shopify theme list --store your-store

--store takes the store prefix or the full myshopify.com address. shopify theme info shows which store you are working on. To change account, run shopify auth logout.

If you cannot have an account on the store, the owner can install the Theme Access app and send you a password. You pass it to each command with --password.

Pull the theme

Work starts from the code that is in the store today.

mkdir my-theme
cd my-theme
shopify theme pull --store your-store

The CLI asks which theme to download. Add --live to take the published theme, or --theme with a theme’s name or ID.

Preview your changes with theme dev

shopify theme dev --store your-store

This uploads your local files to a development theme and gives you a preview at http://127.0.0.1:9292, with the store’s real products and content. Changes to CSS and sections reload as you save. Shopify’s tutorial says to open the preview in Google Chrome.

A development theme is temporary and hidden. It does not count toward the store’s theme limit. Shopify deletes it after seven days without activity, or when you log out.

Two things to know:

  • Checkout customizations cannot be previewed at this address.
  • Changes made in the theme editor stay in the store. Add --theme-editor-sync to bring them into your local files.

Push to an unpublished copy

When the change is ready for someone else to see, push it to a new unpublished theme:

shopify theme push --unpublished --theme "Homepage update"

The command returns a link to the theme editor and a preview link you can share. Later pushes to the same copy use shopify theme push --theme "Homepage update".

Take care with a plain shopify theme push. It asks which theme to overwrite, and it deletes remote files that are not in your local folder unless you add --nodelete.

What the store’s team sets in the theme editor is saved in the theme’s JSON files. If they keep editing while you work, pull before you push, or leave those files out with --ignore or a .shopifyignore file.

Before pushing, shopify theme check reads the code for errors. When the copy is approved, shopify theme publish makes it the live theme.

Where the GitHub integration fits

Shopify’s GitHub integration connects a branch of a repository to a theme. You set it up in the admin, under Online Store > Themes > Add theme > Connect from GitHub. The branch needs the default theme folder structure.

The connection works both ways. Commits pushed to the branch update the theme. Changes made in the Shopify admin are committed to the branch by Shopify, and this cannot be turned off. Shopify suggests connecting your main branch and publishing that theme.

The two tools cover different parts of the job:

  • The CLI is for work on your machine and for previews.
  • Git keeps the history and makes review possible.
  • The integration delivers what was merged.

A common flow is a branch per change, shopify theme dev while you work, a pull request, then a merge into the connected branch.

Two habits help. Run git pull before you start, since editor changes arrive as commits. And edit code in the repository only. The code editor in the admin overwrites the GitHub version without a conflict warning.

How we work on client themes

We follow three rules on every client theme.

  • A copy of the theme. We work on an unpublished copy or on a staging store. The live theme is the last thing we touch.
  • Version control. Every change is a commit, so we can see what changed and go back.
  • Review before publishing. A change is reviewed, and you see it on a preview link before it goes live.

On a retainer this starts with the onboarding. We read the theme and the apps, write down what we find and set up the staging store. From then on each request ships on staging first and then live.

Keep reading

Tell us what you are working on

Book a 15-minute call, or write to us.

Book a call (opens in a new tab)