CLI
Learn how to efficiently use Front-Commerce's CLI commands. The guide covers key commands for development, testing, translation, and project management to streamline your Front-Commerce project.
How to use
These commands should be launched from your project's root directory. This can be done by:
pnpm run <command>
Script Reference
dev
Starts the development server using Node.js with tsx (ESM mode) and runs
server.mjs.
dev:debug
Starts the development server in debug mode (--inspect enabled).
build
Builds the project using Remix and Vite with tsx for ESM compatibility.
start
Runs the server in production mode with cross-env ensuring
NODE_ENV=production.
translate
Runs Front-Commerce’s translation tool on all JavaScript/TypeScript files in the
app directory for the English locale. More info
bellow.
front-commerce
A shortcut to execute Front-Commerce CLI commands.
typecheck
Runs TypeScript’s compiler (tsc) to check types without emitting files.
worker
Starts a Front-Commerce worker process. More info bellow.
test
Runs tests with vitest, using tsx for ESM support.
styleguide
Starts Storybook on port 6006 without automatically opening the browser.
buildstyleguide
Builds Storybook into ./build/styleguide, enabling Node.js inspector for
debugging.
Front-commerce CLI
Front-Commerce includes its own CLI. To make it even more convenient, we have
added some of these commands as scripts in package.json(translate,
postinstall and worker). However, the CLI offers more features.
migrate
The migrate command helps you upgrade your project to a new version of
Front-Commerce by running predefined codemods.
Usage
pnpm run front-commerce migrate <glob/path/to/your/project> [options]