canonry README

项目的 README,来自 github.com/Canonry/canonry。合并为一个 markdown 文件:README.md。

Canonry Canonry

npm version Total npm downloads License: MIT Join the Canonry Discord Follow Canonry on X Interfaces: REST API, CLI, MCP, and web dashboard

The agent-first AEO operating platform.
Track mentions and citations across ChatGPT, Claude, Gemini, Meta Muse, and more. Join them with Search Console, GA4, ads, AI crawler traffic, Agent Readiness site audits, and SEO data. Then let your agent create content, publish fixes, manage ChatGPT ads, get pages indexed, and measure what changed.
Open source · Self-hosted · Bring your own keys

Try the live demo  ·  Quick start

Canonry dashboard: AI answers over time, with the share of non-brand answers that mention the brand for Claude, Gemini, and OpenAI, with sample data

Features

Built for Agents

Everything runs on one REST API. The dashboard, CLI, MCP server, and plugins all call it, so your agent can read and do everything you see (and more!).

AI Visibility

Track brand mentions and citations by query and answer engine. See where competitors win, then open the exact answer and sources behind each result. Docs →

Where competitors are winning: mention share against two competitors, mention and citation gaps, and mentioned and cited counts by engine, with sample data

Server-Side AI Traffic

See what AI agents actually do on your site, from your server logs: which pages GPTBot, ClaudeBot, Meta AI, and Grok crawl, which pages ChatGPT, Claude, and Meta AI open for users, and who clicks through. Docs →

Server traffic for the last 24 hours: 105 AI crawler visits, 35 AI user fetches, and 46 AI referral sessions, with an hourly chart, with sample data

Agent Readiness

A site audit for AI agents. Crawl your site and score how well agents and answer engines can reach, read, and cite each page: AI crawler access, llms.txt, structured data, extractable content, and more. Each finding lists the pages it affects, and a map shows the internal links between pages. Docs → · Audit engine →

Site map of 205 crawled pages and the links between them, beside a list of site sections, with sample data

SEO Research

Keyword volume, difficulty, organic rankings, and search gaps against competitors, powered by DataForSEO Labs. Docs →

SEO page with ranked searches, top-10 count, estimated organic traffic, and a table of positions, volume, and difficulty, with sample data

Ads

Let your agent run ChatGPT Ads: sync campaigns and daily results, create and edit campaigns, and switch them on only after you approve. Track Google Ads spend and conversions, and check each conversion's setup across Google Ads and Tag Manager. Paid results stay separate from organic mentions and citations. ChatGPT Ads → · Google Ads →

Google Ads performance: spend, conversions, cost per conversion, a daily chart, and campaign results, with sample data

Also in the box:

An example job for your connected agent:

Find where competitors get cited and we don't. Use search data and the Agent Readiness audit scan to prepare a pull request or WordPress draft for review. After it ships, rerun checks and report what changed.

How it works

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.


Supported Engines

Compare direct AI engines, OpenRouter models, and search answers from Exa and Parallel. Each keeps its own results and history.

OpenAI logo ChatGPT   Claude logo Claude   Gemini logo Gemini   Perplexity logo Perplexity   Meta logo Meta (Muse)   OpenRouter logo OpenRouter   Exa logo Exa   Parallel logo Parallel   + any OpenAI-compatible local model

Works with your agent:

Claude Code logo Claude Code   Codex logo Codex   ChatGPT logo ChatGPT   Claude Desktop logo Claude Desktop   + any MCP client or shell-capable agent

Integrations

Connect the sources you use. Each one adds evidence or tools to the same project.

Google Search Console logo Search Console   Bing logo Bing Webmaster Tools   Google Analytics logo Google Analytics 4   Google Business Profile logo Business Profile   Google Ads logo Google Ads   Google Tag Manager logo Tag Manager   Cloudflare logo Cloudflare   Vercel logo Vercel   Google Cloud logo Cloud Run   WordPress logo WordPress   DataForSEO logo DataForSEO   Common Crawl logo Common Crawl   ChatGPT logo ChatGPT Ads


Quick start

With your agent

Paste this into Claude Code, Codex, or any shell-capable coding agent.

