create

create

Creates a new Frontity project.
1
npx frontity create [project-name] [options]
Copied!

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. Related environment variable: FRONTITY_CREATE_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
Skips prompting the user for options. Related environment variable: FRONTITY_CREATE_NAME​
--help
Output usage information

The --theme option

You can either pick one of the two official Frontity themes (--theme @frontity/mars-theme or --theme @frontity/twentytwenty-theme) or use any other 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:
1
npx frontity create my-awesome-project
Copied!
1
npx frontity create --theme frontity-chakra-theme cool-project
Copied!
  • If you leave out both of the arguments, the CLI will run an interactive shell asking for these inputs:
1
> npx frontity create
2
...
3
? Enter a name for the project: awesome project
4
? Pick a starter theme to clone: @frontity/mars-theme (recommended)
5
βœ” Creating README.md.
6
βœ” Creating package.json.
7
βœ” Creating frontity.settings.js.
8
βœ” Cloning @frontity/mars-theme.
9
βœ” Installing dependencies.
10
βœ” Downloading favicon.ico.
11
​
12
Frontity project created.
13
​
14
? Do you want to receive framework updates by email? No
15
​
16
Ok, that's fine! πŸ˜‰
17
You can subscribe at any point with npx frontity subscribe <email>.
18
​
19
Run cd awesome project && npx frontity dev and have fun! πŸŽ‰
20
​
21
You can find docs at https://docs.frontity.org/.
22
For technical support and assistance please join our community at https://community.frontity.org/.
Copied!

Environment Variables

FRONTITY_CREATE_NAME

If you pass the --no-prompt flag to the create command, the CLI will use the name from this FRONTITY_CREATE_NAME environment variable.
If the CLI cannot find a FRONTITY_CREATE_NAME environmental variable, it will prompt for the name of the package.
Example:
1
FRONTITY_CREATE_NAME=test-project
Copied!
You can see a scheme of the whole workflow of using this FRONTITY_CREATE_NAME environment variable in the --no-prompt section.

FRONTITY_CREATE_TYPESCRIPT

Adds support for TypeScript in the project created.
Example:
1
FRONTITY_CREATE_TYPESCRIPT=true
Copied!
Last modified 7mo ago