# @almosawy/cortex-brain 中文文档

规范地址：https://npmcn.com/package/%40almosawy/cortex-brain/

版本：2\.0\.4
npm 元数据更新时间：2026-10-25T09:49:46.883Z
中文译文更新时间：2026-11-07T00:13:19.229Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40almosawy/cortex-brain
原文对照：https://npmcn.com/package/%40almosawy/cortex-brain/?lang=original

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：331 kB，29 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- Node.js 要求：\>=18\.0\.0
- 运行依赖：9 个
- 首次发布：2026-10-18T16:32:59.921Z
- 最新版本发布：2026-10-25T09:47:23.299Z
- 近 30 天下载量：2120（2026-10-06 至 2026-11-04，npm 官方下载统计）
- 已发布版本数：10（近 12 个月 10 个）

## 中文简介

Cortex Entertainment:终极AI代码情报与核查平台. 无相幻相.

## 安装

```sh
npm install @almosawy/cortex-brain
```

也可以使用：`pnpm add @almosawy/cortex-brain`、`yarn add @almosawy/cortex-brain`、`bun add @almosawy/cortex-brain`

## README

# Cortex Entertainment - 决定性的大脑项目

**停止AI幻觉. 给你的AI 确切的代码它需要, 而不是整个项目.**

Cortex是一个本地第一的高性能代码智能平台,它扫描了您的代码库,构建了依赖性图表,并为AI代理(如克洛德,GPT,或Cursor)提供了经过验证的上下文 **无幻觉**。 。 。 .

## 为什么是Cortex企业?

-   **QQ快闪:** 由本地SQLite公司提供电力(`better-sqlite3`),搜索结果为 < 10ms.
-   **零幻觉:** 在 AI 使用前验证任何符号(函数,类,文件) 。 如是图中所出所出所出所出所出所出所出所出所出所出所出.
-   **爆炸半径 :** 在修改一个函数之前, 请确切看到哪些文件会断开 .
-   **互动依赖地图 :** 你整个密码库的视觉图.
-   **QQ 多语言支持 :** 电源 `tree-sitter` 用于精确分析 JavaScript 、 TypeScript 和 **蟒**。 。 。 .
-   **死亡代码和安全审计:** 检测未使用的代码和高压安全漏洞.
-   **AI 环境导出器 :** 导出完美格式化的Markdown代码块直接粘贴到克洛德或ChatGPT.
-   **\* 土著MCP支助:** 作为MCP服务器直接连接到克洛德桌面和光标.
-   **本地第一:** 你的密码从不离开机器.

## \* 安装

```bash
npm install -g @almosawy/cortex-brain
🎯 Quick Start
Go to your project directory:

bash
cd /path/to/your/project
Scan your codebase (builds the AST graph):

bash
cortex scan
Start the Enterprise Dashboard:

bash
cortex serve
Open your browser at http://localhost:3000.

🛠️ CLI Commands
cortex scan - Build the AST graph, dependency edges, and call graph.

cortex serve - Start the Cortex Enterprise Dashboard (API + UI).

cortex ask "<query>" - Search the codebase from terminal.

cortex verify <type> <name> [file] - Verify if a symbol exists.

cortex context - Generate AI context (Markdown) for the project.

cortex mcp - Start the MCP server for Claude Desktop / Cursor integration.

🔌 MCP Integration (Claude Desktop / Cursor)
Add this to your claude_desktop_config.json or Cursor MCP settings:

json
{
  "mcpServers": {
    "cortex": {
      "command": "cortex",
      "args": ["mcp"]
    }
  }
}
🏗️ Architecture
Scanner: Uses tree-sitter to parse JavaScript/TypeScript/Python into a precise AST.

Graph: Stores nodes (functions, classes, files), edges (imports, defines), and call-graphs in SQLite.

Server: Express.js with Helmet, CORS, Rate Limiting, and Zod validation.

UI: Enterprise dashboard with Dependency Map (D3.js/Canvas), Syntax Highlighting, and Impact Analysis.

📄 License
MI
```

## 常见问题

### @almosawy/cortex-brain 是什么？

Cortex Entertainment:终极AI代码情报与核查平台\. 无相幻相\.

### 如何安装 @almosawy/cortex-brain？

在项目目录运行 npm install @almosawy/cortex-brain，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 cortex，可以用 npx cortex 直接运行。

### @almosawy/cortex-brain 支持 TypeScript 吗？

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

### @almosawy/cortex-brain 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @almosawy/cortex-brain 需要什么版本的 Node\.js？

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

### @almosawy/cortex-brain 可以商用吗？

@almosawy/cortex-brain 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @almosawy/cortex-brain 的下载量有多少？

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

### @almosawy/cortex-brain 还在维护吗？

最新版本 2\.0\.4 发布于 2026/10/25（13 天前）；至今共发布 10 个版本，其中过去 12 个月发布了 10 个；首次发布于 2026/10/19。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

