@formdata/cli v0.110.0
@formdata/cli
A command-line interface for Form-Data management. This tool helps you create, manage, and deploy form configurations for use with the Form-Data service.
Installation
# Install globally
npm install -g @formdata/cli
# Alternatively, install locally in your project
npm install @formdata/cliOnce installed globally, you can use the fd command to manage your forms.
Features
- 🔐 Authentication: Easy login to Form-Data service
- 🚀 Form Management: Create, deploy, and manage form definitions
- 🌐 Environment Support: Switch between different environments (development, staging, production)
- 🔄 Synchronization: Sync form configurations between environments
- 👀 Live Preview: Preview your forms locally before deployment
Quick Start
1. Authentication
Before using Form-Data CLI, you need to authenticate:
fd loginThis will open a browser window allowing you to authenticate with the Form-Data service.
2. Initialize Your Project
Set up your project with Form-Data configuration:
fd initThis creates a form-data.config.json file in your project root to store configuration settings.
3. Create a Form
Create a new form from a template:
fd form create --name my-contact-formThis will create a new form descriptor file in the forms/ directory.
4. Edit Your Form
Form descriptor files use a simple text-based format with the .fd extension. Here's a basic example:
type form
name Contact form
action https://api.form-data.com/f/xxx
message Thank you for contacting us. We'll get back to you soon
design
background #f5f5f5
theme light
type h1
text Contact us
type text
name full_name
label Full Name
placeholder John Doe
validations required|length:1,50
type email
name email
label Email Address
placeholder john@example.com
validations required|email
type submit
label Send Message5. Preview Your Form
You can preview your form during development:
fd preview --name my-contact-formThis starts a live preview server that automatically refreshes when you edit your form file.
6. Deploy Your Form
When you're ready to deploy:
fd deployThis command deploys all forms to the active environment.
To deploy a specific form:
fd deploy --form-id my-contact-formEnvironment Management
Switch Environments
fd use staging
fd use productionSync Between Environments
fd sync staging productionThis copies form configurations from staging to production.
Commands Reference
| Command | Description |
|---|---|
fd login | Authenticate with Form-Data service |
fd logout | Log out from Form-Data service |
fd init [--env <environment>] | Initialize Form-Data configuration |
fd form [options] | Manage forms |
fd preview [options] | Start a live preview server |
fd deploy [options] | Deploy form configurations |
fd use <environment> | Switch to a different environment |
fd sync <source-env> <target-env> | Sync forms between environments |
Form Command Options
fd form create --template <template> --name <name> # Create a new form from template, and give it a name
fd form add --path <path> # Add existing form file to configurationPreview Command Options
fd preview --name <name> # Name of the form to preview
fd preview --hide-errors # Hide errors in the preview UIDeploy Command Options
fd deploy --env <environment> # Environment to deploy to
fd deploy --form-id <formId> # Specific form to deployContributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago