Status: β CLI Ready - Local Development Available
Emma is a system for creating, deploying, and embedding forms into Hugo websites. The CLI is now fully functional for local development and testing.
- Create forms using the interactive CLI (
emma create) - Deploy forms locally for development and testing
- Embed forms in Hugo sites with a simple shortcode
Quick Start:
# Install and initialize
npm install -g @emma/form-builder
emma init
# Create your first form
emma create contact-form
# Deploy locally for testing
emma deploy contact-form-001
# Preview in browser
emma preview contact-form-001Hugo Integration:
{{< embed-form "contact-form-001" >}}β
CLI Implementation - Fully functional form builder CLI
β
Local Development - Complete local deployment simulation
β
Form Builder - Interactive form creation with 13+ field types
β
Bundle Generation - Self-contained JavaScript bundles
β
Test Coverage - Comprehensive test suite with 50+ tests
β³ Production Deployment - Cloudflare integration pending
emma/
βββ packages/
β βββ form-builder/ β CLI tool for creating forms
β βββ api-worker/ β Cloudflare Worker (handles submissions)
β βββ form-renderer/ β Client-side JS (renders forms)
β βββ hugo-module/ β Hugo shortcode integration
βββ shared/ β Shared TypeScript types
βββ docs/ β All documentation
βββ examples/ β Sample form configs
βββ migrations/ β Database schemas
- Quick Start Guide - Get running in 5 minutes
- Developer Guide - Complete development documentation
- 00-mvp-embeddable-forms.md - Project vision
- 02-technical-architecture.md - Technical architecture
- FOUNDATION-SUMMARY.md - Implementation progress
- Hugo Integration - Embedding forms in Hugo
- Cloudflare Infrastructure - Workers, D1, R2 setup
- Field Types - All 13 supported field types
- API Reference - REST API documentation
- Troubleshooting - Common issues & solutions
# One-time setup
emma init
# Create a form interactively
emma create my-contact-form
# Follow prompts to add fields, validation, themes
# Build the form bundle
emma build my-contact-form-001
# Deploy to local development server
emma deploy my-contact-form-001
# Preview in browser
emma preview my-contact-form-001emma init- Initialize Emma configurationemma create <name>- Create new form interactivelyemma list [--detailed]- List all formsemma build <form-id>- Build form JavaScript bundleemma deploy <form-id>- Deploy to local development serveremma preview <form-id>- Open form in browseremma delete <form-id>- Delete a form
CLI creates form schema (YAML)
β
Build generates JS bundle
β
Deploy starts local server
β
Hugo site embeds form
β
Visitor fills & submits
β
Data logged locally
- Text Inputs: text, email, textarea, number, tel, url
- Selection: select dropdown, radio buttons, checkboxes
- Date/Time: date, time, datetime-local
- Special: hidden fields for tracking
- β Interactive form creation with validation
- β 13+ field types with options and validation rules
- β Theme system (default, minimal)
- β Honeypot spam protection
- β Local development server
- β Form preview and testing
- β Hugo shortcode integration ready
For efficient development with automatic rebuilding:
# Watch core packages (form-builder, form-renderer, shared, provider-cloudflare)
yarn dev:core
# Watch API worker (Cloudflare Worker)
yarn dev:api
# Watch website (Hugo site)
yarn dev:website# Install and build CLI
cd packages/form-builder
yarn install && yarn build
# Run tests
yarn test
# Install globally for development
npm link
# Work on other packages
cd ../form-renderer && yarn dev
cd ../api-worker && yarn dev
cd ../shared && yarn devReal working example with the CLI:
# 1. Initialize (one-time setup)
$ emma init
β Emma CLI initialized successfully!
# 2. Create a form interactively
$ emma create contact-form
? Form display name: Contact Form
? Select a theme: default
? Submit button text: Send Message
π Adding form fields...
? Add field 1: Text Input > Your Name (required)
? Add field 2: Email > Email Address (required)
? Add field 3: Textarea > Message (required)
? Add field 4: β
Done adding fields
? Enable spam protection (honeypot)? Yes
β Form created: contact-form-001
# 3. Build and deploy locally
$ emma build contact-form-001
β Form bundle built successfully
$ emma deploy contact-form-001
β Form deployed successfully
Form URL: http://localhost:3333/forms/contact-form-001
API Endpoint: http://localhost:3333/api/submit/contact-form-001
# 4. Preview and test
$ emma preview contact-form-001
π Opening in browser...
# 4. Preview and test in browser
$ emma preview contact-form-001
π Opening in browser...
# 5. Use in Hugo
{{< embed-form "contact-form-001" >}}# Install dependencies
yarn install
# Build all packages
yarn build
# Run tests
yarn test
# Lint code
yarn lint
# Format code
yarn format
# Type check
yarn typecheck- form-builder depends on:
shared/types,shared/schema - api-worker depends on:
shared/types - form-renderer depends on:
shared/types - hugo-module - No dependencies (plain Hugo templates)
- Check the docs in
/docs - Look at example forms in
/examples - Read package READMEs
- Review the technical architecture
- Read MVP document (00-mvp-embeddable-forms.md)
- Understand the architecture (02-technical-architecture.md)
- Review the package you'll work on
- Understand the data flow
- Know where to update docs if needed
- Simple - Easy for Hugo users to integrate
- Fast - Small bundle sizes, edge deployment
- Secure - Spam protection, rate limiting, validation
- Flexible - Themeable, customizable
- Reliable - Edge computing, global availability