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
  • create
  • Arguments
  • Examples
  • Environment Variables
  • FRONTITY_CREATE_NAME
  • FRONTITY_CREATE_TYPESCRIPT

Was this helpful?

  1. CLI Commands
  2. Create commands

create

PreviousCreate commandsNextcreate-package

Last updated 3 years ago

Was this helpful?

create

Creates a new Frontity project.

npx frontity create [project-name] [options]

Arguments

[project-name]

The name of your Frontity project. It will also be the name of the folder that this command will create for you with the files of your Frontity project inside.

[options]

Option

Description

The theme to use

--typescript

--use-cwd

Generates the project in the current directory

--no-git

frontity create initializes by default a git repository. This option skips this initialization.

--no-prompt

--help

Output usage information

The --theme option

You can either pick one of the two official Frontity themes ( or ) or use any other custom theme as long as it's . Just pass the theme name on the command-line like --theme ThemesPackageNameInNPM.

Examples

  • Create a Frontity project named my-awesome-project:

npx frontity create my-awesome-project
npx frontity create --theme frontity-chakra-theme cool-project
  • If you leave out both of the arguments, the CLI will run an interactive shell asking for these inputs:

> npx frontity create
...
? Enter a name for the project: awesome project
? Pick a starter theme to clone: @frontity/mars-theme (recommended)
✔ Creating README.md.
✔ Creating package.json.
✔ Creating frontity.settings.js.
✔ Cloning @frontity/mars-theme.
✔ Installing dependencies.
✔ Downloading favicon.ico.

Frontity project created.

? Do you want to receive framework updates by email? No

Ok, that's fine! 😉
You can subscribe at any point with npx frontity subscribe <email>.

Run cd awesome project && npx frontity dev and have fun! 🎉

You can find docs at https://docs.frontity.org/.
For technical support and assistance please join our community at https://community.frontity.org/.

Environment Variables

FRONTITY_CREATE_NAME

If the CLI cannot find a FRONTITY_CREATE_NAME environmental variable, it will prompt for the name of the package.

Example:

FRONTITY_CREATE_NAME=test-project

FRONTITY_CREATE_TYPESCRIPT

Adds support for TypeScript in the project created.

Example:

FRONTITY_CREATE_TYPESCRIPT=true

Adds support for TypeScript. Related environment variable:

Skips prompting the user for options. Related environment variable:

Create a Frontity project named my-awesome-project using :

If you pass the flag to the create command, the CLI will use the name from this FRONTITY_CREATE_NAME environment variable.

You can see a scheme of the whole workflow of using this FRONTITY_CREATE_NAME environment variable in the section.

💻
--theme @frontity/mars-theme
--theme @frontity/twentytwenty-theme
published on npm
Frontity Chakra theme
--theme <theme>
FRONTITY_CREATE_TYPESCRIPT
FRONTITY_CREATE_NAME
--no-prompt
--no-prompt