Command line interfaces (CLIs) let coders design websites and build apps by typing simple text commands instead of clicking buttons or pulling down menus. Typing commands is usually faster than clicking, and you can combine multiple commands into scripts that run on their own. Shopify CLI is the official command-line tool for the Shopify platform, used for everything from developing themes to building standalone Shopify apps and designing custom storefronts.
You’ll get the most out of the Shopify CLI if you’re building custom applications with app extensions or working with Shopify’s Hydrogen framework—neither of these have point-and-click equivalents.
This guide covers the different types of Shopify CLI commands and best practices for using them in your Shopify store.
What is Shopify CLI?
Shopify CLI is a tool you install on your own machine and run from a terminal. It’s the officially supported way to build Shopify apps, themes, and storefronts using Shopify’s Hydrogen framework. The Shopify CLI helps you manage the full life cycle for everything you create: setting up new projects, running local development servers, testing each project using actual store data, and deploying to your Shopify environment.
Shopify recommends using Shopify CLI because it handles the tedious setup work for you—scaffolding a project, tunneling to a dev store for live preview, and automating deployment of extensions and config—saving you from creating it all by hand.
CLI also gives you direct access to manage all the apps and stores on your Shopify Dev Dashboard, the central hub for building on Shopify.
Before you install Shopify CLI, make sure your local development environment meets these requirements:
Once those are in place, install Shopify CLI globally with npm install -g @shopify/cli@latest, or the Yarn or pnpm equivalent. On macOS you can use Homebrew instead with the command brew tap shopify/shopify, then brew install shopify-cli.
What are Shopify CLI commands?
Shopify CLI commands are how you interact with the Shopify CLI to build and manage apps, themes, and storefronts. Every command in Shopify CLI uses a consistent syntax: shopify [topic] [command].
“Topic” tells the CLI the type of project you’re working on—such as app, theme, or hydrogen—as well as more broadly applicable topics like configuration (config) and authentication (auth).
“Command” tells the CLI what task to perform. Running app config link, for example, writes a shopify.app.toml file into your project and ties it to an app record in the Dev Dashboard. Running theme dev uploads your local theme to a development theme (a temporary copy that lives on the connected store and is deleted after seven days of inactivity) and gives you a live preview link that updates automatically as you edit.
Common Shopify CLI command categories
Shopify CLI commands generally fall into a handful of functional buckets:
-
Scaffolding. Sets up a new project with the right file structure so you don't build it by hand. Example: app init.
-
Local development. Builds your project and syncs it to a dev store so you can preview changes live as you work. Example: theme dev.
-
Inspection and syncing. Keeps your local files, configuration, or environment variables in sync with what's actually on Shopify. Example: app config pull.
-
Quality checks. Catches errors or bad practices before you ship. Example: theme check.
-
Deployment and release. Pushes your work live, or promotes an already-deployed version to be the active one. Example: app deploy.
-
Monitoring. Offers visibility into what's happening after your app or theme is running. Example: app logs.
Essential Shopify CLI commands for app development
When building an app for your Shopify store, the typical development workflow follows four steps:
1. Create a new app. The shopify app init command scaffolds the project and creates the corresponding app record in the Dev Dashboard.
2. Start a local development environment. Running shopify app dev builds the app, tunnels it to a connected dev store, and watches for changes while you build.
3. Generate app extensions. You can use shopify app generate extension to add scaffolding for things like checkout UI extensions or functions, and shopify app configvalidate to catch configuration mistakes before they cause problems downstream.
4. Deploy apps and extensions. Once a change is ready, shopify app deploy builds everything and pushes a new app version (config + extensions) to Shopify, and shopify app release promotes that version to live if you didn't release it immediately on deploy.
Essential Shopify CLI commands for theme development
For developers building a Shopify theme, the typical workflow looks like this:
1. Create a new theme. The shopify theme init command clones a starter theme (like Skeleton) to use as your project's foundation.
2. Preview your theme. After customizing your theme inside a code editor, use shopify theme dev to upload it to a connected store. The command gives you a live preview link and updates the theme automatically as you make changes.
3. Check your code for errors. You can use shopify theme check to catch syntax errors in Shopify’s Liquid template language, or violations of Shopify best practices, such as missing width or height attributes on <img> tags. The shopify theme console command lets you test Liquid logic interactively against real store data before going live with any changes.
4. Sync your files. As you work, shopify theme pull downloads files from a theme on your store, while shopify theme push uploads your local changes.
5. Publish. Once a change is ready, use shopify theme push--unpublished to upload and preview the theme, then run shopify theme publish to make it live. You can also use shopify theme push--live to update the current live theme directly.
Essential Shopify CLI commands for Hydrogen
Development teams that need a fully customized front end can turn to Hydrogen, Shopify’s headless commerce stack built on React Router. Hydrogen is optimized for Oxygen, Shopify’s global edge hosting platform, but it can also be hosted elsewhere.
Compared with Shopify’s theme architecture, Hydrogen gives developers greater control over the storefront and its data sources. For example, you can combine Shopify commerce data with content from a custom CMS, booking system, or other external service.
Hydrogen can also support a broader omnichannel strategy. Using Shopify APIs, brands can build a Hydrogen storefront alongside mobile apps and other digital experiences, all connected to the same product catalog and inventory. This gives brands the flexibility to create tailored experiences across channels while keeping commerce operations centralized in Shopify.
If you’re using Shopify CLI for Hydrogen, your workflow might look something like this:
1. Create a new Hydrogen storefront. To scaffold a new Hydrogen project, you’d use the shopify hydrogen init command (or npm create @shopify/hydrogen@latest).
2. Link your project to Shopify. Run shopify hydrogen link to connect your local project to a Hydrogen storefront.
3. Start a local development server. Running shopify hydrogen dev starts a local development server that emulates Shopify's Oxygen hosting environment, allowing you to preview how your storefront will operate as you write code.
4. Generate types for your API queries. The shopify hydrogen codegen command generates TypeScript types from the GraphQL operations in your project, helping you catch query and type errors during development.
5. Pull your environment variables. Use shopify hydrogen env pull to download download variables from the linked Hydrogen environment into a local .env file so your code can use them.
6. Build and deploy your storefront. Use shopify hydrogen build to compile the project for production, then run shopify hydrogen deploy to create a deployment in your selected Oxygen environment. You can deploy to a preview environment for testing before releasing to production.
Shopify CLI best practices
- Check your Shopify login
- Know which Shopify CLI version you’re using
- Use Shopify CLI to build, Dev Dashboard to manage
- Upload your projects to a Git hosting service
- Automate your deployments
- When in doubt, check Shopify Dev Docs
The following best practices can help you keep your Shopify CLI workflow smooth and predictable:
Check your Shopify login
Before using the Shopify CLI, check which store you’re connected to. Shopify recommends building against a dev store rather than a live storefront, and creating one requires a Shopify Partner account or a store with developer permissions. Use the shopify theme info command to see which store your project is pointed at, and shopify auth logout to clear your last session if you need to switch accounts.
Know which Shopify CLI version you’re using
Shopify CLI 4.0 and later will automatically install the latest commands and bug fixes using whichever package manager you installed it with. If you encounter an unexpected error, use the CLI command shopify version to check whether a new version was installed and is causing your project to behave differently. Use the CLI command shopify config autoupgrade off if you need to temporarily disable automatic updates, and shopify upgrade to update immediately.
Use Shopify CLI to build, Dev Dashboard to manage
Once you’ve used Shopify CLI to scaffold and create an app, use the Dev Dashboard as the central hub for checking app status, managing credentials and permissions, and viewing logs for all the apps tied to your business.
Upload your projects to a Git hosting service
Git hosting services like GitHub help you manage code changes with version control. Apps and theme projects work well with standard Git workflows, but avoid adding .env files to a Git repository. Otherwise you could end up accidentally exposing access credentials for your Shopify store.
Automate your deployments
Set up a continuous integration/continuous delivery (CI/CD) pipeline and use it each time you deploy new code to your storefront. Automating the pipeline ensures that only clean, known versions of the code can go live.
When in doubt, check Shopify Dev Docs
If something isn’t working the way you expect it to, check Shopify’s canonical source for information about Shopify CLI. Shopify.dev is where you’ll find the most current and accurate information on the latest version of the CLI.
Shopify CLI commands FAQ
How does Shopify CLI work?
Shopify CLI is a command line tool you install on your local machine that lets you build apps, customize themes, or create custom storefronts using simple text commands. Every command starts the same way: The word shopify followed by the thing you’re creating and the task you need to complete.
What are some Shopify CLI commands?
Shopify CLI commands include shopify app dev (to preview your work as you build), shopify theme check (to flag errors in your Shopify Liquid theme), and shopify app deploy (to push your finished changes to the store). There are dozens more, but these cover the core day-to-day workflow of building, testing, and releasing.
What is the latest Shopify CLI version?
Because this tool updates frequently, running the shopify version command in the Shopify CLI or checking the Shopify CLI page will give you the most up-to-date answer.




