format new
Scaffold a new Format project or document.
Use format new to create a completely fresh new Format project or add new Format documents to existing projects.
If you are looking to add Format to an existing repo with an existing package.json, you should use format init.
Create a project
npx format new project ./my-docspnpm dlx format new project ./my-docsyarn dlx format new project ./my-docsbun x format new project ./my-docsReference
directoryType argumentWhere to create the project. Prompted if omitted.--frameworkType "react" | "vue" | "html"The framework to build your documents with.--no-installType booleanDefault trueDon't install dependencies after creating the project.Negation flag: default is true. Passing --no-install sets this to false.-y, --yesType booleanDefault falseSkip all prompts and use the defaults for every option that isn't provided.Create a document
Run it with a name, or omit the name to be prompted with a random suggestion.
npx format new document invoicepnpm dlx format new document invoiceyarn dlx format new document invoicebun x format new document invoiceYou will be prompted on your initial page size, what styling library you would like to use, whether to use a schema and any dynamic data you want to start with.
The framework (React, Vue or HTML) will be inferred from your config.
All the prompts can be controlled automatically via the flags documented below. For example, the following would preset Tailwind as the styling library, but prompt for the remaining options.
npx format new document invoice --styling tailwindpnpm dlx format new document invoice --styling tailwindyarn dlx format new document invoice --styling tailwindbun x format new document invoice --styling tailwindReference
nameThe document directory name (kebab-case recommended). Omit it to be prompted with a random suggestion.
argument--stylingStyling method for the document. Choices are filtered to your project framework. See the styling docs for more information.
"css" | "css-modules" | "vue-sfc-scoped" | "scss" | "tailwind" | "linaria" | "vanilla-extract" | "panda-css"css--schemaScaffold a data/schema.ts with this validation library, or "none" for no schema. Format validates any Standard Schema compliant library, so you can also wire up others by hand.
"none" | "zod" | "valibot" | "joi" | "yup"none--dataPath to a JSON file to seed the default data variant. Its shape is used to infer the schema and the entry's data type.
string--sizePage size for the document. A4 is the default; pass "custom" with --width and --height for an exact size.
"a3" | "a4" | "a5" | "letter" | "slide-16-9" | "slide-4-3" | "custom"a4--widthCustom page width in CSS pixels. Requires --height; ignored unless --size is "custom" or omitted.
string--heightCustom page height in CSS pixels. Requires --width; ignored unless --size is "custom" or omitted.
string--no-installDon't install missing styling/schema dependencies after creating the document.
booleantrue--no-install sets this to false.-y, --yesSkip all prompts and use the defaults for every option that isn't provided.
booleanfalse--emptyScaffold the most minimal document. Can be combined with other flags.
booleanfalse