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
--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
booleanDefault value
trueNote
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
booleanDefault value
trueNote
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
booleanDefault value
trueNote
Negation flag: default is true. Passing
--no-gitignore sets this to false.--no-documentDon't offer to create a first document.
Type
booleanDefault value
trueNote
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
booleanDefault value
falseWas this page helpful?