# @canonry/canonry 中文文档

规范地址：https://npmcn.com/package/%40canonry/canonry/

版本：7\.78\.2
npm 元数据更新时间：2026-10-31T17:16:18.398Z
中文译文更新时间：2026-10-31T18:19:41.780Z
软件包许可：MIT

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

原始 npm 页面：https://www.npmjs.com/package/%40canonry/canonry
原文对照：https://npmcn.com/package/%40canonry/canonry/?lang=original
项目主页：https://canonry.ai/
源码仓库：https://github.com/Canonry/canonry

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

- 包体积（解压后）：15.3 MB，201 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=22\.23\.4 \<23 \|\| \>=24\.22\.1 \<25 \|\| \>=26\.12\.1 \<27
- 运行依赖：26 个
- 首次发布：2026-07-02T01:44:31.048Z
- 最新版本发布：2026-10-31T17:16:18.231Z
- 已发布版本数：323（近 12 个月 323 个）

## 中文简介

自托管AI可见性（AEO）平台：跟踪ChatGPT， Claude， Gemini和Perplexity如何引用您的域，将其与搜索控制台，GA4，服务器端流量和付费媒体连接，并通过代理工具（CLI， REST， MCP）修复您发现的内容。本地SQLite。

## 安装

```sh
npm install @canonry/canonry
```

也可以使用：`pnpm add @canonry/canonry`、`yarn add @canonry/canonry`、`bun add @canonry/canonry`

## README

# 牧师 ![Canonry canary icon](https://raw.githubusercontent.com/Canonry/canonry/main/apps/web/public/favicon-32.png)

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://npmcn.com/package/%40canonry/canonry/LICENSE) [![npm version](https://img.shields.io/npm/v/@canonry/canonry)](https://www.npmjs.com/package/@canonry/canonry) [![Discord](https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&logoColor=white)](https://discord.gg/8K9yY7GywJ) [![Twitter](https://img.shields.io/badge/Twitter-Follow-000000?logo=x&logoColor=white)](https://x.com/canonry_ai)

经典是一种 **agent-first (CLI， MCP， API)，开源的AEO操作平台，具有全面的web UI。** 随着时间的推移跟踪人工智能的可见性，调查搜索和流量的变化，并在你或你的代理采取行动后衡量进展。

**自托管，使用SQLite，使用自己的（BYOK）提供程序密钥。** web UI和您的座席看到相同的证据。

