FastStore CLI
The FastStore Command Line Interface (CLI) provides pre-configured scripts for starting, building, and developing FastStore projects. It also helps keep FastStore projects up to date with the
@faststore/core package.Before you begin
To ensure the FastStore CLI commands related to the Headless CMS run correctly, make sure to install the Headless CMS, its dependencies and plugins as described in the FastStore requirements.
Running FastStore CLI on the project
The CLI is automatically added as a dependency in your project's
package.json file, so once you run yarn install during the project setup, you can start using it in the project.Installing FastStore CLI globally
To use FastStore CLI commands globally on your machine, install the
@faststore/cli package:yarn
npm
_10yarn global add @faststore/cli
Default commands
Below is a brief description of the default commands available in the FastStore CLI. To view detailed information about each command, click the respective command name.
Running commands viayarnis sufficient for developing your store. However, to set up your project with the Headless CMS and create new sections, you must install the FastStore CLI globally and use its commands.
| Command name | Description |
|---|---|
build | Generates a production-ready storefront. It compiles the project and optimizes it for production usage. |
cms-sync | Syncs the cms folder of your FastStore project with the Headless CMS. |
dev | Starts the project in the development environment and uses http://localhost:3000 as the default server. It allows you to make changes to the project and see the results locally in real time without affecting the production environment. |
generate | Optimizes the schema and regenerates TypeScript types so that recent changes take effect without restarting the development server. |
help | Displays help for FastStore CLI commands. |
start | Executes the FastStore project in the root directory and uses http://localhost:3000 as the default server. |
dev
Starts the project in the development environment and uses
http://localhost:3000 as the default server. This allows you to make changes to the project and see the results locally in real time without affecting the production environment.Usage
_10 yarn dev
_10 faststore dev
🔼 Back
build
Generates a production-ready storefront. It compiles the project and optimizes it for production usage.
Usage
_10 yarn build
_10 faststore build
🔼 Back
start
Executes the FastStore project in the root directory and uses
http://localhost:3000 as the default server.Usage
_10 yarn start
_10 faststore start
🔼 Back
cms-sync
Syncs the
cms folder of your FastStore project with the Headless CMS.Usage
_10 yarn cms-sync
_10 faststore cms-sync
🔼 Back
help
Displays help for FastStore CLI commands.
Usage
_10 yarn faststore help
_10 faststore help [COMMAND] [-n]
🔼 Back