@first-tree-ai/context-tree

中文文档
1.1.1发布于 2026/11/05Apache-2.0TypeScriptES Module近 30 天下载 2.1万

Durable, structured project context for coding agents: a CLI plus framework-neutral skills.

原始使用文档
文档目录3 节
  1. Get started
  2. Use with your agent
  3. Connect an existing tree

Context Tree

A shared project notebook for you and your coding agent.

Keep decisions, constraints, and useful lessons in Markdown files alongside your code. Each folder has an index, so an agent can find the context it needs without reading every document.

A tree can live inside an existing repository, in a standalone folder, or in a shared GitHub repository.

Get started

npm install --global @first-tree-ai/context-tree
cd my-project
context-tree init docs

This creates a tree in docs/ and connects it to your project.

Read its index:

context-tree read

Edit the Markdown yourself or ask your agent to update it. Check your changes with context-tree verify, then commit them with your code.

Use with your agent

The package includes skills for Claude Code, Codex, and Pi. Global installation adds them for detected hosts; restart your agent to pick them up.

Ask your agent:

Read the project context before starting. When you're done, record any useful decisions.

You can also ask it to tidy the tree or schedule regular cleanup. Cleanup consolidates duplicates and improves organization, leaving changes on a separate branch for review by default.

Connect an existing tree

context-tree connect --path docs

To share knowledge across projects, connect a tree from GitHub:

context-tree connect acme/knowledge --path docs --ref main

Connecting a Git subtree requires Git 2.36 or newer. Managed snapshots and write sessions check out the selected subtree and its ancestor files; connecting the repository root checks out the full repository.

Use context-tree sync to fetch updates. With multiple trees, select one by its directory or repository name, such as context-tree read --tree knowledge.

See context-tree --help for commands and the specification for technical details.

版本与发布记录

@first-tree-ai/context-tree 共发布 57 个版本,首次发布于 2026/08/19;过去 12 个月发布了 57 个版本。

版本发布日期距今
1.1.1latest2026/11/0510 天前
1.1.2-alpha.202611041934staging2026/11/0510 天前
1.1.1-alpha.2026110419282026/11/0510 天前
1.1.1-alpha.2026110418582026/11/0510 天前
1.1.02026/11/0510 天前
1.1.1-alpha.2026110417342026/11/0510 天前

关于 @first-tree-ai/context-tree 的常见问题

@first-tree-ai/context-tree 是什么?

Durable, structured project context for coding agents: a CLI plus framework-neutral skills.

如何安装 @first-tree-ai/context-tree?

在项目目录运行 npm install @first-tree-ai/context-tree,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 context-tree,可以用 npx context-tree 直接运行。

@first-tree-ai/context-tree 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@first-tree-ai/context-tree 支持 ESM 还是 CommonJS?

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

@first-tree-ai/context-tree 需要什么版本的 Node.js?

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

@first-tree-ai/context-tree 可以商用吗?

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

@first-tree-ai/context-tree 的下载量有多少?

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

@first-tree-ai/context-tree 还在维护吗?

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