Documentation
Feedback
Guides
Storefront Development

Storefront Development
FastStoreGetting Started
3. 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 by following these steps:
  1. Open your terminal and run the following command to install yarn globally in your machine:

_10
npm install --global yarn

  1. install the @faststore/cli by running the following command in the terminal:

_10
yarn 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 its respective command name.
Running the commands through yarn is already enough to develop part of your store. However, to set up your project with Headless CMS and create new sections, you need to install the FastStore CLI and use its commands.
Command nameDescription
buildGenerates a production-ready storefront. It compiles the project and optimizes it for production usage.
cms-syncSyncs the cms folder of your FastStore project with Headless CMS.
devStarts the project in the development environment and uses http://localhost:3000 as server by default. It allows you to change the project and see the results locally on your machine in real-time without affecting the production environment.
helpDisplays help for FastStore CLI commands.
startExecutes the FastStore project in the root directory and uses http://localhost:3000 as server by default.

dev

Starts the project in the development environment and uses http://localhost:3000 as server by default. This allows you to change the project and see the results locally on your machine 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 server by default.

Usage


_10
yarn start


_10
faststore start

🔼 Back

cms-sync

Syncs the cms folder of your FastStore project with Headless CMS.

Usage


_10
yarn faststore 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
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page