@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.
Install and check the version
Section titled “Install and check the version”Use Node.js 26.12.1 or newer:
npm install -g @fomr/clifomr --versionfomr --helpYou can also run it without installing: npx @fomr/cli --help. --version prints the CLI version, the SDK version, and the Contract Revision it implements.
Log in
Section titled “Log in”Create a Personal Access Token under Settings > API (see Authentication), then run:
fomr loginfomr whoamifomr usagePaste 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: freeAPI 15-minute limit: 47/50 remaining (3 used), resets 2026-10-01T09:12:00.000ZAPI 24-hour limit: 63/100 remaining (37 used), resets 2026-10-02T09:00:00.000ZAPI 30-day limit: 588/1000 remaining (412 used), resets 2026-10-24T14:30:00.000ZForms: 2/3Monthly submissions: 17/100In 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:
printf '%s' "$FOMR_TOKEN" | fomr login --token-stdin --profile ciAvoid --token <value> where you can: the value can end up in shell history and process listings.
Select an organization
Section titled “Select an organization”A CLI Profile holds one token and the organization it belongs to:
fomr login --profile productionfomr profilesfomr profiles use productionfomr whoami --profile productionCredential selection uses this order:
- An explicit
--token. - An explicit
--profile. FOMR_TOKEN.FOMR_PROFILE.- A stored profile matching the Project Manifest’s organization, for project operations.
- 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.
Log out
Section titled “Log out”fomr logout --profile productionLogout 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.
Initialize a project
Section titled “Initialize a project”fomr initfomr lintfomr pushfomr push --publishinit 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: 1organization: AcmeEventspaths: forms: forms templates: templatesWithout 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.
Pull a draft
Section titled “Pull a draft”Replace the example ID with your form’s public ID:
fomr pull Ev3ntReg01fomr pull Ev3ntReg01 --dry-runfomr pull Ev3ntReg01 --format json -o forms/event.jsonPull 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.
Protect local edits
Section titled “Protect local edits”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:
fomr pull --dry-run --exit-codePush changes
Section titled “Push changes”Edit a Definition File, then push it to replace the remote draft:
fomr push forms/event-registration.yamlWith 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:
- Lints every file and checks that the credential matches the project’s organization.
- 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.
- 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
--publishfor forms.--forceskips 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.
Drift, removals, and read-only fields
Section titled “Drift, removals, and read-only fields”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.
Create safely and keep IDs
Section titled “Create safely and keep IDs”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.
Preview without writing
Section titled “Preview without writing”fomr diff forms/event-registration.yaml --exit-codefomr push forms/event-registration.yaml --dry-run --exit-codeBoth show a unified diff against the current remote draft.
diffonly reads drafts. It does not validate on the server or run the Free credit check.push --dry-runalso 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.
Publish reviewed changes
Section titled “Publish reviewed changes”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.
Check Definition Files
Section titled “Check Definition Files”fomr lintfomr lint forms/event-registration.yamlfomr lint forms/event-registration.yaml --require-ids --jsonLint 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.
Manage forms
Section titled “Manage forms”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.
fomr forms list --status published --q Event --sort name --order ascfomr forms list --workspace Wk02fomr forms get Ev3ntReg01 --jsonfomr forms get Ev3ntReg01 --draftfomr forms get Ev3ntReg01 --publishedfomr forms validate Ev3ntReg01fomr forms publish Ev3ntReg01fomr forms unpublish Ev3ntReg01fomr forms close Ev3ntReg01fomr forms open Ev3ntReg01publish, 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:
fomr forms access Ev3ntReg01 --open-at 2026-12-01T09:00:00.000Z --close-at 2026-12-14T23:59:00.000Zfomr forms access Ev3ntReg01 --clear-open-at --clear-close-atBlock 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:
fomr forms access Ev3ntReg01 --duplicate-rule component --duplicate-node nEmlfomr forms access Ev3ntReg01 --clear-duplicate-ruleServe the share link on a verified custom domain, or go back to the fomr link:
fomr domains listfomr forms set-domain Ev3ntReg01 forms.acme.com --slug /registerfomr forms remove-domain Ev3ntReg01forms 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:
fomr forms create forms/new-event-registration.yamlfomr forms duplicate Ev3ntReg01 --name "Autumn registration" --as-form --pullfomr forms delete Ev3ntReg01 --yesfomr 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.
Organize workspaces
Section titled “Organize workspaces”fomr workspaces listfomr workspaces get Wk03fomr workspaces create "Customer research" --color tealfomr workspaces rename Wk03 Recruitingfomr workspaces update Wk03 --icon users --position 0fomr forms move Ev3ntReg01 --workspace Wk02workspaces 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.
Apply a theme
Section titled “Apply a theme”fomr themes listfomr themes get 6d76842f-9ee0-425a-a8c8-b0628f7a9295themes 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.
Automate workflows
Section titled “Automate workflows”Workflows are read and written as whole Workflow Documents in JSON or YAML. Print one, edit it, and send it back:
fomr integrations listfomr workflows list Ev3ntReg01fomr workflows create Ev3ntReg01 workflow.yaml --dry-runfomr workflows create Ev3ntReg01 workflow.yamlfomr workflows get Ev3ntReg01 Yq3vK8mTn2Lw5Rb7Xc1dFh > workflow.yamlfomr workflows replace Ev3ntReg01 Yq3vK8mTn2Lw5Rb7Xc1dFh workflow.yamlfomr workflows enable Ev3ntReg01 Yq3vK8mTn2Lw5Rb7Xc1dFhfomr workflows disable Ev3ntReg01 Yq3vK8mTn2Lw5Rb7Xc1dFhfomr workflows delete Ev3ntReg01 Yq3vK8mTn2Lw5Rb7Xc1dFh --yesintegrations 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.
Work with Private Templates
Section titled “Work with Private Templates”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:
fomr templates list --jsonfomr templates mark Ev3ntReg01fomr templates create-form Onb0ardT01 --name "Event registration" --pulltemplates 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.
Read and export submissions
Section titled “Read and export submissions”fomr submissions list Ev3ntReg01 --limit 25 --jsonfomr submissions get Ev3ntReg01 Sb01EventReg2026Ab3cDe --jsonfomr submissions export Ev3ntReg01 --format csv -o submissions.csvfomr submissions export Ev3ntReg01 --format jsonl --header public_id > submissions.jsonlExport 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.
Print a schema
Section titled “Print a schema”fomr schema > form-blueprint.schema.jsonfomr schema --component ModelPlatformFormBlueprintInputThe 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.
Configuration and credentials
Section titled “Configuration and credentials”The CLI stores credentials in its config directory:
| Environment | Directory |
|---|---|
FOMR_CONFIG_DIR set | The supplied directory. |
| POSIX | $XDG_CONFIG_HOME/, defaulting to ~/. |
| 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.
| Variable | Purpose |
|---|---|
FOMR_TOKEN | Supply a token without storing it. |
FOMR_PROFILE | Select a stored profile. |
FOMR_BASE_URL | Set the API origin for FOMR_TOKEN or fomr login. Stored profiles keep their own origin. |
FOMR_CONFIG_DIR | Override the config directory. |
Script with JSON and exit codes
Section titled “Script with JSON and exit codes”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.
--jsonprints one JSON object per API result on stdout, so a push of several files or a command with--publishcan print several.diff --jsonprints each file’sbeforeandafter.- Errors and notices always go to stderr, as JSON Platform Errors with
--json. Piped results never contain an error body. --quiethides progress;--verboseadds 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 code | Meaning |
|---|---|
| 0 | Success. |
| 1 | Unexpected, network, or server failure. |
| 2 | Invalid arguments or configuration, organization mismatch, or IDs required by --require-ids. |
| 3 | Missing, invalid, or expired authentication. |
| 4 | Permission failure. |
| 5 | Definition, input, publish validation, or payload-size failure. |
| 6 | Resource not found or inaccessible. |
| 7 | Conflict, Draft Drift, or unpushed local edits. |
| 8 | Throttled: the organization’s 15-minute, 24-hour, or 30-day API limit is used up. |
| 9 | Differences found with diff --exit-code or --dry-run --exit-code. |
| 10 | Plan 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.
Publish from GitHub Actions
Section titled “Publish from GitHub Actions”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 formson: push: branches: [main] paths: - fomr.yaml - forms/** - templates/**permissions: contents: readjobs: 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 }}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.