MCPcopy Index your code
hub / github.com/0xranx/OpenContext

github.com/0xranx/OpenContext @desktop-v0.2.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release desktop-v0.2.7 ↗ · + Follow
1,137 symbols 2,741 edges 158 files 200 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img alt="OpenContext Logo" src="https://github.com/0xranx/OpenContext/raw/desktop-v0.2.7/docs/images/logo-light.png" width="350">







<strong>给你的 AI 助手一个持久记忆。</strong>


不再重复解释,专注高效构建。







<strong>复用你已有的 coding agent。</strong> OpenContext 直接接入你现有的 CLI(Codex/Claude/OpenCode),并提供 GUI + 内置 Skills/工具,无需额外为另一套 Agent 付费。
OpenContext 概览 OpenContext Demo
<a href="https://www.npmjs.com/package/@aicontextlab/cli"><img src="https://img.shields.io/npm/v/@aicontextlab/cli.svg?style=flat-square&color=cb3837" alt="npm version"></a>
<a href="https://github.com/0xranx/OpenContext/blob/main/LICENSE"><img src="https://img.shields.io/github/license/0xranx/OpenContext?style=flat-square" alt="license"></a>







<a href="https://0xranx.github.io/OpenContext/zh/"><strong>🌐 官网</strong></a> · 
<a href="https://0xranx.github.io/OpenContext/zh/usage/"><strong>📖 使用指南</strong></a> · 
<a href="https://github.com/0xranx/OpenContext/releases"><strong>⬇️ 下载桌面版</strong></a>

English


痛点

当你用 AI 助手做事时,上下文会丢、历史决策会忘、跨天/跨仓库会断片。你很容易重复解释背景、重复踩坑,甚至让 AI 在错误前提下继续执行。很多工具只停留在“管理”,并没有接入你已经在用的 coding agent。

解决方案

OpenContext 是一个面向 AI 助手(Agent)与 Cursor / Claude Code / Codex 等编码工具用户的「个人上下文/知识库」。它直接复用你已有的 coding agent CLI(Codex/Claude/OpenCode),并提供 GUI 与内置 Skills/工具,让 AI 助手能「先读历史再动手、做完再沉淀」。

Skills 优先支持: oc init 会生成用户级 skills(Cursor/Claude Code/Codex)和斜杠命令(Cursor/Claude Code),让 Agent 用一条命令完成加载、搜索、创建与迭代。

使用前 使用后
📂 跨 repo/会话 共享上下文很难 ✅ 全局知识库,跨项目复用
🤷 自己的想法无法快速被 Agent 感知到 ✅ Agent 自动加载你的背景和决策
🔒 现有知识内容无法直接通过 Coding Agent 操作 ✅ Agent 可以直接读写你的知识库

包含什么

  • oc CLI — 管理全局 contexts/ 文档库(目录/文档、清单、检索)
  • MCP Server — 让 Cursor/Claude Code/Codex/Agent 通过工具调用 OpenContext
  • Skills + 斜杠命令 — 为 Cursor/Claude Code/Codex 生成用户级 skills,为 Cursor/Claude Code 生成斜杠命令(由 oc init 生成)
  • 面向 Agent 的知识层 — 复用你已有的 coding agent CLI(Codex/Claude/OpenCode),并内置 Skills/工具 + GUI
  • 桌面版应用 — 用原生 UI 管理/搜索/编辑 contexts
  • Web UI — 本地浏览/编辑文档(无需安装桌面版)

为什么 OpenContext 更适合开发者

OpenContext 的知识管理 Agent 可以直接用你已经在用的 coding agent CLI(Codex/Claude/OpenCode),不需要为另一套 Agent 再付费。你带来自己熟悉的代理工具,OpenContext 直接提供现成 GUI 和内置 Skills/工具,让 Agent 能读、搜、写、迭代你的知识库。

快速开始

安装 CLI

npm install -g @aicontextlab/cli

选择你的路径

路径 适合人群 开始使用
🖥️ 桌面版应用 喜欢图形界面的用户 从 Releases 下载
⌨️ CLI + 工具接入 使用 Cursor/Claude Code/Codex/AI Agent 的开发者 npm install -g @aicontextlab/cli && oc init
🔧 仅 CLI 高级用户、自动化场景 npm install -g @aicontextlab/cli

OpenContext 不替换你的 Agent,而是复用你已有的 coding agent CLI,并补上 GUI 与内置 Skills/工具。

