Skip to main content

Add an Edge

cohaku graph edge add <sourceId> <targetId> <relation>
Creates a directed relationship between two entities.

Arguments

ArgumentRequiredDescription
sourceIdYesSource entity ID
targetIdYesTarget entity ID
relationYesRelationship type (e.g., uses, depends_on, contains, implements)

Options

OptionDefaultDescription
--factAdditional information about this relationship
--valid-atValidity timestamp (ISO 8601)
--scopeprojectScope: project, global

Example

cohaku graph edge add entity1 entity2 "depends_on" --fact "Uses for database access"

Update an Edge

cohaku graph edge update <id>
Updates an edge by invalidating the old one and creating a new version.

Options

OptionDescription
--relationNew relationship type
--factNew additional information

Example

cohaku graph edge update edge123 --relation "extends" --fact "Changed from uses to extends"

Invalidate an Edge

cohaku graph edge invalidate <id>
Marks an edge as no longer valid. The edge is preserved for history but excluded from active queries.

Example

cohaku graph edge invalidate edge123