OpenForm
CLI

Registries

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 --global

For registries that require authentication, use the extended format:

{
  "registries": {
    "@private": {
      "url": "https://registry.example.com",
      "headers": {
        "Authorization": "Bearer ${REGISTRY_TOKEN}"
      }
    }
  }
}
FieldDescription
urlRegistry base URL
headersCustom headers (supports ${ENV_VAR} expansion)
allowInsecureAllow HTTP URLs (for local development only)
cache.ttlPer-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-lease

Download layers alongside the definition:

ofm add @acme/residential-lease --layers all

Viewing artifact details

View metadata for an installed artifact:

ofm registry view @acme/residential-lease

Direct URL installs

Install from a URL directly, bypassing namespace resolution:

ofm add https://example.com/artifacts/my-form.yaml

Private 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-form

For 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 list

Remove a registry:

ofm registry remove @acme --global

See 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.pdf

Registry 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

FieldTypeRequiredDescription
$schemastringNoJSON schema URL
namestringYesRegistry namespace (e.g., @acme)
titlestringYesHuman-readable registry name
descriptionstringNoRegistry description
artifactsarrayYesList of artifact entries

Artifact entry fields

FieldTypeRequiredDescription
namestringYesArtifact identifier (slug)
versionstringYesSemantic version
kindstringYesArtifact type: form, checklist, document, bundle
titlestringYesHuman-readable name
descriptionstringNoArtifact description
tagsarrayNoSearchable tags
pathstringYesPath to artifact file (relative to registry root)

Workflow

The CLI provides commands to scaffold and manage a registry:

  1. Create the registryofm registry make generates a registry.json with your namespace and metadata.

  2. Add artifacts to the catalogofm registry catalog manages the artifacts listed in the index.

  3. Compileofm registry compile validates 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 compile

Hosting

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 4567

Then configure the local registry with allowInsecure:

{
  "registries": {
    "@local": {
      "url": "http://localhost:4567",
      "allowInsecure": true
    }
  }
}

Example: GitHub Pages

  1. Create a repository with your registry structure (registry.json + artifacts/)
  2. Enable GitHub Pages in repository settings (serve from the root or docs/ folder)
  3. 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

  1. Version your artifacts — use semantic versioning for all artifacts
  2. Add descriptive tags — help users discover artifacts through search
  3. Include descriptions — add descriptions to the registry, artifacts, and fields
  4. Validate before publishing — run ofm validate on all artifacts before compiling
  5. Use HTTPS — always use HTTPS in production (HTTP only for local development)

On this page