CLI
Command-line tools for FormForge development and scaffolding.
Installation
Install the FormForge CLI globally to access scaffolding and development tools:
npm install -g @formforge/cliCommands
Create a new form
formforge create form my-formThis command creates a new form with the specified name and generates all necessary files including the form component, validation schema, and TypeScript types.
Generate form fields
formforge add field email --type email --requiredAdd individual form fields to an existing form with specified validation rules.
Validate form schema
formforge validate schemaValidate your Zod schema files for type safety and consistency.
Configuration
Create a formforge.config.js file in your project root to customize the CLI behavior:
module.exports = {
componentsDir: './src/components/forms',
schemasDir: './src/schemas',
templatesDir: './templates',
defaultTheme: 'tailwind',
typescript: true,
}Templates
The CLI supports custom templates for generating forms. Create your own templates in the templates directory to match your project's conventions.