[现场UI演示](https://custom-demo.canonry.ai/projects/summit-roofing) · [快速启动](https://npmcn.com/package/%40canonry/canonry/#readme-quick-start) · [证据](https://npmcn.com/package/%40canonry/canonry/#readme-explore-the-evidence) · [行动](https://npmcn.com/package/%40canonry/canonry/#readme-act-on-the-evidence) · [集成](https://npmcn.com/package/%40canonry/canonry/#readme-integrations) · [文档](https://npmcn.com/package/%40canonry/canonry/#readme-documentation) · [支持](https://npmcn.com/package/%40canonry/canonry/#readme-support)

[![AI, search, analytics, and traffic sources feed Canonry on schedules or on demand. Historical evidence across multiple domains and portfolios runs from baseline through the latest checks. Your agent reads evidence and sends commands to Canonry tools, while using its own tools for code and content. Canonry publishes to WordPress, submits to Google and Bing, and supplies the dashboard, evidence exports, and webhooks. Site changes loop back into measurement.](https://raw.githubusercontent.com/Canonry/canonry/main/docs/images/measure-act.svg)](https://raw.githubusercontent.com/Canonry/canonry/main/docs/images/measure-act.svg)

## 快速启动

### 从你的代理开始

复制第一次安装请求

```text
Help me set up Canonry for my public site.

Use the official Canonry docs:
- Agent quickstart: https://github.com/Canonry/canonry#or-use-any-shell-capable-coding-agent
- CLI reference: https://github.com/Canonry/canonry/blob/main/skills/canonry/references/canonry-cli.md
- Plugin setup: https://github.com/Canonry/canonry/blob/main/docs/plugins.md
- MCP setup: https://github.com/Canonry/canonry/blob/main/docs/mcp.md

Pick one path and stay on it. Use connected Canonry tools (plugin or MCP) only if you have them and I have not pointed you at a specific install. A connected tool runs in its own process and never sees `CANONRY_CONFIG_DIR`, `CANONRY_PORT`, or anything else you export in a shell, so it always acts on my default install. If I named a config directory, a port, or a sandbox, that is the shell path: use `cnry` and tell me which path you chose. Never mix the two in one run, and never create a duplicate project. The `cnry` and `canonry` commands are interchangeable.

1. Ask for my public domain, country, and language. Do not create or scan anything yet. Country and language are only applied when a project is created, so if you reuse an existing project, report its country and language instead of changing them.
2. Shell path only: confirm `cnry` is on PATH, then run `cnry --version`. If Canonry is missing, propose `npm install -g @canonry/canonry` and wait for approval. Then run `cnry doctor --format json`, which is the command that says whether config, database, and server are in place. `cnry --version` does not read config and succeeds on a completely unconfigured install, so it cannot answer this. If config is missing, run `cnry bootstrap` yourself: it is not interactive, takes about a second, and is safe to rerun. Do not hand it to me and wait. The interactive command is `cnry init`, which is optional provider and OAuth setup that Page Health does not need. Bootstrap prints an API key, so do not repeat its output back to me, and never ask me to paste passwords, API keys, OAuth credentials, or command output.
3. Confirm the API is reachable. `cnry doctor --format json` reports it, and any project read exits non-zero with `CONNECTION_ERROR` when it is not. If it is unreachable, propose `cnry start` and wait for approval. Use `cnry start`, which is the background daemon, and not `cnry serve`, which runs in the foreground and will block you until I stop it, even though some error messages suggest it. Stop anything you started with `cnry stop`.
4. List projects with the connected project tool or `cnry project list --format json`, and reuse one whose domain matches. Confirm the proposed name is not already assigned to a different domain. To find out whether a project has already been scanned, run `cnry technical-aeo score <project> --format json` with no `--run-id`, which reports the latest run. Read the `hasData` field, not the score: this command exits 0 and reports `aggregateScore: 0` for a project that has never been scanned, so reading the score alone would have you tell me my site scored zero. If `hasData` is true and `runStatus` is `completed` or `partial`, read that scan instead of starting a new one. If no project matches, show the exact create operation and wait for approval.
5. Propose a bounded Site Health scan: `--max-pages 100` for a first look, plus whether dead-link checking is on (it is off unless you pass `--check-dead-links`). Show the connected operation or the exact `cnry technical-aeo run <project> --max-pages 100 --wait --format json` command with the project name filled in, and wait for separate approval before scanning. `--wait` polls for up to 15 minutes and returns only the run id and status. If the status it returns is still `queued` or `running`, the scan has not finished: do not rerun it or report results, poll `cnry technical-aeo progress <project> --run-id <run-id> --format json` until it is terminal. If `--wait` outruns your own tool timeout first, recover the run id with `cnry technical-aeo score <project> --format json` and poll the same way.
6. When the run is `completed` or `partial`, read `cnry technical-aeo crawl <project> --run-id <run-id> --format json` first. It is the only one of these commands that carries `termination` and `complete`; the score and pages commands do not. Then read `cnry technical-aeo score <project> --run-id <run-id> --format json` and `cnry technical-aeo pages <project> --run-id <run-id> --sort score-asc --limit 10 --format jsonl`. Tell me the termination reason in plain words and whether the scan covered the whole site or stopped at a page, link, depth, or time limit. A `partial` run scored the pages it reached and not my site, so never present it as a full-site result. If it stopped early, the fix depends on the reason, so say which: a page or depth limit needs a larger budget, a time limit needs a smaller scan (a lower `--max-pages` or `--max-depth`). If the run failed or was cancelled, inspect the run error and stop.
7. Summarize only completed evidence, then propose AI Visibility setup. Ask before you add queries, connect providers, start a provider-backed or quota-consuming run, edit files, or publish.
```

### 或者使用官方Claude和Codex插件

连接 [代理插件](https://npmcn.com/package/%40canonry/canonry/docs/plugins.md) 或者 [MCP适配器](https://npmcn.com/package/%40canonry/canonry/docs/mcp.md) 给你自己的经纪人。

### 或者自己在本地开始

1.  安装牧师。
    
    ```bash
    npm install -g @canonry/canonry
    ```
    
    如果您之前安装了 `@ainyc/canonry`、运行 `npm uninstall -g @ainyc/canonry` 首先释放共享命令名。中的现有配置和数据 `~/.canonry` 呆在原地。新版本仅在 `@canonry`.
    
2.  初始化牧师。
    
    ```bash
    cnry bootstrap
    ```
    
3.  牧师开始。
    
    ```bash
    cnry serve
    ```
    
4.  开放 [http://127.0.0.1:4100/setup](http://127.0.0.1:4100/setup) 并按照设置扫描您的网站。
    

抓取保存页面运行状况基线。AI可见性是可选的，有一个单独的设置。

从终端扫描和读取结果

保持 `cnry serve` 活跃。在第二个终端中，创建一个项目并开始有界扫描：

```bash
cnry project create my-site --domain example.com --country US --language en
cnry technical-aeo run my-site --max-pages 100 --wait --format json
```

从输出中读取运行ID和状态。如果状态为 `completed` 或者 `partial`，阅读那次跑步的证据：

```bash
cnry technical-aeo score my-site --run-id <run-id> --format json
cnry technical-aeo pages my-site --run-id <run-id> --sort score-asc --limit 10 --format jsonl
```

`--wait` 投票长达15分钟。如果扫描仍然处于活动状态，请使用 `cnry technical-aeo progress <project> --run-id <id> --format json`. 如果扫描失败或被取消，请使用 `cnry run show <run-id> --format json`.

## 探究证据

您的代理和指示板使用相同的项目API。仪表板提供趋势、准确的答案和站点发现，供人工审阅。

### AI能见度

通过查询和回答引擎跟踪品牌的提及和引用。找到引用竞争对手的答案，但省略你的网站。

比较直接的AI引擎，OpenRouter模型，并从Exa和Parallel搜索答案。

![Canonry AI Visibility mention share trend across answer engines](https://raw.githubusercontent.com/Canonry/canonry/main/docs/images/ai-visibility-trend.png)

_随着时间的推移，跟踪你的应答引擎品牌提及的份额。_

![Canonry AI Visibility citation map across queries and answer engines](https://raw.githubusercontent.com/Canonry/canonry/main/docs/images/ai-visibility-diagnostics.png)

引文图显示了查询和引擎之间的提及和引文覆盖范围。 [对被引用的域名和页面进行排名](https://npmcn.com/package/%40canonry/canonry/skills/canonry/references/canonry-cli.md#cited-source-rankings-cnry-sources)，然后查看每个结果背后的确切答案和url。

配置提供程序并运行可见性检查

对于现有项目，请使用自己的密钥配置提供程序。

| 提供者 | 主要来源 | 环境变量 |
| --- | --- | --- |
| 双子座 | [b谷歌AI工作室](https://aistudio.google.com/apikey) | `GEMINI_API_KEY` |
| OpenAI | [OpenAI平台](https://platform.openai.com/api-keys) | `OPENAI_API_KEY` |
| 元(灵感) | [元模型API](https://dev.meta.ai/) | `MUSE_API_KEY` |
| 克劳德。 | [人为控制台](https://console.anthropic.com/settings/keys) | `ANTHROPIC_API_KEY` |
| 困惑 | [困惑的设置](https://www.perplexity.ai/settings/api) | `PERPLEXITY_API_KEY` |
| [OpenRouter](https://npmcn.com/package/%40canonry/canonry/docs/providers/openrouter.md) | [OpenRouter键](https://openrouter.ai/keys) | `OPENROUTER_API_KEY` |
| [穰](https://npmcn.com/package/%40canonry/canonry/docs/providers/answer-services/exa.md) | [穰仪表板](https://dashboard.exa.ai/api-keys) | `EXA_API_KEY` |
| [平行](https://npmcn.com/package/%40canonry/canonry/docs/providers/answer-services/parallel.md) | [并行平台](https://platform.parallel.ai/) | `PARALLEL_API_KEY` |
| 当地的模型 | 任何openai兼容的端点 | `LOCAL_BASE_URL` |

添加对您的项目重要的查询：

```bash
cnry query add my-site "your first query" "your second query"
cnry run my-site --wait
cnry visibility-stats my-site --by-provider
```

直接api， OpenRouter和搜索答案服务

canonical支持直接模型api、OpenRouter和搜索答案服务 作为Exa和Parallel。直接适配器保留搜索和接地细节 每个提供者都公开。OpenRouter通过一个密钥提供多个模型。穰 和并行搜索网络，并返回与源证据的答案。

每个直接引擎、OpenRouter模型路由和服务配置文件都是分开的 结果和历史。同一个模型通过不同的api可以返回不同的结果 答案和引用证据。标准分别衡量品牌提及 来源引用和保持缺失的证据未知。

[提供指导](https://npmcn.com/package/%40canonry/canonry/docs/providers/README.md) 描述的证据和限制 每个集成。

发现问题或进行一次性研究

**扩展你的跟踪问题。** 运行 `cnry discover run <project> --icp "..."`． 这不会改变跟踪问题。 预览已完成的会话 `cnry discover promote preview <project> <session-id>`． 批准后才能晋升。

**不改变跟踪的研究。** 运行 `cnry research run <project> "query one" "query two" --wait`. 对于已配置的投资组合目的地，选择一个 `--market <key>` 或者 `--property <key>`;canonical在不更改查询的情况下保存目的地和答案。添加配对 `--template-id <id> --template-version <version>` 只是为了保存已经扩展的模板的来源。研究从不在跟踪问题中添加查询。

### 搜索、流量和站点运行状况

通过搜索和本地性能、爬虫访问、AI页面获取、推荐和转换等证据调查可见性变化。 现场审核显示技术发现和证据。

![Canonry Site Map graph](https://raw.githubusercontent.com/Canonry/canonry/main/docs/images/dashboard.png)

_映射可抓取的页面和连接它们的内部链接。_

### 搜索引擎优化数据与DataForSEO

使用 **DataForSEO实验室** b谷歌关键字研究，有机排名和域名比较。 通过仪表板、CLI、MCP和API探索搜索量、难度、CPC、排名url和估计流量。

[配置DataForSEO](https://npmcn.com/package/%40canonry/canonry/docs/seo-data.md).

![Canonry DataForSEO integration showing domain metrics and ranked keywords](https://npmcn.com/package/%40canonry/canonry/docs/images/seo-data-phase-one/desktop.jpg)

_搜索引擎优化仪表板与样本数据：有机关键字总数，估计流量，排名关键字。_

### 投资组合和竞争对手

使用 [版本化的测量计划](https://npmcn.com/package/%40canonry/canonry/docs/mcp.md#tool-surface) 用于地点、产品或站点部分的组合。

-   **属性:** 为每个属性分配查询、引擎、模型和位置。保持品牌和非品牌报道分开。
-   **市场组:** 组织重叠的属性集，每个属性集都有自己的竞争对手。
-   **比较:** 比较属性、组、引擎和位置。打开每个结果后面的确切答案和引用的url。

## 根据证据采取行动

你的代理通过Canonry和它自己的工具来协调工作。

-   **改善网站：** 将你的代理人的编码工具与Canonry的内容结合起来， [WordPress出版](https://npmcn.com/package/%40canonry/canonry/docs/wordpress-setup.md)， JSON-LD，和 [索引的工作流](https://npmcn.com/package/%40canonry/canonry/skills/canonry/references/indexing.md).
-   **变化后的测量：** 配置 [独立的时间表](https://npmcn.com/package/%40canonry/canonry/skills/canonry/references/canonry-cli.md#scheduling--notifications) 用于数据同步和检查。将新的结果与先前的证据进行比较。
-   **出口及跟进：** 读 [人工智能可见性证据](https://npmcn.com/package/%40canonry/canonry/docs/report-retirement.md) 和 [交通分析](https://npmcn.com/package/%40canonry/canonry/docs/report-retirement.md)． 发送 [webhook警报](https://npmcn.com/package/%40canonry/canonry/skills/canonry/references/canonry-cli.md#agent) 到Discord、Slack或你的系统。

**连接代理的示例作业：**

> 找出竞争对手被引用而我们没有的地方。使用搜索数据和站点审计来准备拉取请求或WordPress草案以供审查。发布后，重新运行检查并报告更改的内容。

## 集成

连接你使用的资源。每个集成都将证据或工具添加到相同的项目工作流中。

| 区域 | 支持集成 |
| --- | --- |
| **人工智能的答案** | ChatGPT·Claude·Gemini·Meta （Muse）·Perplexity·兼容openai的本地模型 |
| **搜索和本地** | [谷歌搜索控制台](https://npmcn.com/package/%40canonry/canonry/docs/google-search-console-setup.md) · [必应网站管理员工具](https://npmcn.com/package/%40canonry/canonry/docs/bing-webmaster-setup.md) · [谷歌业务简介](https://npmcn.com/package/%40canonry/canonry/skills/canonry/references/google-business-profile.md) |
| **搜索引擎优化的研究** | **[DataForSEO实验室](https://npmcn.com/package/%40canonry/canonry/docs/seo-data.md)**：关键字指标，排名关键字，和域名比较 |
| **分析** | [b谷歌分析](https://npmcn.com/package/%40canonry/canonry/docs/google-analytics-setup.md) |
| **转换测量** | [谷歌广告+谷歌标签管理器](https://npmcn.com/package/%40canonry/canonry/docs/google-marketing.md)：只读快照和声明的转换契约 |
| **服务器流量** | [Cloudflare·Vercel·Cloud Run·WordPress](https://npmcn.com/package/%40canonry/canonry/skills/canonry/references/server-side-traffic.md) |
| **反向链接** | [常见的爬行](https://npmcn.com/package/%40canonry/canonry/skills/canonry/references/canonry-cli.md#backlinks-common-crawl) 使用DuckDB在本地查询 |
| **出版和索引** | [WordPress](https://npmcn.com/package/%40canonry/canonry/docs/wordpress-setup.md) ····· [站点地图和URL提交](https://npmcn.com/package/%40canonry/canonry/skills/canonry/references/indexing.md) |
| **ChatGPT广告** | [活动测量、暂停活动编辑、批准激活和操作协调](https://npmcn.com/package/%40canonry/canonry/docs/mcp.md#tool-surface) |

## 自托管和API

规范是单租户的。为一个操作员或团队运行一个实例。将不相关的团队放在不同的实例上。

CLI和REST API是主要接口。它们暴露了测量、诊断、行动、证据输出和时间表。 OpenAPI可在 `GET /api/v1/openapi.json`.

看到 [部署指南](https://npmcn.com/package/%40canonry/canonry/docs/deployment.md) 对于反向代理，有守护模式、Docker、systemd和Tailscale。

## 文档

-   **操作牧师:** [CLI参考](https://npmcn.com/package/%40canonry/canonry/skills/canonry/references/canonry-cli.md) · [代理插件](https://npmcn.com/package/%40canonry/canonry/docs/plugins.md) · [MCP](https://npmcn.com/package/%40canonry/canonry/docs/mcp.md)
-   **使用内置Aero：** [设置和分析工作流](https://npmcn.com/package/%40canonry/canonry/skills/aero/SKILL.md)
-   **了解系统：** [体系结构](https://npmcn.com/package/%40canonry/canonry/docs/architecture.md) · [数据模型](https://npmcn.com/package/%40canonry/canonry/docs/data-model.md)
-   **安装独立代理技能：** `cnry skills install` （[指南](https://npmcn.com/package/%40canonry/canonry/skills/canonry/SKILL.md)）
-   **浏览所有指南：** [文档索引](https://npmcn.com/package/%40canonry/canonry/docs/README.md)

排除安装、扫描和可见性结果的故障

| 问题 | 下一个步骤 |
| --- | --- |
| 站点扫描仍处于活动状态 | 读取精确计数器 `cnry technical-aeo progress <project> --run-id <id> --format json`. |
| 站点扫描失败 | 读取错误 `cnry run show <run-id> --format json`． 使用progress命令读取最后一个阶段和计数器。 |
| 无能见度结果 | 检查现有的工作 `cnry runs <project> --format json`,然后 `cnry run show <run-id> --format json`． 这不会引发另一场付费运行。 |
| `npm install` 失败在 `node-gyp` | 安装构建工具 `better-sqlite3` （[指南](https://github.com/WiseLibs/better-sqlite3/blob/master/docs/troubleshooting.md)）。 |

## 支持

加入 [牧师不和谐](https://discord.gg/8K9yY7GywJ) 寻求支持和有关Canonry的问题。

## 贡献

```bash
git clone https://github.com/Canonry/canonry.git && cd canonry
pnpm install
```

对于本地代理工作，仅在更改最终确定并准备推送或审查之后运行测试。 `pnpm verify` 是可选的。看到 [CONTRIBUTING.md](https://npmcn.com/package/%40canonry/canonry/CONTRIBUTING.md) 和 [测试指南](https://npmcn.com/package/%40canonry/canonry/docs/testing.md).

## 许可证

[麻省理工学院](https://npmcn.com/package/%40canonry/canonry/LICENSE)，从标准5.0.0开始。使用、修改、自托管、重新分发和构建使用Canonry的商业产品。保留软件副本或主要部分的版权和许可通知。

早期版本保留其原始许可证，包括任何未来的许可证授予。依赖项和捆绑资产保留自己的许可证；看到 [第三方通知](https://npmcn.com/package/%40canonry/canonry/packages/canonry/THIRD_PARTY_NOTICES.md).

## 常见问题

### @canonry/canonry 是什么？

自托管AI可见性（AEO）平台：跟踪ChatGPT， Claude， Gemini和Perplexity如何引用您的域，将其与搜索控制台，GA4，服务器端流量和付费媒体连接，并通过代理工具（CLI， REST， MCP）修复您发现的内容。本地SQLite。

### 如何安装 @canonry/canonry？

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

### @canonry/canonry 支持 TypeScript 吗？

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

### @canonry/canonry 支持 ESM 还是 CommonJS？

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

### @canonry/canonry 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=22\.23\.4 \<23 \|\| \>=24\.22\.1 \<25 \|\| \>=26\.12\.1 \<27。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @canonry/canonry 可以商用吗？

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

### @canonry/canonry 还在维护吗？

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

