OpenForm
CLICommands

data

Last updated on

Data operations for artifacts

Data operations for OpenForm artifacts.

Usage

ofm data <command> [options]

Subcommands

CommandDescription
templateGenerate an instance template from a form
fillInteractively fill form data
validateValidate data against a form schema

data template

Generate an instance template from a form artifact.

ofm data template <file> [options]

Arguments

ArgumentDescription
fileForm artifact file (JSON/YAML)

Options

OptionDescription
--out <file>Output file path (format detected from extension)
--jsonForce JSON output format
--yamlForce YAML output format
--silentSuppress console output

Examples

Generate template to stdout:

ofm data template my-form.yaml

Generate template to file:

ofm data template my-form.yaml --out data.yaml

Output

fields:
  address: null
  monthlyRent: null
  startDate: null
  endDate: null

data fill

Interactively fill form data and save to an output file.

ofm data fill <file> --out <file>

Arguments

ArgumentDescription
fileForm artifact file (JSON/YAML)

Options

OptionDescription
--out <file>Output file path (required)
--jsonForce JSON output format
--yamlForce YAML output format

Description

The fill command walks you through each field in the form with interactive prompts. Field types are validated, and complex types (like addresses or money) can be entered as JSON.

Example

ofm data fill my-form.yaml --out filled-data.yaml

Interactive session:

Fill Form: Residential Lease Agreement

? Address: 123 Main St
? Monthly Rent (Enter as JSON): {"amount": 1500, "currency": "USD"}
? Start Date: 2025-02-01
? End Date: 2026-01-31

✓ Form data saved
  Output: filled-data.yaml
  Format: YAML

data validate

Validate data against a form's schema.

ofm data validate <form> <data>

Arguments

ArgumentDescription
formForm artifact file
dataData file to validate

See also

  • new - Create new form artifacts
  • render - Render forms with data

On this page