CLI Reference
link

cldpm link / unlink

Link or unlink dependencies between shared components.

cldpm link

Links dependencies to an existing shared component by updating its metadata file.

Usage

cldpm link <DEPENDENCIES> --to <TARGET>

Arguments

ArgumentDescription
DEPENDENCIESOne or more dependencies (type:name, comma-separated)

Options

OptionShortDescriptionRequired
--to-tTarget component (type:name)Yes

Examples

Link single dependency

cldpm link skill:base-utils --to skill:advanced-review

Link multiple dependencies

cldpm link skill:scan,skill:review,rule:security --to agent:auditor

Link cross-type dependencies

cldpm link skill:validator,hook:pre-commit,rule:security --to agent:security-audit

Output

✓ Linked dependencies to agents/security-audit
  ✓ skills/validator
  ✓ hooks/pre-commit
  ✓ rules/security

cldpm unlink

Removes dependencies from an existing shared component by updating its metadata file.

Usage

cldpm unlink <DEPENDENCIES> --from <TARGET>

Arguments

ArgumentDescription
DEPENDENCIESOne or more dependencies (type:name, comma-separated)

Options

OptionShortDescriptionRequired
--from-fTarget component (type:name)Yes

Examples

Unlink single dependency

cldpm unlink skill:base-utils --from skill:advanced-review

Unlink multiple dependencies

cldpm unlink skill:scan,skill:review --from agent:auditor

Output

✓ Unlinked dependencies from agents/auditor
  ✓ skills/scan
  ✓ skills/review

Component Format

Both commands use the type:name format:

TypeSingularPlural
Skillsskill:nameskills:name
Agentsagent:nameagents:name
Hookshook:namehooks:name
Rulesrule:namerules:name

Workflow Example

# Create components
cldpm create skill base-utils -d "Base utilities"
cldpm create skill validator -d "Input validator"
cldpm create agent auditor -d "Audit agent"
 
# Link dependencies to the agent
cldpm link skill:base-utils,skill:validator --to agent:auditor
 
# Verify
cat shared/agents/auditor/agent.json

Output:

{
  "name": "auditor",
  "description": "Audit agent",
  "dependencies": {
    "skills": ["base-utils", "validator"]
  }
}
# Later, remove a dependency
cldpm unlink skill:base-utils --from agent:auditor

What Changes

The link and unlink commands modify the component's metadata JSON file:

Before link:

{
  "name": "auditor",
  "description": "Audit agent"
}

After cldpm link skill:validator,rule:security --to agent:auditor:

{
  "name": "auditor",
  "description": "Audit agent",
  "dependencies": {
    "skills": ["validator"],
    "rules": ["security"]
  }
}
💡

These commands only modify the metadata files. They don't affect projects that already have the component added. Use cldpm sync on projects after modifying component dependencies.