Skip to content
NeuralRepo
Get Support

nrepo link / unlink / links

Terminal window
nrepo link <source-id> <target-id> [options]
nrepo link --batch # read a JSON array from stdin
nrepo unlink <source-id> <target-id> [options]
nrepo links <id> [options]
FlagTypeDefaultDescription
--type <type>stringrelatedOne of related, blocks, inspires, supersedes, parent.
--note <note>string(none)A note on the relation. Truncated to 500 characters.
--forcebooleanfalseBypass cycle detection — for supersedes only, see below.
--batchbooleanfalseBulk mode: read a JSON array of links from stdin.
--jsonbooleanfalseOutput as JSON.
--humanbooleanForce human-readable output. Wins over --json.
Terminal window
# A plain association
nrepo link 391 402
# A dependency, with a note
nrepo link 391 402 --type blocks --note "Dark mode depends on the theme system"
✓ Linked #391 → #402 (blocks)
Note: Dark mode depends on the theme system

duplicate is not accepted here even though it is a real relation type — only duplicate detection creates those:

Invalid type "duplicate". Must be one of: related, parent, blocks, inspires, supersedes
TypeMeaningDirection
relatedGeneral associationSymmetrical in display
blocksSource blocks progress on the targetDirected
inspiresSource inspired the targetDirected
supersedesSource replaces the targetDirected
parentSource is a child/variant of the targetDirected
duplicateTwo captures of the same ideaCreated only by duplicate detection

Cycles are checked only for the three types where a loop would be meaningless. The check walks existing relations of the same type outward from the target, up to 50 hops.

TypeChecked--force
blocksYes — hardIgnored. The link is refused whatever you pass.
parentYes — hardIgnored. The link is refused whatever you pass.
supersedesYes — softBypasses the check.
related, inspiresNoNot applicable.
This would create a circular blocking chain: #391 → #402 → #391

An existing relation between the same pair in the same direction also fails, with Relation already exists. In --json mode that error is reported with "code": "cycle_detected" even though no cycle was involved — match on the message, not the code.

--batch reads a JSON array from stdin, so you can create many relations in one request:

Terminal window
echo '[
{"source_idea_id": 391, "target_idea_id": 402, "relation_type": "blocks", "note": "theme first"},
{"source_idea_id": 391, "target_idea_id": 417}
]' | nrepo link --batch
✓ Linked #391 → #402 (blocks)
✗ #391 → #417: Target idea 417 not found
1 created, 1 errors
DetailValue
Links per call50 maximum
Fieldssource_idea_id and target_idea_id required; relation_type defaults to related; note optional
AtomicityNone — one result per link, failures do not roll back the rest
CyclesReported as a per-link error, not as a command failure

Empty input, an empty array, or invalid JSON exits 1 with a message before anything is sent.

Terminal window
nrepo unlink 391 402
# ✓ Unlinked #391 ↔ #402

Finds the relation between the two ideas in either direction and deletes it. If there are several between the same pair, it removes the first one it finds — outgoing before incoming. With no relation at all:

No link found between #391 and #402. Run nrepo links 391 to see existing links.
FlagTypeDefaultDescription
--type <type>string(all)Show only this relation type.
--jsonbooleanfalseOutput as JSON.
--humanbooleanForce human-readable output. Wins over --json.
Terminal window
nrepo links 391
Links for #42 "Rewrite auth flow":
Blocks →
#43 Add dark mode and a theme picker [exploring] — theme first
Related ↔
#18 Session cookie cleanup [captured]
Child of ←
#7 Auth overhaul epic [shipped]

Relations are grouped by type and direction, and each type is labelled from the perspective of the idea you asked about — Blocks outgoing versus Blocked by incoming, Parent of versus Child of. related and duplicate are symmetrical, so they are listed once rather than twice.

--json returns { "outgoing": [...], "incoming": [...] }, each entry carrying the relation’s own id, its type, note, score, and the other idea’s idea_id, idea_number, idea_title, and idea_status.