Form-Data CLI (fd
)
Using the CLI, you can do the following:
- Scaffold: Quickly create a new project
- Authentication: Login to Form-Data.com and choose a workspace
- 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
Creating a new project
This command is useful if you want to have a project for managing your standalone forms (vs. having is as part of your website of application).
# npm create
npm create @formdata/project@latest my-project
# or, using npx
npx @formdata/create-project my-project
tip
If you want to manage your forms as part of an existing project, don't use this command
What this tool does
When you run this tool, it will:
- Create a new directory for your project
- If you're already logged in to Form-Data in your CLI:
- Display a list of workspaces to choose from
- Allow you to log in with a different account
- If you're not logged in, guide you through the login process
- Create the
form-data.config.json
file with the selected workspace - Create the
forms
folder for your form definitions - Install necessary dependencies
- Provide instructions for next steps
Project Structure
The created project will have the following structure:
my-project/
├── package.json
├── form-data.config.json
└── forms/
The forms
folder will be the home for your .fd
files.
Login
This command will open a browser window for login, which will also let you choose the workspace that you'd want to use from the cli.
fd login
This command gets no parameters. After completing the login, you should see:
form-data.config.json
file will be created in the current directory, if it didn't exist before. Inside, you should see aworkspace
property which will point to the workspace which you have selected.credentials.json
file will be created in your user's home directory. On Mac, this is normally at~/.form-data/credentials.json
, and on Windows it is normally at%USERPROFILE%\.form-data\credentials.json
. Inside, you should find a refresh token and access token for each of the workspaces that you've logged into.