This is an experimental command line interface for Formium. Its goal is to streamline development and deployment of sites using frameworks without static build steps / data fetching baked-in (i.e. you are not using Gatsby or Next.js).
npm install --global @formium/cli
On your local machine
When working on your local machine, you'll want to login.
This will prompt you to generate a personal access token for the CLI. You can do this in your Formium account settings: https://dashboard.formium.io/account#tokens.
On CI/CD Services
If you want to use the CLI in a non-interactive shell such as a Continuous Integration / Delivery service (e.g. CircleCI, GitHub Actions, Jenkins, etc.). You should generate an access token and store it as a secure environment variable. You can then pass the token to any command below by appending
XXX will be the name of the environment variable you created.
Login to your Formium account. This requires creating a personal access token to your account (https://dashboard.formium.io/account#tokens).
Log out of your account. This will permanently destroy your access token. You will need to use new one in the future.
Link a folder to a Formium project. This command will create
.formium folder in the directory in which you run it in, generate Formium configuration files there, and add the entire folder to your
.gitignore file. The contents of the
.formium folder may change at anytime going forward.
formium forms pull
Downloads all forms (just their schemas, not submissions) into
.formium directory as JSON. This command is a work-in-progress. In the future, the goal is to couple this with client-side runtime helpers to access the data (kind of like Amplify does) in a way that is friendlier and ideally tree-shakeable.
Usage$ formium <command> [options]Available Commandslogin Login to a Formium accountlink Link a directory to a Formium projectlogout Logout of Formiumforms pull Pull latest forms from a projectFor more info, run any command with the `--help` flag$ formium login --help$ formium link --helpOptions-t, --token Access Token-p, --project Project slug-v, --version Displays current version-h, --help Displays this message