OpenForm
CLI

Configuration

Last updated on

Configure the OpenForm CLI

The CLI reads settings from two places: a global config for user-wide preferences, and the project manifest for project-specific overrides. This page explains the configuration system, including environment variables, renderer plugins, cache, and proxy support.

Global configuration

The global config lives at ~/.open-form/config.json. It applies to all projects unless overridden.

{
  "$schema": "https://schema.open-form.dev/cli/global-config.json",
  "defaults": {
    "format": "yaml",
    "artifactsDir": "artifacts",
    "registry": "@open-form"
  },
  "registries": {
    "@company": "https://registry.company.com"
  },
  "cache": {
    "ttl": 3600,
    "directory": "~/.open-form/cache"
  },
  "security": {
    "allowedContentTypes": ["application/pdf", "text/markdown"]
  }
}

Fields

FieldTypeDefaultDescription
defaults.formatstring"yaml"Default output format (json, yaml, typed, ts)
defaults.artifactsDirstring"artifacts"Default directory for downloaded artifacts
defaults.registrystring"@open-form"Registry namespace used when none is specified
registriesobjectRegistry configuration by namespace
cache.ttlnumber3600Cache time-to-live in seconds
cache.directorystring"~/.open-form/cache"Cache storage directory
security.allowedContentTypesarrayPermitted content types for layer downloads

Project overrides

The open-form.json manifest can override global settings on a per-project basis. These fields take precedence over the global config:

  • artifacts.format — output format
  • artifacts.dir — artifacts directory
  • registries — registry mappings
  • cache.ttl — cache duration
  • security — security restrictions

See the project manifest reference for full details.

Precedence

When resolving a setting, the CLI checks in this order:

  1. CLI flags (highest priority)
  2. Project config (open-form.json)
  3. Global config (~/.open-form/config.json)
  4. Built-in defaults (lowest priority)

For registries, a project-level namespace mapping always wins over the same namespace in the global config.

Global flags

These flags can be passed to any command:

FlagDescription
--no-telemetryDisable telemetry for this invocation
-h, --helpDisplay help for the command
-v, --versionDisplay the CLI version
ofm --no-telemetry add @open-form/w9

The configure wizard

The ofm configure command walks you through each setting interactively and saves results to the global config:

ofm configure

The wizard covers output format, artifacts directory, cache TTL, and default registry. Press Enter at any prompt to keep the current value.

Environment variables

Registry URLs and headers support ${VAR_NAME} expansion:

{
  "registries": {
    "@private": {
      "url": "${PRIVATE_REGISTRY_URL}",
      "headers": {
        "Authorization": "Bearer ${REGISTRY_TOKEN}"
      }
    }
  }
}

The CLI will error if a referenced environment variable is not set. This works in both the global config and the project manifest.

Renderer plugins

Renderers are not bundled with the CLI to keep the base install small (~1.1 MB). The first time you run render or inspect, the required renderer is automatically installed to ~/.open-form/renderers/.

Three renderers are available:

RendererFormats
@open-form/renderer-textText, Markdown, HTML
@open-form/renderer-pdfPDF
@open-form/renderer-docxDOCX

Manage renderers manually with ofm renderers:

ofm renderers status    # Show installation status
ofm renderers install   # Install all renderers
ofm renderers update    # Update to match CLI version

Cache

Registry data is cached locally at ~/.open-form/cache/ to speed up repeated operations. The default TTL is 1 hour (3600 seconds).

Override the TTL globally in the config:

{
  "cache": {
    "ttl": 7200
  }
}

Or per registry:

{
  "registries": {
    "@acme": {
      "url": "https://registry.acme.com",
      "cache": {
        "ttl": 300
      }
    }
  }
}

Manage the cache with ofm cache:

ofm cache stats         # Show cache statistics
ofm cache clear         # Clear all cached data
ofm cache invalidate @acme  # Invalidate a specific registry

Proxy support

The CLI respects standard proxy environment variables for outbound HTTP requests:

  • HTTPS_PROXY / https_proxy
  • HTTP_PROXY / http_proxy
export HTTPS_PROXY=http://proxy.example.com:8080
ofm search --query "lease"

Telemetry

The CLI collects anonymous usage data (commands run, artifact kinds installed) to help improve the tool. No personal information or artifact content is collected.

Telemetry can be disabled in three ways:

CLI flag (per invocation):

ofm --no-telemetry add @open-form/w9

Global config (persistent):

{
  "telemetry": {
    "enabled": false
  }
}

Environment variables:

VariablePurpose
OFM_TELEMETRY_DISABLED=1Disable telemetry
DO_NOT_TRACK=1Disable telemetry (cross-tool standard)
OFM_TELEMETRY_DEBUG=1Log telemetry events to console

When multiple settings conflict, the CLI checks in this order: CLI flag, environment variables, global config. Any opt-out at any level disables telemetry entirely.

On this page