Shopify CLI for Hydrogen storefronts
Shopify CLI is a command-line interface tool that helps you build Hydrogen storefronts. You can also use it to automate many common development tasks.
You need to use Node.js to install Shopify CLI and manage its dependencies. However, you can use any technology stack to build your Hydrogen storefront's functionality.
This documentation explains how to use Shopify CLI for Hydrogen storefront development. To learn how to use Shopify CLI for other tasks, refer to the following documentation:
Requirements
Anchor link to section titled "Requirements"Getting started
Anchor link to section titled "Getting started"Shopify CLI is managed as a set of Node.js packages:
If you're building a Hydrogen storefront, then you don't need to install Shopify CLI globally. Instead, these packages should be added as dependencies of your app. Using Shopify CLI this way enables a consistent development experience across environments.
Create a new Hydrogen storefront
Anchor link to section titled "Create a new Hydrogen storefront"Use your preferred package manager to create a new Hydrogen storefront. The Shopify CLI prompts you to enter a name for your project and select a language for your codebase, among other options.
Flag | Description |
---|---|
--path |
Sets the path to the directory of the new Hydrogen storefront. Example: --path hydrogen-storefront . |
--language |
Sets the template language to use. LANGUAGE be either js for JavaScript or ts for TypeScript. Example: --language js |
--install-deps |
Auto installs dependencies using the active package manager. |
--no-install-deps |
Skips the prompt for installing dependencies. |
--mock-shop |
Uses mock.shop as the data source for the storefront. A Shopify account isn't required. |
--styling |
Chooses one of the available styling options. Must be one of tailwind , css-modules , vanilla-extract , postcss , or none . Example: --styling tailwind . |
--markets |
Sets the URL structure to support multiple markets. Must be one of: subfolders , subdomains , domains , or none . Example: --markets subfolders . |
--shortcut |
Creates a global h2 shortcut for Shopify CLI using shell aliases. |
--no-git |
Skips intializing Git and adding initial commits. |
--force |
Overwrites the destination directory and files if they already exist. |
Command reference
Anchor link to section titled "Command reference"Refer to the Shopify CLI storefront command reference to explore the commands available to build Hydrogen storefronts with Shopify CLI.
Contributing to Shopify CLI
Anchor link to section titled "Contributing to Shopify CLI"Shopify CLI is open source. Learn how to contribute to our GitHub repository.
Where to get help
Anchor link to section titled "Where to get help"- Open a GitHub issue - To report bugs or request new features, open an issue in the Shopify CLI repository.
- Shopify Community Forums - Visit our forums to connect with the community and learn more about Shopify CLI development.