Skip to content
Join our Slack

CLI

@fomr/cli brings the Platform API to your terminal. Use it to keep forms in version control, publish reviewed changes, manage templates, and export submissions. It collects no telemetry and never updates itself.

Use Node.js 26.12.1 or newer:

Terminal window
npm install -g @fomr/cli
fomr --version
fomr --help

You can also run it without installing: npx @fomr/cli --help. --version prints the CLI version, the SDK version, and the Contract Revision it implements.

Create a Personal Access Token under Settings > API (see Authentication), then run:

Terminal window
fomr login
fomr whoami
fomr usage

Paste the token into the hidden prompt. Login checks the token with the API and saves it as a CLI Profile together with its organization. Output only ever shows the Token Hint. The CLI warns when a token expires within seven days.

fomr usage prints the plan, one line per API Limit, and the plan’s form and submission counts:

Plan: free
API 15-minute limit: 47/50 remaining (3 used), resets 2026-10-01T09:12:00.000Z
API 24-hour limit: 63/100 remaining (37 used), resets 2026-10-02T09:00:00.000Z
API 30-day limit: 588/1000 remaining (412 used), resets 2026-10-24T14:30:00.000Z
Forms: 2/3
Monthly submissions: 17/100

In CI, provide FOMR_TOKEN from your secret store instead of logging in. To save a token from a script, pipe it to --token-stdin; without a terminal, plain fomr login exits with code 2:

Terminal window
printf '%s' "$FOMR_TOKEN" | fomr login --token-stdin --profile ci

Avoid --token <value> where you can: the value can end up in shell history and process listings.

A CLI Profile holds one token and the organization it belongs to:

Terminal window
fomr login --profile production
fomr profiles
fomr profiles use production
fomr whoami --profile production

Credential selection uses this order:

  1. An explicit --token.
  2. An explicit --profile.
  3. FOMR_TOKEN.
  4. FOMR_PROFILE.
  5. A stored profile matching the Project Manifest’s organization, for project operations.
  6. The default profile.

If several profiles match a project’s organization, the default profile wins when it is one of them; otherwise pass --profile. When fomr.yaml pins an organization, project commands refuse credentials for any other organization.

Each stored profile is bound to the API origin it logged in to. To use another origin, log in with --base-url under a separate profile; --base-url and FOMR_BASE_URL never send an existing profile’s token elsewhere.

--base-url and FOMR_BASE_URL must use https://. Plain http:// is allowed only for localhost, 127.0.0.1, and [::1], and the CLI stops with exit code 2 for any other origin before sending the token. When the origin is not https://platform.fomr.io, the CLI prints a warning on stderr.

Terminal window
fomr logout --profile production

Logout removes the stored profile. --all removes every profile. --revoke also revokes the token first, which stops every other client using it too.

If revocation fails, for example because of a network error, the profile is still removed and the command exits with that error’s code. Revoke the token under Settings > API to be sure it no longer works. A token from FOMR_TOKEN is never stored; unset the variable to stop using it.

Terminal window
fomr init
fomr lint
fomr push
fomr push --publish

init creates a Project Manifest (fomr.yaml), a sample forms/event-registration.yaml, and a .gitignore entry for .fomr/. Use --dir <path> to choose the directory or --no-sample to skip the sample. It never overwrites an existing manifest or sample.

The first push creates the sample form and writes its new public ID into the file. push --publish then publishes it. A plain push never changes what respondents see. To get the share link, run fomr forms get <id> --json and read urls.share.

The manifest pins the organization when credentials are available:

version: 1
organization: AcmeEvents
paths:
forms: forms
templates: templates

Without credentials, init leaves out organization. Project commands look for fomr.yaml in the current directory and its parents; without one, they use forms/ and templates/ in the current directory.

Replace the example ID with your form’s public ID:

Terminal window
fomr pull Ev3ntReg01
fomr pull Ev3ntReg01 --dry-run
fomr pull Ev3ntReg01 --format json -o forms/event.json

Pull writes the form’s Draft Document to a Definition File: the Canonical Blueprint plus a top-level public_id that ties the file to the form. You can rename or move the file freely; the ID is what links it.

With no IDs, fomr pull refreshes every linked file in the project. fomr pull --all pulls every form in the organization, and --templates adds Private Templates; listing them costs one credit per page.

New files are YAML unless you pass --format json. -o sets the path when pulling one form. Paths must stay inside the project and cannot go through symbolic links.

Pull saves a Sync Record in .fomr/state.json: the draft’s ETag and the file’s hash. It stays local and is not committed.

If nothing changed remotely, pull leaves the file untouched, comments included. If the draft changed, pull rewrites the file and warns that comments are replaced. If you have unpushed local edits, pull stops with exit code 7; add --force to overwrite them.

