RegistriesLast updated on
Last updated on
Consuming and creating OpenForm artifact registries
A registry is a hosted collection of OpenForm artifacts. Registries can be public or private. The CLI uses them to discover, install, and manage artifacts in your projects.
Using registries
Adding a registry
Add a registry to your project by editing open-form.json:
{
"registries": {
"@acme": "https://registry.acme.com"
}
}Or add one globally so it's available across all projects:
ofm registry add @acme https://registry.acme.com --globalFor registries that require authentication, use the extended format:
{
"registries": {
"@private": {
"url": "https://registry.example.com",
"headers": {
"Authorization": "Bearer ${REGISTRY_TOKEN}"
}
}
}
}| Field | Description |
|---|---|
url | Registry base URL |
headers | Custom headers (supports ${ENV_VAR} expansion) |
allowInsecure | Allow HTTP URLs (for local development only) |
cache.ttl | Per-registry cache TTL override in seconds |
Searching for artifacts
Use ofm search to query a registry:
ofm search --query "lease"
ofm search --kind form --tags legal
ofm search --registry @acme "tax"The query matches against artifact names, titles, and descriptions. Filter by --kind or --tags to narrow results.
Installing artifacts
Use ofm add to install an artifact. The CLI resolves the namespace to a registry, downloads the definition, writes it to your artifacts directory, and updates the lock file:
ofm add @acme/residential-leaseDownload layers alongside the definition:
ofm add @acme/residential-lease --layers allViewing artifact details
View metadata for an installed artifact:
ofm registry view @acme/residential-leaseDirect URL installs
Install from a URL directly, bypassing namespace resolution:
ofm add https://example.com/artifacts/my-form.yamlPrivate registries
For private registries, configure authentication headers with environment variable tokens:
{
"registries": {
"@private": {
"url": "https://registry.example.com",
"headers": {
"Authorization": "Bearer ${REGISTRY_TOKEN}"
}
}
}
}export REGISTRY_TOKEN="your-token-here"
ofm add @private/internal-formFor local development servers running over HTTP, set allowInsecure:
{
"registries": {
"@local": {
"url": "http://localhost:4567",
"allowInsecure": true
}
}
}Managing registries
List all configured registries (project and global):
ofm registry listRemove a registry:
ofm registry remove @acme --globalSee the registry command reference for all subcommands.
Creating registries
Registry structure
A registry is a directory containing a registry.json index file and individual artifact files:
my-registry/
├── registry.json # Registry index
└── artifacts/
├── residential-lease/
│ ├── artifact.yaml # Artifact definition
│ └── lease.pdf # Layer files
└── w9/
├── artifact.yaml
└── w9.pdfRegistry index
The registry.json file lists all available artifacts:
{
"$schema": "https://schema.open-form.dev/registry.json",
"name": "@acme",
"title": "Acme Forms Registry",
"description": "Official forms and documents for Acme Corp",
"artifacts": [
{
"name": "residential-lease",
"version": "1.0.0",
"kind": "form",
"title": "Residential Lease Agreement",
"description": "Standard residential lease agreement",
"tags": ["legal", "real-estate", "lease"],
"path": "artifacts/residential-lease/artifact.yaml"
}
]
}Index fields
| Field | Type | Required | Description |
|---|---|---|---|
$schema | string | No | JSON schema URL |
name | string | Yes | Registry namespace (e.g., @acme) |
title | string | Yes | Human-readable registry name |
description | string | No | Registry description |
artifacts | array | Yes | List of artifact entries |
Artifact entry fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Artifact identifier (slug) |
version | string | Yes | Semantic version |
kind | string | Yes | Artifact type: form, checklist, document, bundle |
title | string | Yes | Human-readable name |
description | string | No | Artifact description |
tags | array | No | Searchable tags |
path | string | Yes | Path to artifact file (relative to registry root) |
Workflow
The CLI provides commands to scaffold and manage a registry:
-
Create the registry —
ofm registry makegenerates aregistry.jsonwith your namespace and metadata. -
Add artifacts to the catalog —
ofm registry catalogmanages the artifacts listed in the index. -
Compile —
ofm registry compilevalidates all artifacts and prepares the registry for publishing.
ofm registry make --name @acme --title "Acme Forms Registry"
ofm registry catalog add residential-lease ./artifacts/residential-lease/artifact.yaml
ofm registry compileHosting
A registry is just static files served over HTTPS. Any hosting provider or web server works:
- GitHub Pages — free for public repositories
- Netlify / Vercel — deploy from a Git repository
- AWS S3 + CloudFront — scalable, cost-effective
- nginx / Apache — self-hosted
For local development, serve the directory with a static file server:
npx serve my-registry -l 4567Then configure the local registry with allowInsecure:
{
"registries": {
"@local": {
"url": "http://localhost:4567",
"allowInsecure": true
}
}
}Example: GitHub Pages
- Create a repository with your registry structure (
registry.json+artifacts/) - Enable GitHub Pages in repository settings (serve from the root or
docs/folder) - Configure the registry in your project:
{
"registries": {
"@myorg": "https://myorg.github.io/openform-registry"
}
}The CLI fetches https://myorg.github.io/openform-registry/registry.json to discover available artifacts.
Best practices
- Version your artifacts — use semantic versioning for all artifacts
- Add descriptive tags — help users discover artifacts through search
- Include descriptions — add descriptions to the registry, artifacts, and fields
- Validate before publishing — run
ofm validateon all artifacts before compiling - Use HTTPS — always use HTTPS in production (HTTP only for local development)