Shopify CLI is a command-line interface tool that helps you build Shopify apps. It quickly generates Shopify apps and generates app extensions. You can also use it to automate many common development tasks.
This documentation explains how to use Shopify CLI for app development. To learn how to use Shopify CLI for other tasks, refer to the following documentation:
- [Shopify CLI for themes](/docs/storefronts/themes/tools/cli/cli-2/commands)
- [Shopify CLI for Hydrogen storefronts](/docs/api/shopify-cli/hydrogen)
## Features
Shopify CLI accelerates your app development process with the following features:
- Creates new apps using [app templates](/docs/api#app-templates)
- Generates [app extensions](/docs/apps/build/app-extensions) in your app
- Creates app records in the [Partner Dashboard](https://partners.shopify.com/current/apps)
- Builds your app and extensions, and creates a tunnel to let you preview your work in a development store
- Deploys your app configuration and app extensions
- Lets you search the Shopify.dev docs
## Requirements
- You're using the latest version of [Shopify CLI](/docs/api/shopify-cli).
- You're using the latest version of [Chrome](https://www.google.com/chrome/) or [Firefox](https://www.mozilla.org/).
## Getting started
Because Shopify CLI requires a conventional directory structure, you should run this command to initialize your app:
> Tip:
> You can specify the [app template](/docs/api#app-templates) that you want to use with the `--template` flag. You can specify a Shopify app template, or pass a URL to a template hosted in GitHub.
If you have an existing app that wasn't built using Shopify CLI, you can [migrate your app to Shopify CLI](/docs/apps/build/cli-for-apps/migrate-to-latest-cli) for a fully integrated development experience.
Refer to the following tutorials for additional details about creating an app that works with Shopify CLI, or to learn how to work on an existing app that uses Shopify CLI 3.0 or higher:
## App structure
To offer a better and more integrated development experience, apps created using Shopify CLI follow a conventional directory structure. This structure allows you to serve and deploy your web app and [app extensions](/docs/apps/build/app-extensions) at the same time, easily generate new app extensions, and manage all of your app's dependencies in one place.
[Learn more about the structure of apps built with Shopify CLI](/docs/apps/build/cli-for-apps/app-structure).
## Using Shopify CLI for continuous integration
If you have app configuration and extensions that you want to deploy to Shopify regularly, then you can integrate Shopify CLI into your CI/CD pipeline to programmatically deploy your app components using the `deploy` command.
[Learn more about running Shopify CLI in a CI/CD pipeline](/docs/apps/launch/deployment/deploy-in-ci-cd-pipeline).
## Migrate from a Partner Dashboard-managed app
If you've been using the Partner Dashboard to manage your app, then you should consider importing it and [using Shopify CLI to manage it instead](/docs/apps/build/cli-for-apps/migrate-from-dashboard).
## Migrate to Shopify CLI 3.x
To offer a better and more integrated development experience, apps created Shopify CLI 3.x follow a conventional directory structure and manage your Node-based dependencies for you.
If you have an app that was created using a previous version of Shopify CLI, or without Shopify CLI, then you can [migrate your app so you can use the newest version of Shopify CLI](/docs/apps/build/cli-for-apps/migrate-to-latest-cli).
## Usage reporting
Anonymous usage statistics are collected by default. To opt out, you can use the environment variable `SHOPIFY_CLI_NO_ANALYTICS=1`.
## Switch to a global executable or local dependency
Shopify CLI can be globally installed or used as a local dependency when working with Shopify apps. This following sections explains the reasons for using each installation method and the process for switching between them.
### Switch to a global Shopify CLI executable
Global installation is the default recommended approach for using Shopify CLI. Global installation has the advantage of a single install and upgrade point for all your Shopify app, theme, and Hydrogen development.
If you have an existing app which has Shopify CLI as a local dependency in its `package.json`, use the following steps to move to a global install:
1. Use your package manager to delete `@shopify/cli` and (if present) `@shopify/app` from your dependencies:
2. [Install Shopify CLI](/docs/api/shopify-cli) as a global package.
3. Invoke Shopify CLI directly when working in your app. For example:
### Switch an app to a local Shopify CLI dependency
Adding Shopify CLI as a local dependency is useful if you wish to synchronize Shopify CLI versions within a team, or use different Shopify CLI versions across multiple apps in your development environment.
To switch an app to use Shopify CLI as a local dependency:
1. Install the `@shopify/cli` package with one of the following commands.
> Note:
> As of Shopify CLI version `3.59.0`, you no longer need to install the `@shopify/app` package as it is bundled with `@shopify/cli`.
2. Invoke Shopify CLI commands with your package manager. For example:
## Where to get help
- **[Open a GitHub issue](https://github.com/shopify/cli/issues)** - To report bugs or request new features, open an issue in the Shopify CLI repository.
- **[.dev Community](https://community.shopify.dev/)** - Visit our forums to connect with the community and learn more about Shopify CLI development.
## Command reference