--dry-run shows the changes without writing anything. Add --exit-code to exit with 9 when there are differences:

Terminal window
fomr pull --dry-run --exit-code

Edit a Definition File, then push it to replace the remote draft:

Terminal window
fomr push forms/event-registration.yaml

With no file arguments, push sends every Definition File in the project. A file with a top-level public_id updates that form; a file without one creates a new form. Keep the ID when you move or rename a file.

Before writing, push:

  1. Lints every file and checks that the credential matches the project’s organization.
  2. Writes new four-character IDs into the file for any page or node that lacks one, so a retry keeps the same IDs. Comments, key order, and your values are preserved. Unknown fields, page types, and node types produce a warning and are sent as-is.
  3. On Free, checks that every API Limit has enough credits left for the planned calls: two credits per existing form (read and write) or one per new form, doubled with --publish for forms. --force skips this local check; the server’s limits still apply. See Rate limits and plans.

For each existing form, push reads the current draft and skips the write when nothing changed. After a write, it adds the new form’s public ID and any missing server defaults to your file, replaces access, is_template, and styles with the server’s values, and updates the Sync Record. Everything else you wrote stays as it is. The summary lists each file, its form, the action taken, and whether it was published. Run pull to get the complete document as the server stores it.

If the draft changed since your last pull or push, in the editor or another client, push stops that form with exit code 7. This is Draft Drift. Check fomr diff, then either pull the remote version or overwrite it with fomr push --force. A fresh clone has no Sync Record, so push warns that it cannot detect drift.

Push reports how many pages and nodes your file removes. Removed items keep their stored answers, and putting an item back with its original ID restores it.

is_template and access are read-only in a draft write, so the CLI warns when your file changes them (and about properties.show_branding when relevant). Use fomr templates mark to make a form a Private Template (it never turns back; start a form from it with fomr templates create-form), and fomr forms access and the lifecycle commands for access. A new form accepts is_template and access.

In styles, theme_id and override_properties are pushed: set theme_id to an ID from fomr themes list to apply a theme, and edit override_properties to change the form’s colors, font, or layout. When you change the theme and leave the overrides as pulled, push sends only the theme, so the color, font, border, and option layout overrides are cleared as in the app. theme_name is read-only, and push refreshes the whole styles block from the server’s answer. The owner and respondent email recipients in settings are pulled and pushed like any other setting. See Settings, properties, access, and styles and Themes.

A file without a public_id creates a new form, and push writes the new IDs back into the file. Commit the file after a successful push. If a push fails, nothing is created and no credits are spent, so fix the cause and push again. If the connection drops before push finishes, run fomr forms list before pushing again, so you do not create a second copy.

In CI, pass --require-ids so any missing form, page, or node ID fails with exit code 2. Create forms locally and commit the files first; otherwise every fresh runner would create a new form.

Terminal window
fomr diff forms/event-registration.yaml --exit-code
fomr push forms/event-registration.yaml --dry-run --exit-code

Both show a unified diff against the current remote draft.

  • diff only reads drafts. It does not validate on the server or run the Free credit check.
  • push --dry-run also sends your document to the server as a dry run, so invalid fields are reported without storing anything.

Neither writes files, IDs, the Sync Record, or forms, but both spend API credits. With --exit-code, they exit with 9 when there are differences; errors keep their own exit codes.

Terminal window
fomr push forms/event-registration.yaml --publish --require-ids

--publish publishes each pushed form that has unpublished changes (has_unpublished_changes: true), including one whose earlier publish failed. Forms that are already published and unchanged are skipped. A Private Template is never published, so push writes its draft and its summary row reads template, never published.

Publish Issues point to the file and field: file:line:column for YAML, a field path for JSON. Fix them and push again. Other forms in the same run continue, and the command exits with the first failure’s code. See Forms for publish rules.

Terminal window
fomr lint
fomr lint forms/event-registration.yaml
fomr lint forms/event-registration.yaml --require-ids --json

Lint checks files locally, with no API calls. It reports parse errors, invalid or duplicate IDs, pages out of order (such as a question page after an ending), invalid layout references, owner email recipients that are not email addresses or exceed the limit, a respondent recipient that does not name an Email block in the file, a malformed styles.theme_id, and CLI settings or credentials placed in a Definition File. Several endings are allowed as long as they come last. With --require-ids, missing IDs fail with exit code 2.

Unknown fields, node types and page types are warnings, not errors, and are kept as-is. Locations are line:column for YAML and field paths for JSON. Tips: quote YAML-sensitive strings, keep integer booleans as the API sends them, and start node sort_order at 1.

Lint does not replace server checks. Use fomr push --dry-run to validate a change on the server, and fomr forms validate <id> to check whether a stored draft can publish.

