Skip to content

forgeplan unlink

Remove a typed relation between two artifacts. The inverse of forgeplan link. Use unlink to fix mistakes — wrong direction, wrong relation type, stale edge left over from a superseded decision — without rewriting markdown by hand.

forgeplan unlink [OPTIONS] <SOURCE> <TARGET>
<SOURCE> Source artifact ID
<TARGET> Target artifact ID
--relation <RELATION> Relationship type to remove [default: informs]
-h, --help Print help
-V, --version Print version
  1. Looks up the relation in the LanceDB links table keyed on (source, target, relation).
  2. Deletes the row if found.
  3. Refreshes any derived caches — score, graph, and blocked will reflect the change on next run.
  4. Exits cleanly even if no matching relation exists, making the command idempotent and safe to script.

Unlinking does not delete either artifact. It only removes the edge.

Fix a wrong-direction link:

Terminal window
forgeplan unlink PRD-001 EVID-001 --relation informs
forgeplan link EVID-001 PRD-001 --relation informs

Remove a stale based_on after superseding the parent:

Terminal window
forgeplan unlink RFC-006 PRD-025 --relation based_on
forgeplan link RFC-006 PRD-030 --relation based_on

Drop a contradicts edge that was recorded in error:

Terminal window
forgeplan unlink EVID-017 ADR-004 --relation contradicts

The --relation flag must match the type of the edge you want to remove. If you linked EVID-001 → PRD-001 with --relation informs, calling forgeplan unlink EVID-001 PRD-001 --relation based_on will be a no-op because no such edge exists.

When in doubt, inspect the graph first:

Terminal window
forgeplan graph PRD-001 # see all edges touching PRD-001
forgeplan show PRD-001 --links # list links in tabular form

Since self-links cannot be created (see forgeplan link), forgeplan unlink PRD-001 PRD-001 will never find a match and exits as a no-op.

  • Unlink is idempotent — running it twice has the same effect as running it once. No error on a missing edge.
  • To remove an artifact entirely (including all its links), use forgeplan delete — it cascade-deletes relations in a single pass.
  • Direct edits to .forgeplan/<kind>s/<id>.md never touch the links table. If you need to hand-edit relations, run forgeplan scan-import afterward.