OpenForm
CLICommands

detach

Last updated on

Detach a layer or content reference from an artifact

Detach (remove) a layer or content reference from an artifact.

Usage

ofm detach <artifact> [target] [options]

Arguments

ArgumentDescription
artifactArtifact file (JSON/YAML) to detach from
targetLayer name, instructions, or agent-instructions (optional, will prompt if not provided)

Options

OptionDescription
-y, --yesSkip confirmation prompt
--dry-runShow what would be changed without modifying the file

Description

Removes a layer definition or content reference from an artifact file. The target can be a layer name, instructions, or agent-instructions.

If no target is provided, you will be prompted to select from all available layers and content references interactively. In non-interactive mode (-y), the target argument is required.

The artifact file is rewritten in its original format (JSON or YAML) after removal. If the last layer is removed, the layers object is removed from the artifact entirely.

Examples

Detach a specific layer:

ofm detach my-form.yaml pdf

Detach instructions:

ofm detach my-form.yaml instructions

Detach agent instructions:

ofm detach my-form.yaml agent-instructions

Interactive selection (layers + content references):

ofm detach my-form.yaml

Preview changes without modifying:

ofm detach my-form.yaml pdf --dry-run

Skip confirmation:

ofm detach my-form.yaml instructions -y

Output

When detaching a layer:

Layer to remove:
  layers.pdf:
    kind: file
    path: ./lease-template.pdf
    mimeType: application/pdf

Detached layer "pdf" from: my-form.yaml

When detaching a content reference:

Content reference to remove:
  instructions:
    kind: file
    path: ./instructions.md
    mimeType: text/markdown

Detached content reference "instructions" from: my-form.yaml

See also

  • attach - Attach files to artifacts
  • show - Display artifact content

On this page