CLICommands
fixLast updated on
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
| Argument | Description |
|---|---|
artifact | Artifact file (JSON/YAML) to fix |
Options
| Option | Description |
|---|---|
-y, --yes | Accept all changes without prompting |
--dry-run | Show 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:
- Detects missing or invalid checksums
- Computes the correct SHA-256 checksums from the referenced files
- Interactively prompts you to approve each change
- 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.yamlAccept all changes automatically:
ofm fix my-form.yaml --yesPreview changes without modifying:
ofm fix my-form.yaml --dry-runOutput
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.yamlWhat it fixes
| Issue | Description |
|---|---|
| Missing layer checksum | Computes and adds SHA-256 checksum for file layers |
| Invalid layer checksum | Recomputes checksum when file contents have changed |
| Malformed layer checksum | Replaces incorrectly formatted checksums |
| Missing content ref checksum | Computes and adds SHA-256 checksum for file-backed instructions or agentInstructions |
| Invalid content ref checksum | Recomputes checksum when content reference files have changed |