Private betav0.3.0
DocsSign in
Format developer documentation

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 init
pnpm dlx format init
yarn dlx format init
bun x format init

Reference

--frameworkThe framework to build your documents with — React, Vue or HTML. Detected from your dependencies when omitted.
Type
"react" | "vue" | "html"
--root-dirWhere to install the Format project into. The path you give will be set in your Format config's rootDir.
Type
string
--no-installDon't automatically add or install any Format packages.
Type
boolean
Default value
true
Note
Negation flag: default is true. Passing --no-install sets this to false.
--no-scriptsDon'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
boolean
Default value
true
Note
Negation flag: default is true. Passing --no-scripts sets this to false.
--no-gitignoreDon't append the _generated and .env entries to .gitignore. Existing lines are never touched.
Type
boolean
Default value
true
Note
Negation flag: default is true. Passing --no-gitignore sets this to false.
--no-documentDon't offer to create a first document.
Type
boolean
Default value
true
Note
Negation flag: default is true. Passing --no-document sets this to false.
-y, --yesSkip all prompts and use the defaults for every option that isn't provided.
Type
boolean
Default value
false
Was this page helpful?