Copy the first-time setup request
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 Agent Readiness 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. If no project matches, show the exact create operation and wait for approval. For the selected project, look up its newest scan with `cnry runs <project> --kind site-audit --limit 1 --format json`. Use that run id for progress, score and findings. For a queued or running scan, follow its progress until it finishes. For a completed or partial scan, check `hasData` and `pagesAudited` in its scorecard. If it scored pages, use its results in step 6. If the scan failed, was cancelled, or finished without scoring a page, report its status and any recorded reason, then propose a fresh scan in step 5. If no scan exists, go straight to step 5.
5. Propose a bounded Agent Readiness audit 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 agent-readiness 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 the run id, status and any recorded diagnostic. If the status it returns is still `queued` or `running`, the scan has not finished: do not rerun it or report results, poll `cnry agent-readiness 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 runs <project> --kind site-audit --limit 1 --format json`, which returns the newest scan whatever its status, and poll the same way.
6. When the run is `completed` or `partial`, read `cnry agent-readiness overview <project> --run-id <run-id> --format json` first. Read `termination` and `complete` from that overview. Then read `cnry agent-readiness score <project> --run-id <run-id> --format json` and `cnry agent-readiness page-scores <project> --run-id <run-id> --sort score-asc --limit 10 --format jsonl`. Read `cnry agent-readiness issues <project> --run-id <run-id> --limit 3 --format json` and summarize the findings, affected pages and any recorded fix. Mention any sites that the scan could not reach. 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 may have scored fewer pages or none. Report how many were scored and 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 scan failed or scored no pages, tell me the recorded reason and next step from `cnry agent-readiness progress <project> --run-id <run-id> --format json`. If there is no recorded cause, say so. Report cancellations separately.
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.

With the plugin

# Claude Code
claude plugin marketplace add Canonry/canonry
claude plugin install canonry@canonry

# Codex
codex plugin marketplace add Canonry/canonry
codex plugin add canonry@canonry

Or connect the MCP adapter to any MCP client. Full steps: Agent Plugin guide.

On your own

npm install -g @canonry/canonry
cnry bootstrap
cnry serve

Then open http://127.0.0.1:4100/setup and follow the setup to scan your site. The crawl saves an Agent Readiness baseline. AI Visibility is optional and has a separate setup.

Scan and read results from the terminal

Keep cnry serve active. In a second terminal, create a project and start a bounded scan:

cnry project create my-site --domain example.com --country US --language en
cnry agent-readiness run my-site --max-pages 100 --wait --format json

Read the run ID and status from the output. If the status is completed or partial, read evidence from that run:

cnry agent-readiness score my-site --run-id <run-id> --format json
cnry agent-readiness page-scores my-site --run-id <run-id> --sort score-asc --limit 10 --format jsonl

--wait polls for up to 15 minutes. If the scan remains active, use cnry agent-readiness progress <project> --run-id <id> --format json. If the scan fails or is cancelled, read the error with cnry run show <run-id> --format json.

Configure a provider and run visibility checks

For an existing project, configure a provider with your own key.

Provider Key source Environment variable
Gemini Google AI Studio GEMINI_API_KEY
OpenAI OpenAI Platform OPENAI_API_KEY
Meta (Muse) Meta Model API MUSE_API_KEY
Claude Anthropic Console ANTHROPIC_API_KEY
Perplexity Perplexity settings PERPLEXITY_API_KEY
OpenRouter OpenRouter keys OPENROUTER_API_KEY
Exa Exa dashboard EXA_API_KEY
Parallel Parallel platform PARALLEL_API_KEY
Local model Any OpenAI-compatible endpoint LOCAL_BASE_URL

Add the queries that matter to your project:

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

Direct APIs, OpenRouter, and search answer services

Canonry supports direct model APIs, OpenRouter, and search answer services such as Exa and Parallel. Direct adapters retain the search and grounding details each provider exposes. OpenRouter offers multiple models through one key. Exa and Parallel search the web and return answers with source evidence.

Each direct engine, OpenRouter model route, and service profile keeps separate results and history. The same model through different APIs can return different answers and citation evidence. Canonry measures brand mentions separately from source citations and keeps missing evidence unknown.

Provider guides describe the evidence and limits of each integration.

Discover questions or run one-off research

Expand your tracked questions. Run cnry discover run <project> --icp "...". This does not change the tracked questions. Preview a completed session with cnry discover promote preview <project> <session-id>. Promote only after approval.

Research without changing tracking. Run cnry research run <project> "query one" "query two" --wait. For a configured portfolio destination, select one --market <key> or --property <key>; Canonry saves the destination with the answers without changing the query. Add paired --template-id <id> --template-version <version> only to preserve an already-expanded template's provenance. Research never adds queries to the tracked questions.

Troubleshoot installation, scans, and visibility results
Problem Next step
Agent Readiness audit scan is still active Read exact counters with cnry agent-readiness progress <project> --run-id <id> --format json.
Agent Readiness audit scan failed Read the error with cnry run show <run-id> --format json. Read the last phase and counters with the progress command.
No visibility results Inspect existing work with cnry runs <project> --format json, then cnry run show <run-id> --format json. This does not start another paid run.
npm install fails on node-gyp Install build tools for better-sqlite3 (guide).

Self-hosting and API

Canonry is single-tenant. Run one instance for one operator or team. Keep unrelated teams on separate instances.

The CLI and REST API are the primary interfaces. They expose measurements, diagnoses, actions, evidence exports, and schedules. OpenAPI is available at GET /api/v1/openapi.json.

