API Reference
  • Introduction
  • 💻CLI Commands
    • Create commands
      • create
      • create-package
    • Run commands
      • dev
      • serve
    • Build commands
      • build
    • Extra commands
  • 🍱Packages
    • 💙Core package
      • frontity
    • ⚡Features packages
      • @frontity/wp-source
      • @frontity/tiny-router
      • @frontity/html2react
      • @frontity/head-tags
      • @frontity/yoast
      • @frontity/google-ad-manager
      • @frontity/smart-adserver
      • analytics packages
        • @frontity/google-analytics
        • @frontity/google-tag-manager-analytics
        • @frontity/comscore-analytics
      • @frontity/wp-comments
    • 📚Collections packages
      • @frontity/components
      • @frontity/hooks
        • Infinite Scroll Hooks
        • Intersection Observer Hooks
    • 🎨Themes Packages
      • @frontity/twentytwenty-theme
      • @frontity/mars-theme
  • 🔌WordPress Plugins
    • REST API - Head Tags
    • Frontity Embedded Mode
Powered by GitBook
On this page
  • How to use Frontity CLI
  • Commands
  • Create commands
  • Run commands
  • Build commands
  • Extra commands
  • Arguments & Environment Variables
  • --no-prompt
  • A typical workflow with Frontity commands
  • In development
  • In production

Was this helpful?

CLI Commands

API reference of Frontity CLI commands.

PreviousIntroductionNextCreate commands

Last updated 3 years ago

Was this helpful?

The Frontity command-line tool (CLI) is the main entry point for getting up and running with a Frontity application. It provides functionality like running a development server or building your Frontity application for deployment.

How to use Frontity CLI

The Frontity CLI (Frontity commands) is available via . You can run any Frontity command by doing npx frontity <frontity-command>

Run npx frontity --help for full help.

Commands

The frontity commands you have available are:

These commands allow you to either create a Frontity project or a Frontity package:

These commands allow you to run a Frontity project in development or production mode:

These commands allow you to generate the code that can be used to run or analyze a Frontity project:

You can also use --help with each of these commands to get more information about them: npx frontity dev --help

Arguments & Environment Variables

The Frontity CLI allows parametrization via arguments or environment variables to customize their execution.

If some of these arguments or environment variables are detected the proper values will be set and applied in the execution of the command.

--no-prompt

There's a --no-prompt option that can be used along with environment variables to avoid any questions from the CLI.

Example

If the CLI cannot find any of these environmental variables, it will prompt for the name of the package.

This is the scheme followed by the CLI to get the name of the package:

A typical workflow with Frontity commands

In development

  1. Create a Frontity project: npx frontity create my-cool-project

  2. Add a custom theme (package): npx frontity create-package my-custom-theme

  3. Launch a development server: npx frontity dev

In production

  1. Generate a build of the project: npx frontity build

  2. Launch the project in production using the build generated before: npx frontity serve

Have a look at to learn more about what Frontity does internally when these commands are executed.

If you pass the --no-prompt flag to the or , the CLI will use the name from either or environment variables.

💻
npm
Create commands
create
create-package
Run commands
dev
serve
Build commands
build
Extra commands
this video
create
create-package
FRONTITY_CREATE_NAME
FRONTITY_CREATE_PACKAGE_NAME
subscribe
info