Command reference

Local commands for daily memory work.

Install the CLI with brew install gowtham0992/link/link on macOS, or use lnk <command> after a global agent installer run. Link uses lnk because link is already a POSIX/macOS system utility. From a source checkout, use python3 link.py <command> on macOS/Linux or py link.py <command> on Windows.

CLI Tour

Animated Link CLI walkthrough
Status, query, brief, and benchmark are the core terminal loop.

The CLI is independent of the web viewer. Use lnk query, lnk brief, lnk health, and maintenance commands even when lnk serve is not running. Agents that support lazy-loaded instructions can also use the official Link skills instead of MCP setup.

Use lnk try when you want the shortest proof loop: demo creation, readiness, query proof, brief proof, viewer command, and first agent prompts in one command.

Daily Loop

lnk serve
lnk welcome
lnk next
lnk health
lnk ingest-status
lnk remember "User prefers feature branches for Link work." --type preference --scope project --project link --visibility project --review-after 2026-08-01
lnk remember "Temporary launch branch is release/one-off." --type project --project link --expires-at 2026-09-01
lnk share "Prefer local memory"
lnk snapshot ~/link --output link-snapshot
lnk brief "working on Link release" --project link
lnk query "what should I know before changing the MCP tools?" --budget small --project link
lnk validate

Memory Commands

lnk remember

Save a local agent memory. Strong duplicates and likely conflicts are refused unless explicitly allowed.

lnk recall

Search local memories with recall readiness and project-aware filtering.

lnk explain-memory

Show provenance, lifecycle, graph links, review issues, and recall readiness.

lnk update-memory

Merge new text into an existing memory and reset review state.

lnk archive-memory

Reversibly hide a stale or wrong memory from default recall.

lnk forget-memory

Permanently delete a memory after explicit confirmation.

Capture Workflow

Use captures for longer chat notes or session summaries that should be reviewed before becoming durable memory.

lnk capture-session session-notes.md --project link
lnk capture-inbox --project link
lnk accept-capture raw/memory-captures/<capture>.md --index 1
lnk redact-capture raw/memory-captures/<capture>.md
lnk delete-capture raw/memory-captures/<capture>.md --confirm

Maintenance

lnk backup
lnk doctor --fix
lnk health
lnk status --validate
lnk memory-audit
lnk compliance-export --output link-audit.json
lnk team-sync ~/link
lnk snapshot ~/link --output link-snapshot
lnk operations
lnk benchmark "agent memory"
lnk rebuild-index
lnk rebuild-backlinks
lnk validate
lnk verify-mcp

Use lnk backup before broad repair work. Use lnk benchmark when a wiki starts to feel slow. lnk status --validate and lnk benchmark both show persistent-cache reuse so you can tell whether Link is rereading every page or reusing unchanged records.

Use lnk team-sync before sharing Link through Git. It is read-only: it checks Git state, verifies that raw/ is protected, checks whether review or visibility: private memories would make sharing unsafe, and prints paste-safe setup/sync commands without pushing private source material for you.

Use lnk snapshot when you need a static, read-only HTML export for a teammate, maintainer, security reviewer, or demo. It excludes raw/, captures, local operation state, and memory pages by default. With --include-memories, it still excludes visibility: private memories unless --include-private-memories is explicitly passed.

Use lnk connect <agent> when an agent already has Link instructions but still needs MCP wiring. It previews the config before writing.

lnk connect codex ~/link
lnk connect codex ~/link --write
lnk connect kiro ~/link --write
lnk verify-mcp ~/link

From a source checkout, use the synthetic large-wiki smoke when you want local scale evidence without touching your real wiki. The script prints the exact lnk serve command and graph URL for the generated fixture.

python3 scripts/smoke_large_wiki.py --pages 10000

All Commands

lnk --version
lnk version
lnk init [dir]
lnk serve [dir] [--port 3000]
lnk try [dir] [--force] [--serve] [--port 3000]
lnk welcome [dir] [--project slug]
lnk prompts [dir] [--project slug]
lnk next [dir] [--project slug]
lnk health [dir] [--json]
lnk status [--validate]
lnk operations [--limit 20]
lnk backup [--label name] [--include-raw]
lnk compliance-export [dir] [--output audit.json] [--project slug]
lnk team-sync [dir] [--remote git-url]
lnk share <page-or-memory> [dir] [--port 3000]
lnk snapshot [dir] [--output link-snapshot] [--include-memories] [--include-private-memories] [--force]
lnk ingest-status
lnk import-obsidian <vault> [dir] [--dry-run] [--overwrite]
lnk remember "text" [--project slug] [--visibility private|project|team] [--review-after YYYY-MM-DD] [--expires-at YYYY-MM-DD]
lnk propose-memories <file-or-text> [--project slug]
lnk capture-session <file-or-text> [--project slug]
lnk capture-inbox [--project slug]
lnk accept-capture <capture> [--index N] [--visibility private|project|team]
lnk redact-capture <capture>
lnk delete-capture <capture> --confirm
lnk query "task" [--budget small|medium|large] [--project slug]
lnk graph-summary ["topic"] [--limit 40] [--depth 1]
lnk benchmark ["query"] [--budget small|medium|large] [--project slug]
lnk brief "task" [--project slug]
lnk memory-audit [--project slug]
lnk recall "query" [--project slug]
lnk profile [--project slug]
lnk wins [--project slug]
lnk memory-inbox [--project slug]
lnk memory-log [--limit N]
lnk review-memory <name>
lnk explain-memory <name>
lnk update-memory <name> "text" [--project slug]
lnk set-memory-visibility <name> private|project|team
lnk archive-memory <name>
lnk restore-memory <name>
lnk forget-memory <name> --confirm
lnk doctor
lnk doctor --fix
lnk migrate
lnk validate [--strict]
lnk rebuild-index
lnk rebuild-backlinks
lnk verify-mcp [--json]
lnk connect <agent> [dir] [--write] [--config path] [--python python]
lnk backup [--list] [--include-raw]
lnk restore-backup <backup.tar.gz> [--include-raw] --confirm
python3 link.py demo
python3 link.py query-link "task" [dir]

query-link is kept as an internal/backward-compatible alias. Prefer lnk query in user-facing docs.