@cairnkeep/cli

中文文档
2.28.0发布于 2026/10/31Apache-2.0ES Module构建来源已验证近 30 天下载 1896

A durable, harness-agnostic memory + context layer for coding agents and MCP clients.

原始使用文档
文档目录7 节
  1. Why Cairnkeep?
  2. Quick start
  3. For coding agents
  4. Trust boundary
  5. Documentation
  6. Contributing and support
  7. License

Cairnkeep

CI npm license

Durable, local-first memory and context for coding agents.

Cairnkeep helps coding agents carry project context across sessions and harnesses. It stores decisions, constraints, patterns, and lessons in project-scoped memory, then gives agents a bounded protocol for finding and verifying that context without turning memory into an authority or an autonomous agent runtime.

Why Cairnkeep?

  • Continuity across sessions. Recall project decisions and recurring failures instead of rediscovering them from scratch.
  • Harness independence. Use the same memory through Claude Code, OpenCode, Codex CLI, Kimi Code, Qwen Code, Pi, or another MCP client.
  • Local by default. The default stdio server stores data on your computer; remote access, embeddings, capture, and external context are explicit opt-ins.
  • Bounded agent guidance. Managed AGENTS.md instructions and project playbooks tell compatible agents when to retrieve context and which checks apply, but never execute work or grant approval.
  • Least authority. Complete MCP annotations, read-only/custom tool profiles, capability gates, and immutable context packs keep observation separate from action.

Quick start

Cairnkeep requires Node.js 22 or newer. In an interactive terminal, guided setup presents selectable Git and memory choices plus checkboxes for every supported coding harness:

npm install --global @cairnkeep/cli
cairn setup /path/to/project
cd /path/to/project
cairn doctor
./.ai/start-codex.sh                 # Windows: .\.ai\start-codex.cmd

Select Codex CLI in the harness checklist for this route. Review .codex/config.toml and accept Codex's project-trust prompt on first use. Automation can supply every choice explicitly; the quickstart documents that deterministic form.

See the quickstart for Claude Code, the first remember/recall cycle, recovery, and setup ownership. See harness compatibility for the exact surface supported by each client.

The core loop is intentionally small: store a concise, verified project fact, close the session, and retrieve it when a later task needs it. Claude Code and OpenCode expose /remember and /recall; any compatible MCP client can use memory_write and memory_search directly.

For coding agents

Setup installs a managed project instruction block with a deliberately small protocol:

  1. For a nontrivial task that may depend on prior project knowledge, make one task-derived, project-scoped memory_search the first tool or command.
  2. Treat results as locators, not truth; verify the maintained repository sources they reference.
  3. Continue with normal repository inspection if memory is unavailable or has no relevant result.
  4. Never write, supersede, or approve durable memory unless the user or a reviewed workflow explicitly requests it.

Cairnkeep playbooks can recommend or require existing review, verification, security, documentation, and learning steps. They do not run those steps, activate skills, enable capabilities, or authorize destructive work.

Read Cairnkeep for coding agents for the full contract, authority model, harness behavior, and graceful fallback.

Trust boundary

Cairnkeep is not a hosted agent, telemetry service, or automatic remote knowledge collector. Memory is durable context, not source-of-truth documentation. Configured Claude Code and OpenCode hooks can derive local memory candidates; durable promotion and every networked or sensitive capture path remain separately controlled. Ordinary uninstall retains durable data unless an explicit purge is requested.

Start with Privacy and data flow, Memory storage and deployment, and Security assurance and threat model before enabling remote HTTP, embeddings, trajectories, artifacts, work evidence, or context packs.

Documentation

The documentation hub is the index for setup, agents, operations, optional features, deployment, learning paths, and contributor guides. In particular:

The repository supports Linux, macOS, native Windows x64, WSL, Node.js 22/24/26, and real Bash 3.2 within the boundaries documented in the compatibility guides.

Contributing and support

See CONTRIBUTING.md for development and pull-request guidelines, SUPPORT.md for help, and SECURITY.md for private vulnerability reporting.

License

Apache-2.0 © 2026 Stefano Tondo

版本与发布记录

@cairnkeep/cli 共发布 58 个版本,首次发布于 2026/07/14;过去 12 个月发布了 58 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.28.0latest2026/10/319 天前
2.28.0-rc.1next2026/10/3110 天前
2.27.02026/10/2614 天前
2.26.02026/10/2614 天前
2.25.02026/10/2515 天前
2.24.02026/10/2516 天前

关于 @cairnkeep/cli 的常见问题

@cairnkeep/cli 是什么?

A durable, harness-agnostic memory + context layer for coding agents and MCP clients.

如何安装 @cairnkeep/cli?

在项目目录运行 npm install @cairnkeep/cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 cairn、cairn-container,可以用 npx cairn 直接运行。

@cairnkeep/cli 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/cairnkeep__cli 是否存在。

@cairnkeep/cli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@cairnkeep/cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@cairnkeep/cli 可以商用吗?

@cairnkeep/cli 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@cairnkeep/cli 的下载量有多少?

根据 npm 官方下载统计,@cairnkeep/cli 在 2026/10/09 – 2026/11/07 这 30 天内被下载 1,896 次,日均约 63 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cairnkeep/cli 还在维护吗?

最新版本 2.28.0 发布于 2026/10/31(9 天前);至今共发布 58 个版本,其中过去 12 个月发布了 58 个;首次发布于 2026/07/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。