OpenForm
CLICommands

fix

Last updated on

Auto-fix common artifact issues

Fixes artifact metadata, such as computing and updating file checksums in layers and content references.

Usage

ofm fix <artifact> [options]

Arguments

ArgumentDescription
artifactArtifact file (JSON/YAML) to fix

Options

OptionDescription
-y, --yesAccept all changes without prompting
--dry-runShow what would be changed without modifying the file

Description

The fix command analyzes an artifact's file-backed layers and content references (instructions, agentInstructions) and:

  1. Detects missing or invalid checksums
  2. Computes the correct SHA-256 checksums from the referenced files
  3. Interactively prompts you to approve each change
  4. Updates the artifact file with the approved changes

This is useful after attaching new files to an artifact, when file contents have changed, or after manually adding instructions or agentInstructions content references.

Examples

Fix an artifact interactively:

ofm fix my-form.yaml

Accept all changes automatically:

ofm fix my-form.yaml --yes

Preview changes without modifying:

ofm fix my-form.yaml --dry-run

Output

Changes detected:
  layers.pdf.checksum: (none) → sha256:abc123...
  instructions.checksum: (none) → sha256:def456...

? Select changes to apply:
  ◉ layers.pdf.checksum: (none) → sha256:abc123...
  ◉ instructions.checksum: (none) → sha256:def456...

Will change:
  layers.pdf.checksum: (none) → sha256:abc123...
  instructions.checksum: (none) → sha256:def456...

✓ Fixed artifact written to: my-form.yaml

What it fixes

IssueDescription
Missing layer checksumComputes and adds SHA-256 checksum for file layers
Invalid layer checksumRecomputes checksum when file contents have changed
Malformed layer checksumReplaces incorrectly formatted checksums
Missing content ref checksumComputes and adds SHA-256 checksum for file-backed instructions or agentInstructions
Invalid content ref checksumRecomputes checksum when content reference files have changed

See also

  • validate - Check artifact validity
  • attach - Attach files to artifacts

On this page