Documentation

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/cli

Commands

Create a new form

formforge create form my-form

This 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 --required

Add individual form fields to an existing form with specified validation rules.

Validate form schema

formforge validate schema

Validate 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.