detach

Last updated on

Detach a layer or content reference from an artifact

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

Usage

paradoc 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:

paradoc detach my-form.yaml pdf

Detach instructions:

paradoc detach my-form.yaml instructions

Detach agent instructions:

paradoc detach my-form.yaml agent-instructions

Interactive selection (layers + content references):

paradoc detach my-form.yaml

Preview changes without modifying:

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

Skip confirmation:

paradoc 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

An artifact argument may be a file path or an installed @namespace/name reference from .paradoc/lock.json. An uninstalled reference fails with an error.

A layer cannot be detached while defaultLayer names it or another layer names it through bindingsFrom; update those references first. --dry-run previews the change, but still prompts unless combined with --yes.

On this page