See the deployment guide for reverse proxies, daemon mode, Docker, systemd, and Tailscale.

Documentation


Community & Support


Contributing

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

For local agent work, run tests only after changes are finalized and ready for push or review. pnpm verify is optional locally. See CONTRIBUTING.md and the testing guide.

Canonry contributors

License

MIT, starting with Canonry 5.0.0. Use, modify, self-host, redistribute, and build commercial products with Canonry. Keep the copyright and permission notice with copies or substantial portions of the software.

Earlier releases retain their original licenses, including any future-license grants. Dependencies and bundled assets retain their own licenses; see third-party notices.

canonry (Canonry/canonry)

正在搜索数据库…

这是什么?Canonry 是一个开源的、面向 AI 智能体的 AEO(AI 搜索优化)运营平台:它会追踪你的品牌在 ChatGPT、Claude、Gemini、Perplexity 等 AI 问答引擎中的曝光情况,排查搜索和流量方面的变化,并在你或你的智能体采取行动之后衡量进展。它支持自托管,提供网页界面,还有 CLI、MCP 和 REST API。
它和普通的 SEO 排名跟踪工具有什么不同?它衡量的是 AI 曝光度,而不是 Google 排名:包括问答引擎回答中对你品牌的提及和引用、你的提及份额随时间的变化,以及那些引用了竞争对手却漏掉你网站的回答。搜索、流量和网站审计的证据会一并汇总进来,用来说明曝光度为什么会变化。
我怎么把它跑起来?先安装 Canonry 并完成初始化,然后启动 cnry serve,打开网页界面按照引导完成设置并扫描你的网站——第一次抓取会保存一份 Page Health 基线,AI Visibility 则是另一项可选的单独设置。另外,你也可以通过官方的 Claude 和 Codex 插件或 MCP 适配器接入你的智能体。
AI 服务商的 API 密钥需要我自己准备吗?需要,它是 BYOK 模式:每个服务商都由你自己配置——Google AI Studio(Gemini)、OpenAI、Anthropic Console(Claude)、Perplexity——或者指向任意 OpenAI 兼容的端点来使用本地模型。要做曝光度检测,至少需要配置一个服务商。
安装过程中有什么容易出问题的地方吗?文档里提到的常见坑是 npm install 在 node-gyp 上失败:Canonry 内置的 SQLite 驱动 better-sqlite3 需要你先安装原生编译工具。
这是给个人站长用的,还是给整个营销团队用的?Canonry 是单租户的:一个实例只服务一个运营者或团队,不相干的团队应该各自运行独立的实例。在同一个实例里,作品集仍然可以扩展到很多站点资产、市场分组和竞争对手。
我的数据存在哪里——会不会传到别人的云上?所有东西都留在你这边:Canonry 是自托管的,数据保存在本地 SQLite 数据库里,用的是你自己的服务商密钥。部署指南介绍了在你自己的基础设施上配置反向代理、守护进程模式、Docker、systemd 和 Tailscale 的方法。
我的 AI 智能体通过 Canonry 具体能做什么?它能端到端地统筹整项工作:先找出竞争对手被引用而你没被引用的地方,然后结合 Canonry 的内容、WordPress 发布、JSON-LD 和收录工作流,配合它自己的编码工具来准备修复方案——之后再重跑检测,报告哪些地方发生了变化。智能体可以通过插件、MCP 适配器或 REST API 接入,独立的智能体技能则用 cnry skills install 安装。
它能接入哪些数据源?来自 ChatGPT、Claude、Gemini、Perplexity 以及 OpenAI 兼容本地模型的 AI 回答;来自 Google Search Console、Bing Webmaster Tools 和 Google Business Profile 的搜索及本地数据;Google Analytics 4;Google Ads 和 Tag Manager 的转化数据;来自 Cloudflare、Vercel、Cloud Run 和 WordPress 的服务器流量;以及通过 DuckDB 在本地查询 Common Crawl 得到的外链数据;另外还支持 ChatGPT Ads 效果衡量。
它为什么直接调用 AI 服务商,而不是用模型路由器?因为路由器可能会漏掉 Canonry 要衡量的确切回答、引用和搜索细节。直连服务商的 API 适配器能采集到这些更丰富的数据,这样品牌提及和引用才能被准确统计,你的曝光度变化也才能得到解释。
我能不能不打开面板,直接在终端里跑扫描?可以——保持 cnry serve 运行,然后在第二个终端里创建项目并发起一次有边界的扫描。结果会以 JSON 形式通过 cnry run show 和 cnry technical-aeo progress 返回,--wait 参数会轮询一次运行最多 15 分钟,超时后你再手动轮询。
作者
Canonry
大小
56.7 MB
星标
212
时长
8个月
提交 · 90 天