Replace the example IDs with your own. forms get prints the form as a key and value table, or the API’s JSON with --json. --draft and --published print that document as YAML, or JSON with --json.

Terminal window
fomr forms list --status published --q Event --sort name --order asc
fomr forms list --workspace Wk02
fomr forms get Ev3ntReg01 --json
fomr forms get Ev3ntReg01 --draft
fomr forms get Ev3ntReg01 --published
fomr forms validate Ev3ntReg01
fomr forms publish Ev3ntReg01
fomr forms unpublish Ev3ntReg01
fomr forms close Ev3ntReg01
fomr forms open Ev3ntReg01

publish, unpublish, close, open, and restore accept several IDs. forms publish always publishes; push --publish skips forms without unpublished changes. publish, unpublish, and validate refuse a Private Template with 400 INVALID_INPUT at is_template, as the app never publishes one. reopen is an alias for open. Closing stops new submissions; unpublishing takes the form offline. See the lifecycle for details and permissions.

Schedule access with ISO timestamps, or clear an existing schedule:

Terminal window
fomr forms access Ev3ntReg01 --open-at 2026-12-01T09:00:00.000Z --close-at 2026-12-14T23:59:00.000Z
fomr forms access Ev3ntReg01 --clear-open-at --clear-close-at

Block a second completed response by IP address (ip_address), by browser (submission_id), or by the answer to one question (component with --duplicate-node), or accept every response again:

Terminal window
fomr forms access Ev3ntReg01 --duplicate-rule component --duplicate-node nEml
fomr forms access Ev3ntReg01 --clear-duplicate-rule

Serve the share link on a verified custom domain, or go back to the fomr link:

Terminal window
fomr domains list
fomr forms set-domain Ev3ntReg01 forms.acme.com --slug /register
fomr forms remove-domain Ev3ntReg01

forms create <file> creates a form from a Definition File without an ID. duplicate copies a form into a new draft and, with --pull, saves its file in your project:

Terminal window
fomr forms create forms/new-event-registration.yaml
fomr forms duplicate Ev3ntReg01 --name "Autumn registration" --as-form --pull
fomr forms delete Ev3ntReg01 --yes
fomr forms restore Ev3ntReg01

--as-template makes the copy a Private Template. delete moves the form to Trash for 30 days; it asks for confirmation, and scripts must pass --yes. restore brings a form back as a draft.

Terminal window
fomr workspaces list
fomr workspaces get Wk03
fomr workspaces create "Customer research" --color teal
fomr workspaces rename Wk03 Recruiting
fomr workspaces update Wk03 --icon users --position 0
fomr forms move Ev3ntReg01 --workspace Wk02

workspaces list prints each workspace’s public ID and name, the Default Workspace first. Pass an ID to --workspace on forms list or templates list. Creating a workspace and moving a form need the Pro workspaces feature. update changes only the flags you pass; --clear-icon shows the initial letter again. Deleting a workspace is done in the app only. See Workspaces.

Terminal window
fomr themes list
fomr themes get 6d76842f-9ee0-425a-a8c8-b0628f7a9295

themes list prints each theme’s ID and name, system themes first. Copy an ID into styles.theme_id in a Definition File and push it. See Themes.

Workflows are read and written as whole Workflow Documents in JSON or YAML. Print one, edit it, and send it back:

Terminal window
fomr integrations list
fomr workflows list Ev3ntReg01
fomr workflows create Ev3ntReg01 workflow.yaml --dry-run
fomr workflows create Ev3ntReg01 workflow.yaml
fomr workflows get Ev3ntReg01 Yq3vK8mTn2Lw5Rb7Xc1dFh > workflow.yaml
fomr workflows replace Ev3ntReg01 Yq3vK8mTn2Lw5Rb7Xc1dFh workflow.yaml
fomr workflows enable Ev3ntReg01 Yq3vK8mTn2Lw5Rb7Xc1dFh
fomr workflows disable Ev3ntReg01 Yq3vK8mTn2Lw5Rb7Xc1dFh
fomr workflows delete Ev3ntReg01 Yq3vK8mTn2Lw5Rb7Xc1dFh --yes

integrations list shows the connections a Google Sheets step can name in connection_public_id. create starts the workflow disabled; --dry-run on create and replace validates the document without writing it and prints the result as dry_run: true with the validated document under workflow. get, create, replace, enable, and disable print the Workflow Document as YAML, or JSON with --json. An enabled workflow takes only a rename, so disable it before changing its graph. See Workflows.

Template Definition Files live under templates/ and set is_template: true when created. To turn an existing form into a template, use mark. A template is never turned back into a form; create-form starts a new form from it:

