Shopify CLI commands for Hydrogen storefronts
This reference lists the commands that you can use while developing and building Hydrogen storefronts with the Shopify CLI.
The sections below describe how to perform all Hydrogen-related tasks, such as creating a new Hydrogen storefront, running it locally for development and building it for production deployments.
Commands overview
Anchor link to section titled "Commands overview"Command | Description |
---|---|
init | Creates a new Hydrogen storefront. |
dev | Runs a Hydrogen storefront in a local runtime which emulates an Oxygen worker for development. |
preview | Runs a production build of a Hydrogen storefront for a local preview. |
build | Builds a Hydrogen storefront for production. |
check | Returns diagnostic information about a Hydrogen storefront. |
Creates a new Hydrogen storefront.
Flag | Description |
---|---|
--template TEMPLATE |
TEMPLATE can be either demo-store ,which scaffolds a Hydrogen storefront using the Demo Store template or hello-world , which scaffolds a Hydrogen storefront using the Hello World template. |
--language LANGUAGE |
Sets the template language to use. LANGUAGE be either js for JavaScript or ts for TypeScript. |
--path PATH |
The path to the directory of the new Hydrogen storefront. |
--install-deps |
Auto installs dependencies using the active package manager. |
--no-install-deps |
Skips the prompt for installing dependencies. |
--force |
Overwrites the destination directory and files if they already exist. |
Runs a Hydrogen storefront in a local runtime which emulates an Oxygen worker for development.
Flag | Description |
---|---|
--disable-virtual-routes |
Disables rendering fallback routes when a route file doesn't exist. |
--port PORT |
The Port to run the server on. The default is 3000 . |
--path PATH |
The path to the directory of the Hydrogen storefront. The default is the current directory where the command is run. |
Builds a Hydrogen storefront for production.
Flag | Description |
---|---|
--disable-route-warning |
Disables any warnings about missing standard routes. |
--sourcemap |
Generates sourcemaps for the build. |
--path PATH |
The path to the directory of the Hydrogen storefront. The default is the current directory where the command is run. |
Runs a production build of a Hydrogen storefront for a local preview.
Flag | Description |
---|---|
--port PORT |
The Port to run the server on. The default is 3000 . |
--path PATH |
The path to the directory of the Hydrogen storefront. The default is the current directory where the command is run. |
Returns diagnostic information about the Hydrogen storefront.
Checks that he Hydrogen storefront for missing standard Shopify routes.
Flag | Description |
---|---|
--path PATH |
The path to the directory of the Hydrogen storefront. The default is the current directory where the command is run. |