Create commands

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

Have a look at the environment variables page to check which ones can be used with these commands

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

--theme <theme>

The theme to use

--typescript

Adds support for TypeScript

--use-cwd

Generates the project in the current directory

โ€‹--no-promptโ€‹

Skips prompting the user for options. Related environment variable: FRONTITY_NAME.

--help

Output usage information

The --theme option

You can pick one of Frontity's "official" two themes (--theme @frontity/mars-theme or --theme @frontity/twentytwenty-theme). But you can also use any custom theme as long as it's published on npm. 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/.

create-package

The create-package command creates a new Frontity package in a project. Launch this command from the root of the Frontity project

npx frontity create-package [package-name] [options]

Arguments

[package-name]

This argument sets the name of your Frontity package. The create-package command will create a folder named [package-name] under packages. It will also add the proper dependency in the package.json of your Frontity project

[options]

Option

Description

--namespace <value>

Sets the namespace for this package

โ€‹--no-promptโ€‹

Skips prompting the user for options. Related environment variable: FRONTITY_NAME.

--open

Output usage information

Examples

  • Create a custom theme package named my-custom-project

> npx frontity create-package my-custom-theme
? Enter the namespace of the package: theme
โœ” Adding package.json.
โœ” Adding src/index.js.
โœ” Installing package my-custom-theme.
โ€‹
New package "my-custom-theme" created.