Terminal window
fomr templates list --json
fomr templates mark Ev3ntReg01
fomr templates create-form Onb0ardT01 --name "Event registration" --pull

templates list takes the same filters and pagination flags as forms list. create-form copies a template into a new, unpublished draft; --pull saves its Definition File. See Private Templates for conversion rules.

Terminal window
fomr submissions list Ev3ntReg01 --limit 25 --json
fomr submissions get Ev3ntReg01 Sb01EventReg2026Ab3cDe --json
fomr submissions export Ev3ntReg01 --format csv -o submissions.csv
fomr submissions export Ev3ntReg01 --format jsonl --header public_id > submissions.jsonl

Export streams to -o <path> or stdout and ignores --json. The default format is CSV. --header label (the default) uses question labels as keys; --header public_id uses node IDs, which stay stable when labels change. List and export accept --status, --since, and --until. See Submissions for columns and filters.

List commands return one page by default. Use --limit, --cursor, and --all-pages to page. --all-pages spends one credit per page and warns on Free. With --json, one page prints the API’s { data, next_cursor } body; --all-pages prints all results in one body with next_cursor: null.

Terminal window
fomr schema > form-blueprint.schema.json
fomr schema --component ModelPlatformFormBlueprintInput

The schema comes from the OpenAPI document bundled with the installed SDK, so it needs no API call. An unknown component name exits with code 2.

The CLI stores credentials in its config directory:

EnvironmentDirectory
FOMR_CONFIG_DIR setThe supplied directory.
POSIX$XDG_CONFIG_HOME/fomr, defaulting to ~/.config/fomr.
Windows%APPDATA%\fomr.

credentials.json holds the default profile name and each profile: the token, its public ID and hint, the organization, your role, the expiry, the API base_url, and when it was saved. Keep the file private and out of version control. On POSIX the CLI restricts it to your user (0600, directory 0700); on Windows it relies on your user profile’s permissions.

VariablePurpose
FOMR_TOKENSupply a token without storing it.
FOMR_PROFILESelect a stored profile.
FOMR_BASE_URLSet the API origin for FOMR_TOKEN or fomr login. Stored profiles keep their own origin.
FOMR_CONFIG_DIROverride the config directory.

Without --json, output is for people: one resource prints as a key and value table, and a list prints as a table followed by the next cursor. Use --json whenever a script reads the output.

  • --json prints one JSON object per API result on stdout, so a push of several files or a command with --publish can print several. diff --json prints each file’s before and after.
  • Errors and notices always go to stderr, as JSON Platform Errors with --json. Piped results never contain an error body.
  • --quiet hides progress; --verbose adds request diagnostics with credentials masked. Output never contains color codes.

Error messages include the error code, the request ID, and any permission, plan, validation, or API limit details. A throttled call also prints Limit resets: with the local reset time and how long that is from now, such as (in 12 min) or (in 3 h).

Exit codeMeaning
0Success.
1Unexpected, network, or server failure.
2Invalid arguments or configuration, organization mismatch, or IDs required by --require-ids.
3Missing, invalid, or expired authentication.
4Permission failure.
5Definition, input, publish validation, or payload-size failure.
6Resource not found or inaccessible.
7Conflict, Draft Drift, or unpushed local edits.
8Throttled: the organization’s 15-minute, 24-hour, or 30-day API limit is used up.
9Differences found with diff --exit-code or --dry-run --exit-code.
10Plan restriction: the plan blocks the operation or a plan limit is reached.

For authentication failures, run fomr whoami --profile <name> and replace an expired token with fomr login. For organization mismatches, compare fomr profiles with the manifest’s organization. See Errors for every code. When reporting a failure, include the request ID and never the token.

First create and push the forms locally, then commit fomr.yaml and the Definition Files with all their IDs. Keep .fomr/ ignored. Add a repository secret named FOMR_TOKEN holding a token for the manifest’s organization, created by a member who can edit and publish forms.

This workflow publishes checked-in files when they change on main:

name: Publish forms
on:
push:
branches: [main]
paths:
- fomr.yaml
- forms/**
- templates/**
permissions:
contents: read
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '26.12.1'
- name: Check and publish forms
env:
FOMR_TOKEN: ${{ secrets.FOMR_TOKEN }}
run: npx --yes @fomr/[email protected] push --require-ids --publish

Pin the CLI to a version you have tested; it stays on 0.x until the Platform API reaches general availability. A fresh runner has no Sync Record and cannot detect Draft Drift, so if people also edit these forms in the app, check fomr diff before merging. The workflow leaves out --force, so a failed credit check or validation fails the job.

Let your AI agent build the next form

Connect Claude, ChatGPT or another AI app, or build by hand. Free forever, with unlimited responses.