0.110.0 • Published 6 months ago

@formdata/cli v0.110.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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

Once 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 login

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

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

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

5. Preview Your Form

You can preview your form during development:

fd preview --name my-contact-form

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

This command deploys all forms to the active environment.

To deploy a specific form:

fd deploy --form-id my-contact-form

Environment Management

Switch Environments

fd use staging
fd use production

Sync Between Environments

fd sync staging production

This copies form configurations from staging to production.

Commands Reference

CommandDescription
fd loginAuthenticate with Form-Data service
fd logoutLog 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 configuration

Preview Command Options

fd preview --name <name>       # Name of the form to preview
fd preview --hide-errors       # Hide errors in the preview UI

Deploy Command Options

fd deploy --env <environment>  # Environment to deploy to
fd deploy --form-id <formId>   # Specific form to deploy

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

0.110.0

6 months ago

0.108.0

6 months ago

0.106.0

6 months ago

0.105.0

7 months ago

0.103.0

7 months ago

0.102.0

7 months ago

0.101.0

7 months ago

0.99.0

7 months ago

0.98.0

7 months ago

0.96.0

7 months ago

0.94.0

7 months ago

0.92.0

7 months ago

0.88.0

7 months ago

0.86.0

7 months ago

0.84.0

7 months ago

0.82.0

7 months ago

0.80.0

7 months ago

0.78.0

7 months ago

0.76.0

7 months ago

0.74.0

8 months ago

0.73.0

8 months ago

0.72.0

8 months ago

0.70.0

8 months ago

0.67.0

8 months ago

0.64.0

8 months ago

0.60.0

8 months ago

0.58.0

8 months ago

0.57.0

8 months ago

0.52.0

8 months ago

0.51.0

8 months ago

0.48.0

8 months ago

0.47.0

8 months ago

0.42.0

8 months ago

0.40.0

8 months ago

0.38.0

8 months ago

0.36.0

8 months ago

0.34.0

8 months ago

0.32.0

8 months ago

0.26.0

8 months ago

0.25.0

8 months ago

0.23.0

8 months ago

0.21.0

8 months ago

0.15.0

8 months ago

0.14.0

8 months ago

0.13.0

8 months ago

0.11.0

8 months ago

0.9.0

8 months ago

0.7.0

8 months ago

0.5.0

8 months ago

0.2.0

8 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago