Files
pipelines/internal/author/skill/references/transfer.md
T
alan c42a19f7d3 Improve workflow UI, retain stage diffs, and add portable pipeline transfers
Make OpenCode authoring responsive and expand the managed skill references. Add conflict-aware import/export, real-provider reference workflows, and tracked V2 generation for reliable budget accounting.
2026-10-10 20:55:42 +01:00

3.8 KiB

Select, export and import pipeline definitions

Use CLI_PREFIX as notation for the prompt's exact executable and endpoint prefix. Do not replace it with a bare binary or default server. If installed help lacks these options, report the version/capability mismatch rather than upgrade silently.

Export

  • CLI_PREFIX export --output workflows.zip: interactive multi-selection.
  • CLI_PREFIX export NAME_OR_ID ANOTHER_NAME_OR_ID --output workflows.zip: explicit selection, no picker.
  • CLI_PREFIX export --all --output workflows.zip --json: all latest definitions.
  • CLI_PREFIX export NAME --version N: legacy single Markdown source on stdout.

The TUI :export selects with Space; Ctrl+A toggles the filtered list; Enter saves and Esc cancels. Selections survive filtering. A timestamped ZIP is saved in the client invocation directory and its path logged. Existing archives are never overwritten. A ZIP includes versioned manifest/checksums, names and pinned Markdown definitions. Exported version numbers are provenance, not portable database IDs.

Definition transfer is not full backup or database synchronization. No older versions, run history/diffs, drafts, repository files, provider credentials or ntfy storage/settings are included. Archives are private files, not encrypted; prompts can contain secrets. Limits are 1,000 definitions, 1 MiB each, 32 MiB total source.

Import and existing-name conflicts

CLI_PREFIX import workflows.zip selects definitions then resolves conflicts. TUI :import asks for the client-local ZIP path and follows the same flow. It publishes to the connected destination server; export approval is not import approval, and authoring approval is not publication approval.

Compare exact source bytes with the existing destination definition; different version numbers alone do not imply different content. Whitespace changes do count.

  • Identical definitions are skipped automatically, without a new version/schedule activation.
  • Keep existing (k): skip incoming; retain current destination unchanged.
  • Keep both (b): create NAME (imported) (numbered to avoid occupied/planned names), starting at destination v1.
  • Use imported (i): publish a new destination version under the existing name. All previous versions and runs remain immutable/retained.
  • View diff (d): highlighted, bounded existing-versus-imported source preview.
  • Cancel (c or empty input): abort before selected definitions are published.

Never silently choose either replacement or duplication. All selected sources are server-validated and decisions resolved before final confirmation. Confirmation warns that schedules in accepted definitions activate; preserve explicit consent.

For explicitly authorized automation:

CLI_PREFIX import workflows.zip --all --on-conflict keep --yes --json
CLI_PREFIX import workflows.zip --all --on-conflict both --yes --json
CLI_PREFIX import workflows.zip --all --on-conflict import --yes --json

--all skips selection, --on-conflict resolves differing names, and --yes approves publication. They are distinct decisions. JSON mode without a conflict policy errors before publication on differing names; it never asks interactively. Do not infer a conflict policy from --yes. Do not use --force to repair imports.

New names/copies have server-side create-only guards; updates require the exact version used for comparison. Concurrent changes reject publication. The batch is not atomic: accepted definitions remain if a later request fails. JSON reports imported (all accepted names), updated, and skipped with reasons identical or kept-existing. An ambiguous network error may mean acceptance occurred: inspect the destination before retrying, never roll back/delete accepted versions blindly.