ConfigurationLast updated on
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
| Field | Type | Default | Description |
|---|---|---|---|
defaults.format | string | "yaml" | Default output format (json, yaml, typed, ts) |
defaults.artifactsDir | string | "artifacts" | Default directory for downloaded artifacts |
defaults.registry | string | "@open-form" | Registry namespace used when none is specified |
registries | object | — | Registry configuration by namespace |
cache.ttl | number | 3600 | Cache time-to-live in seconds |
cache.directory | string | "~/.open-form/cache" | Cache storage directory |
security.allowedContentTypes | array | — | Permitted 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 formatartifacts.dir— artifacts directoryregistries— registry mappingscache.ttl— cache durationsecurity— security restrictions
See the project manifest reference for full details.
Precedence
When resolving a setting, the CLI checks in this order:
- CLI flags (highest priority)
- Project config (
open-form.json) - Global config (
~/.open-form/config.json) - 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:
| Flag | Description |
|---|---|
--no-telemetry | Disable telemetry for this invocation |
-h, --help | Display help for the command |
-v, --version | Display the CLI version |
ofm --no-telemetry add @open-form/w9The configure wizard
The ofm configure command walks you through each setting interactively and saves results to the global config:
ofm configureThe 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:
| Renderer | Formats |
|---|---|
@open-form/renderer-text | Text, Markdown, HTML |
@open-form/renderer-pdf | |
@open-form/renderer-docx | DOCX |
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 versionCache
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 registryProxy support
The CLI respects standard proxy environment variables for outbound HTTP requests:
HTTPS_PROXY/https_proxyHTTP_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/w9Global config (persistent):
{
"telemetry": {
"enabled": false
}
}Environment variables:
| Variable | Purpose |
|---|---|
OFM_TELEMETRY_DISABLED=1 | Disable telemetry |
DO_NOT_TRACK=1 | Disable telemetry (cross-tool standard) |
OFM_TELEMETRY_DEBUG=1 | Log 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.