Installation
Before you start
You need:
- Node.js 20 or later with npm;
- at least one Agent host: Claude Code, Codex or Cursor;
- read access to the repositories and documents you plan to turn into knowledge.
Context runs on your machine. The CLI never calls an LLM itself: the Agent in your host does the reading and writing, and the CLI performs deterministic work such as observing the Context knowledge workspace, capturing sources, indexing code, validating evidence, applying reviews and building packages.
Install the CLI and the plugin
npm install -g @c4a/context-cli@latest
context plugin installThe first command installs the context runtime. The second installs the Agent integration into every supported host it finds. Restart or refresh your Agent host afterwards so it loads the new entries.
flowchart LR
npm["npm install -g @c4a/context-cli"] --> cli["context runtime"]
cli -->|context plugin install| hosts["Claude Code / Codex / Cursor"]
hosts --> entries["/c4a:context and other entries"]
hosts --> providers["Indexer Provider skills"]A global installation creates the namespaced Context entries and also projects the four Indexer Provider skills — context-code-indexer, context-markdown-indexer, context-note-indexer and context-sessions-indexer — without a namespace, so every host can find them. Installing a Provider only makes it discoverable; the workflow selects Providers per task.
What you get
| Entry | Use it to |
|---|---|
/c4a:context | Create a knowledge workspace, continue one, and run production, review, update and build |
/c4a:context-plan | Plan a large project in stages before production |
/c4a:context-inspect-search | Ask questions against knowledge packages or approved knowledge in a knowledge workspace, with sources |
/c4a:context-repo-content | Register or edit same-repository docs and authored Skills without starting production |
/c4a:context is the production entry for both new and existing knowledge workspaces; the other three entries plan, answer or register content and hand production back to it. You do not need to learn lifecycle commands; describe the knowledge goal in normal language. Ordinary coding or design conversations do not start Context on their own — invoke it explicitly or continue an active Context conversation. Commands and Skills lists every entry, how each host spells it, and the Skills that run without being invoked.
Install into one repository only
If you prefer not to change global configuration, install the entries into a single repository:
context plugin install --local /path/to/repo --agent auto-detect--local needs an explicit --agent:
claude,cursororcodexinstall into that repository's.claude,.cursoror.agentsdirectory;allinstalls all three layouts;auto-detectuses whichever of those directories already exist and falls back to.agents/skills;standalonewrites all skills directly to<path>/skills, without commands.
Every mode supports --dry-run. A refresh replaces only unmodified managed files; customized entries are kept and reported as conflicts. Local entries have no plugin namespace.
Check the installation
context --version
context plugin statuscontext plugin status inspects the global hosts. Then open your Agent and invoke /c4a:context. If the entry is present but the context executable is missing, the entry reports the exact installation step and stops rather than partially initializing a knowledge workspace.
Next: Quick Start.
安装
准备工作
你需要:
- Node.js 20 或更高版本,以及 npm;
- 至少一个 Agent 宿主:Claude Code、Codex 或 Cursor;
- 对计划整理成知识的仓库和文档有读取权限。
Context 在你的本机运行。CLI 自身从不调用 LLM:阅读和写作由宿主中的 Agent 完成,CLI 负责确定性的工作,例如观察 Context 知识工作区、采集来源、索引代码、校验证据、应用审核结果和构建知识包。
安装 CLI 和插件
npm install -g @c4a/context-cli@latest
context plugin install第一条命令安装 context 运行时。第二条命令把 Agent 集成安装到它找到的所有受支持宿主中。完成后重启或刷新 Agent 宿主,让它加载新的入口。
flowchart LR
npm["npm install -g @c4a/context-cli"] --> cli["context 运行时"]
cli -->|context plugin install| hosts["Claude Code / Codex / Cursor"]
hosts --> entries["/c4a:context 等入口"]
hosts --> providers["Indexer Provider 技能"]全局安装会创建带命名空间的 Context 入口,同时以无命名空间的形式投影四个 Indexer Provider 技能——context-code-indexer、context-markdown-indexer、context-note-indexer 和 context-sessions-indexer——让每个宿主都能找到它们。安装 Provider 只是让它可被发现;具体用哪些 Provider,由工作流按任务选择。
安装后得到什么
| 入口 | 用途 |
|---|---|
/c4a:context | 创建或继续知识工作区,执行生产、审核、更新和构建 |
/c4a:context-plan | 在生产前分阶段规划大型项目 |
/c4a:context-inspect-search | 基于知识包或知识工作区中已批准的知识提问,并附带来源 |
/c4a:context-repo-content | 登记或编辑同仓库文档和自编 Skill,不启动生产 |
/c4a:context 是新建和已有知识工作区的生产入口;其他三个入口负责规划、回答或登记内容,并把生产交回给它。你不需要学习生命周期命令,用日常语言描述知识目标即可。普通的编码或设计对话不会自动启动 Context——需要显式调用它,或在进行中的 Context 对话里继续。命令与技能列出了全部入口、各宿主中的写法,以及无需调用即可运行的 Skill。
只安装到单个仓库
如果不想改动全局配置,可以把入口只安装到某个仓库:
context plugin install --local /path/to/repo --agent auto-detect--local 需要显式指定 --agent:
claude、cursor或codex分别安装到该仓库的.claude、.cursor或.agents目录;all同时安装这三种布局;auto-detect使用上述目录中已存在的那些,都不存在时回退到.agents/skills;standalone把所有技能直接写入<path>/skills,不包含命令。
每种模式都支持 --dry-run。刷新时只替换未被修改过的托管文件;被自定义过的入口会保留,并作为冲突报告出来。本地安装的入口没有插件命名空间。
检查安装结果
context --version
context plugin statuscontext plugin status 检查全局宿主。然后打开 Agent,调用 /c4a:context。如果入口存在但缺少 context 可执行文件,入口会给出确切的安装步骤并停止,而不会只初始化一半知识工作区。
下一步:快速开始。