format init
Set up Format in an existing project.
Bootstraps Format into an existing repo. The init script will create a format.config.json, add npm scripts, update your .gitignore, and install the relevant Format packages for your chosen framework. Each step asks before touching anything. Finally, it offers to create your first document, so you can dive straight in.
If you are starting with a completely blank slate with no existing files or dependencies, you should use format new project instead.
If you'd rather set everything up manually, follow the manual setup instead.
npx format initpnpm dlx format inityarn dlx format initbun x format initReference
| Name | Description |
|---|---|
| The framework to build your documents with — React, Vue or HTML. Detected from your dependencies when omitted. | |
Where to install the Format project into. The path you give will be set in your Format config's rootDir. | |
| Don't automatically add or install any Format packages. | |
Don't add the npm dev and npm compile scripts to your package.json. Existing dev and compile script names are never overwritten regardless, If there's a name clash, they get a format: prefix. | |
Don't append the _generated and .env entries to .gitignore. Existing lines are never touched. | |
| Don't offer to create a first document. | |
| Skip all prompts and use the defaults for every option that isn't provided. |
Details
--framework <framework>
Description
The framework to build your documents with — React, Vue or HTML. Detected from your dependencies when omitted.
Type
"react" | "vue" | "html"--root-dir <dir>
Description
Where to install the Format project into. The path you give will be set in your Format config's
rootDir.Type
string--no-install
Description
Don't automatically add or install any Format packages.
Type
booleanDefault value
trueNote
Negation flag: default is true. Passing
--no-install sets this to false.--no-scripts
Description
Don't add the npm dev and npm compile scripts to your package.json. Existing dev and compile script names are never overwritten regardless, If there's a name clash, they get a
format: prefix.Type
booleanDefault value
trueNote
Negation flag: default is true. Passing
--no-scripts sets this to false.--no-gitignore
Description
Don't append the
_generated and .env entries to .gitignore. Existing lines are never touched.Type
booleanDefault value
trueNote
Negation flag: default is true. Passing
--no-gitignore sets this to false.--no-document
Description
Don't offer to create a first document.
Type
booleanDefault value
trueNote
Negation flag: default is true. Passing
--no-document sets this to false.-y, --yes
Description
Skip all prompts and use the defaults for every option that isn't provided.
Type
booleanDefault value
falseWas this page helpful?