OpenForm
CLICommands

add

Last updated on

Add an artifact from a registry

Adds an artifact from a registry into your project.

Usage

ofm add <artifact> [options]

Arguments

ArgumentDescription
artifactArtifact reference (@namespace/name), namespace (@namespace), or direct URL

Options

OptionDescription
--layers <layers>Layers to download (comma-separated, or "all")
--output <format>Output format: json, yaml (default), typed (json + .d.ts), or ts (TypeScript module)
--header <header...>HTTP header for direct URL auth (format: "Name: Value")
--cache-ttl <seconds>Cache TTL in seconds (0 = no cache, default: use config)
--no-cacheSkip cache and fetch fresh

Description

The add command fetches an artifact from a configured registry and saves it to your project's artifacts directory. The artifact is validated before being saved, and a lock file entry is created to track the installation.

By default, only the artifact definition is downloaded. Use --layers to also download associated files like PDFs or templates.

Content reference files (instructions, agentInstructions) that use kind: "file" are downloaded automatically — no --layers flag needed. These are typically small text files essential for the artifact to function correctly. A checksum is required for security; files without a checksum are skipped with a warning.

When called with just a namespace (@namespace), the command enters browse mode and lets you interactively select artifacts to install.

Examples

Add an artifact:

ofm add @acme/residential-lease

Add with all layers:

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

Add specific layers:

ofm add @acme/residential-lease --layers pdf,markdown

Add with a specific output format:

ofm add @acme/residential-lease --output json

Add as a TypeScript module:

ofm add @acme/residential-lease --output ts

Browse all artifacts in a namespace:

ofm add @acme

Add from a direct URL:

ofm add https://registry.example.com/r/my-form.json

Add from a URL with authentication:

ofm add https://registry.example.com/r/my-form.json --header "Authorization: Bearer token123"

Output

✓ Registry: https://registry.acme.com
✓ Found residential-lease v1.0.0
✓ Written: artifacts/@acme/residential-lease.yaml
✓ Downloaded: artifacts/@acme/instructions.md

✓ Added @acme/residential-lease v1.0.0

Format: yaml
  → artifacts/@acme/residential-lease.yaml
Layers: pdf, markdown
Content:
  → artifacts/@acme/instructions.md

See also

  • search - Find artifacts in registries
  • list - List installed artifacts
  • show - View artifact details

On this page