30 秒上手(CLI + Cursor/Claude Code/Codex)

# 1. 安装
npm install -g @aicontextlab/cli

# 2. 初始化(会提示选择工具,默认全选)
cd your-project
oc init

# 3. 在 Cursor / Claude Code 中使用斜杠命令
#    /opencontext-context  — 开始工作前加载背景
#    /opencontext-search   — 查找相关文档
#    /opencontext-create   — 创建新文档
#    /opencontext-iterate  — 沉淀学到的内容
#    提示:非交互可用 --tools cursor,claude,codex 或 --no-claude/--no-cursor/--no-codex
#
#    oc init 会安装:
#    - Cursor: ~/.cursor/commands
#    - Claude Code: ~/.claude/commands(或 $CLAUDE_CONFIG_DIR/commands)
#    Skills(斜杠命令的同名封装):
#    - Cursor: ~/.cursor/skills/opencontext-*/SKILL.md
#    - Claude Code: ~/.claude/skills/opencontext-*/SKILL.md(或 $CLAUDE_CONFIG_DIR/skills)
#    - Codex: ~/.codex/skills/opencontext-*/SKILL.md(或 $CODEX_HOME/skills)
#
#    用户级 MCP 配置:
#    - Cursor: ~/.cursor/mcp.json
#    - Claude Code: ~/.claude/mcp.json(或 $CLAUDE_CONFIG_DIR/mcp.json)
#    - Codex: ~/.codex/mcp.json(或 $CODEX_HOME/mcp.json)

📖 详细使用指南、搜索配置和常见问题,请访问官网


CLI 命令(快速参考)

运行 oc <cmd> --help 查看详情。

命令 说明
oc init 初始化 OpenContext + 用户级工具集成
oc folder ls 列出目录
oc folder create <path> -d "desc" 创建目录
oc doc create <folder> <name>.md -d "desc" 创建文档
oc doc ls <folder> 列出文档
oc context manifest <folder> 生成文档清单供 AI 读取
oc search "query" 搜索文档
oc mcp 启动 MCP Server(给 MCP 客户端用)
oc ui 启动本地 Web UI

📖 完整命令参考请访问官网


开发

# 克隆并安装
git clone https://github.com/0xranx/OpenContext.git
cd OpenContext && npm install

# 桌面版应用
npm run tauri:dev    # 开发模式
npm run tauri:build  # 生产构建

# Web UI
npm run ui:dev       # 开发模式
npm run ui:build     # 生产构建

许可证

MIT © OpenContext

Extension points exported contracts — how you extend this code

FolderOptions (Interface)
(no doc)
crates/opencontext-node/index.d.ts
RenameFolderOptions (Interface)
(no doc)
crates/opencontext-node/index.d.ts
MoveFolderOptions (Interface)
(no doc)
crates/opencontext-node/index.d.ts
RemoveFolderOptions (Interface)
(no doc)
crates/opencontext-node/index.d.ts
ListFolderOptions (Interface)
(no doc)
crates/opencontext-node/index.d.ts

Core symbols most depended-on inside this repo

getInvoke
called by 45
src/ui/src/api.js
create_folder
called by 37
crates/opencontext-core/src/lib.rs
create_doc
called by 37
crates/opencontext-core/src/lib.rs
handle
called by 27
bin/oc.js
fetchJSON
called by 25
src/ui/src/api.js
with_conn
called by 23
crates/opencontext-core/src/lib.rs
from
called by 23
crates/opencontext-node/src/lib.rs
exists
called by 20
crates/opencontext-core/src/search/vector_store.rs

Shape

Function 819
Method 177
Class 117
Interface 14
Enum 10

Languages

TypeScript61%
Rust39%

Modules by API surface

src-tauri/src/commands/agent.rs60 symbols
crates/opencontext-core/src/lib.rs54 symbols
crates/opencontext-node/src/lib.rs51 symbols
src/ui/src/api.js50 symbols
crates/opencontext-core/src/tests.rs50 symbols
src-tauri/src/commands/context.rs36 symbols
src/ui/src/services/idea/LocalStorageAdapter.js34 symbols
src-ios/services/ideas.js31 symbols
src/ui/src/components/PlateMarkdown.jsx28 symbols
src/ui/src/services/idea/IdeaService.js24 symbols
src/ui/src/App.jsx23 symbols
src/core/agents.js22 symbols

For agents

$ claude mcp add OpenContext \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page