npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

geo-optimization-cli

v1.13.0

Published

AI-powered GEO (Generative Engine Optimization) tool — generates llms.txt, robots.txt rules, and Schema markup to make websites discoverable by ChatGPT, Claude, Perplexity, and Gemini.

Readme

geo-optimization-cli

让 ChatGPT、Claude、Perplexity、Gemini 主动引用你的网站。 实时检测 + 自动生成修复文件,无需写代码,10 分钟完成 GEO 优化。

npm version Node.js License: MIT


这个工具解决什么问题?

越来越多用户不去 Google 搜索,而是直接问 AI:

「有什么好用的项目管理工具推荐?」 「XX 行业最好的平台是哪个?」

如果你的网站没有做 GEO(生成式搜索引擎优化),AI 在回答这类问题时根本不会提到你——不是因为产品不好,而是因为 AI 系统找不到足够的结构化信息来引用你。

这个工具做三件事:检测问题 → 生成修复文件 → 验证效果,上传到你的网站后,AI 系统就能识别、理解并引用你的内容。


🚀 三秒上手

# 安装
npm install -g geo-optimization-cli

# 检测你的网站 GEO 评分
geo check https://yoursite.com

# 一键生成修复文件(推荐)
geo fix https://yoursite.com

# 部署后验证效果
geo diff https://yoursite.com

# 与竞品对比
geo compare https://yoursite.com https://competitor.com

⚡ 标准工作流:5 步完成 GEO 优化

第 1 步:检测当前状态

geo check https://yoursite.com

输出示例:

🔍 GEO 实时检测:https://yoursite.com
────────────────────────────────────────────────────────
GEO 评分:40/100  ████░░░░░░░░░░░░  较差

检测项:
  ✓  robots.txt      已存在
  ✗  llms.txt        未配置 — AI 爬虫无法确认数据权限
  ✗  AI 爬虫访问     未允许 GPTBot、ClaudeBot 等
  ✗  Schema 数据     未检测到结构化标记
  ✗  Open Graph      缺少 — AI 引用时缺少展示信息
  ✗  canonical       缺少 — 可能分散引用权重
  ✓  noindex         页面允许索引

关键问题:
  🔴 缺少 llms.txt
  🔴 AI 爬虫未被 robots.txt 允许

修复后预计评分:96+/100

一键生成修复文件(Agent 可直接使用):
    geo fix https://yoursite.com

第 2 步:生成修复文件

geo fix https://yoursite.com

一个命令完成三件事:

  1. 实时分析网站 GEO 状态
  2. 将所有修复文件写入 ./geo-artifacts/(内容使用你的真实站名和 URL)
  3. 生成 fix-manifest.json——完整部署路由表,开发者或 Agent 可直接使用

输出示例:

🛠️  GEO 修复文件已生成
────────────────────────────────────────────────────────
网站:https://yoursite.com
评分:40/100  → 修复后预计:96+/100

输出目录:geo-artifacts/

生成文件:
  🔴  geo-artifacts/llms.txt
       → 部署到:/llms.txt
  🔴  geo-artifacts/robots-txt-update.txt
       → 部署到:/robots.txt  (追加到末尾)
  🟠  geo-artifacts/schema/Organization-inject.html
       → 注入到:所有 页面 <head>

清单文件:geo-artifacts/fix-manifest.json
(含完整部署路径与工时说明,可直接给 Agent 或开发者使用)

💡 部署后验证修复效果:
     geo diff https://yoursite.com  ← 对比修复前后评分

第 3 步:把文件交给开发部署

你已完成 PM 能做的全部工作。把下面这段话发给开发:

你好,我用 geo-optimization-cli 生成了一批 GEO 优化文件,在 geo-artifacts/ 目录下。
请按 fix-manifest.json 里的说明部署,预计 1-2 小时:

1. 将 llms.txt 上传至网站根目录(https://[你的域名]/llms.txt)
2. 将 robots-txt-update.txt 里的内容追加到 robots.txt 末尾
3. 将 schema/Organization-inject.html 里的 <script> 标签插入所有页面 <head>

完成后通知我,我用 geo diff 命令验证效果。

详细部署路径见:geo-artifacts/fix-manifest.json

第 4 步:验证部署效果

# 自动对比修复前后(读取 geo fix 时保存的快照)
geo diff https://yoursite.com

输出示例:

📊 GEO Diff 对比:https://yoursite.com
────────────────────────────────────────────────────────
评分:40  →  95  ↑ +55  /100
快照时间:2026/3/12 10:23:00

检测项对比:
  robots.txt    ✓ 良好
  llms.txt      ✓ 已修复 ✨
  AI 爬虫访问   ✓ 已修复 ✨
  Schema 数据   ✓ 已修复 ✨

✓ 已修复 3 项:llms.txt、AI爬虫访问、Schema

🎉 GEO 配置已完善!评分:95/100

第 5 步:生成可分享报告(可选)

geo report https://yoursite.com

生成包含评分、问题清单、工时估算的 Markdown 报告,直接发给团队或客户。


🔄 竞品对比

geo compare https://yoursite.com https://competitor.com

输出示例:

🔄 GEO 竞品对比分析
──────────────────────────────────────────────────────────────────
                    yoursite.com            competitor.com
──────────────────────────────────────────────────────────────────
GEO 总分            40/100  ████░░░░        75/100  ██████░░  👑

robots.txt          ✓ 已存在                ✓ 已存在
llms.txt            ✗ 缺失                  ✓ 已配置           ← 竞品领先
AI 爬虫访问         ✗ 未开放                ✓ 已开放           ← 竞品领先
Schema 数据         ✗ 未检测                ✓ 已配置(3种)    ← 竞品领先

📊 总结
  competitor.com 领先 yoursite.com 35 分(75 vs 40)
  修复后预计得分:96+/100 (超越竞品)

🤖 Agent / 自动化工作流

这个工具专为 Agent 设计。支持两种机器可读模式:

模式 A:geo fix --json(推荐)

geo fix https://yoursite.com --json

直接输出 fix-manifest.json 内容,Agent 读取后即可自动部署:

{
  "url": "https://yoursite.com",
  "score": 40,
  "estimatedScoreAfterFix": 95,
  "outputDir": "./geo-artifacts",
  "files": [
    {
      "localPath": "./geo-artifacts/llms.txt",
      "action": "create",
      "deployPath": "/llms.txt",
      "deployUrl": "https://yoursite.com/llms.txt",
      "priority": "critical"
    },
    {
      "localPath": "./geo-artifacts/schema/Organization-inject.html",
      "action": "inject_head",
      "targetPages": "all",
      "instructions": "将此 <script> 标签插入所有页面的 <head> 中",
      "priority": "high"
    }
  ]
}

模式 B:geo check --json(仅分析,不写文件)

geo check https://yoursite.com --json

返回完整分析结果 + fix 操作列表(含文件内容),Agent 可自行处理。

模式 C:geo diff --json(验证部署结果)

geo diff https://yoursite.com --json
{
  "delta": {
    "scoreDiff": 55,
    "improved": true,
    "checksFixed": ["hasLlmsTxt", "aiCrawlersAllowed", "hasSchema"],
    "checksFailed": []
  }
}

Skill 文件

Agent 可从 npm 包内直接读取使用指南:

node_modules/geo-optimization-cli/skills/geo-optimization-cli/SKILL.md

📁 生成文件说明

geo fix./geo-artifacts/ 下生成:

| 文件 | 说明 | 部署位置 | 优先级 | |------|------|---------|--------| | fix-manifest.json | 完整部署路由表(Agent/开发者专用) | 不需部署 | — | | .geo-snapshot.json | 修复前快照,供 geo diff 对比 | 不需部署 | — | | llms.txt | AI 数据授权声明(含真实站名和 URL) | 上传到网站根目录 | 🔴 关键 | | robots-txt-update.txt | 追加 AI 爬虫访问规则 | 追加到 robots.txt 末尾 | 🔴 关键 | | schema/Organization-inject.html | Organization JSON-LD 标签 | 所有页面 <head> | 🟠 高 | | schema/SoftwareApplication-inject.html | SaaS 产品页 Schema | 产品主页 <head> | 🟠 高 | | schema/Product-inject.html | 商品 Schema(电商) | 商品页 <head> | 🟠 高 | | schema/Article-inject.html | 文章 Schema(内容站) | 文章页 <head> | 🟠 高 | | schema/LocalBusiness-inject.html | 本地商家 Schema | 首页 <head> | 🟠 高 | | implementation-plan.md | 按优先级排好的行动清单 | 发给团队 | — |

v1.10.0 起:生成的 llms.txt 和 Schema 自动填入你的真实站名、URL 和域名邮箱(如 [email protected]),无需手动替换占位符。


评分公式

GEO 评分满分 100,由以下各项累加:

| 项目 | 分值 | 说明 | |------|------|------| | 基础分 | 25 | 所有网站起始基础分 | | llms.txt | +25 | 声明 AI 数据使用权限 | | AI 爬虫可访问 | +20 | robots.txt 允许 GPTBot、ClaudeBot 等 | | Schema 结构化数据 | +15 | JSON-LD 标记(Organization、Product 等) | | robots.txt 存在 | +5 | 明确的爬虫抓取指引 | | sitemap.xml 存在 | +3 | 帮助爬虫高效发现所有页面 | | Open Graph 标签 | +3 | og:title / og:description / og:image,AI 引用展示信息 | | canonical URL | +2 | 防止 AI 引用不同 URL 版本,分散权重 | | 无 noindex 指令 | +2 | 确保 meta robots 或 X-Robots-Tag 未阻止索引 |

注意:若网站没有 robots.txt(HTTP 404),按 HTTP 标准,所有爬虫默认被允许访问,工具已正确处理此情况。


全部命令

| 命令 | 说明 | |------|------| | geo check <url> | 实时检测任意网站 GEO 评分 + 问题 + 修复建议 | | geo fix <url> | 分析 + 生成修复文件包 + 保存快照(Agent 推荐) | | geo diff <url> | 部署后验证:对比修复前后评分(需先运行 geo fix) | | geo compare <url1> <url2> | 并排对比两个网站的 GEO 差距 | | geo report <url> | 生成可分享的 Markdown 报告(含评分、问题、工时估算) | | geo onboarding | 首次使用引导:输入网址 → 分析 → 生成文件 | | geo score <文件> | 解析 GEO 审计报告,显示评分摘要 | | geo generate [文件] | 从审计报告生成优化文件 | | geo generate -t <类型> | 无审计报告,按业务类型直接生成 | | geo deploy [目录] | 将生成的文件复制到网站根目录 | | geo verify | 检查当前目录的 GEO 实现状态 | | geo init | 创建项目配置文件 |

常用参数

| 参数 | 说明 | |------|------| | -t saas / ecommerce / publisher / local / general | 指定业务类型 | | -o ./my-folder | 指定输出目录(默认 ./geo-artifacts) | | --json, -J | Agent 模式:输出机器可读 JSON(含修复内容) | | -s ./snapshot.json | geo diff 指定快照文件路径 | | -f ./report.md | 指定审计报告路径 | | --dry-run | 预览模式,不写入文件 | | -v | 显示版本号 | | -h | 显示帮助 |


开发者 API

import {
  UrlAnalyzer,
  FixBuilder,
  ReportGenerator,
  GeoOptimizer,
  AuditParser,
  SchemaGenerator,
} from 'geo-optimization-cli';

// ── 实时分析任意 URL ──────────────────────────────────────────
const analyzer = new UrlAnalyzer();
const result = await analyzer.analyze('https://yoursite.com');
console.log(result.score);          // 40
console.log(result.hasLlmsTxt);     // false
console.log(result.schemaTypes);    // []
console.log(result.detectedBusinessType); // 'saas'

// ── 生成 Agent-ready 修复包(含真实文件内容)──────────────────
const builder = new FixBuilder();
const pkg = await builder.build(result);
// pkg.fixes[0] = { type: 'create_file', deployPath: '/llms.txt', content: '...', priority: 'critical' }
console.log(JSON.stringify(pkg, null, 2));

// ── 竞品对比修复包 ────────────────────────────────────────────
const r2 = await analyzer.analyze('https://competitor.com');
const cmp = await builder.buildComparison(result, r2, 'mine', 'competitor');

// ── 生成 Markdown 报告 ────────────────────────────────────────
const gen = new ReportGenerator();
const md = gen.generate(result);
await gen.save(md, 'geo-report.md');

// ── 按业务类型生成所有工件(使用真实站点数据)────────────────
const optimizer = new GeoOptimizer({ businessType: 'saas' });
const artifacts = await optimizer.generateArtifacts({
  type: 'saas',
  siteContext: {
    siteName:    'Acme Corp',
    siteUrl:     'https://acme.com',
    description: 'B2B SaaS for project management',
  },
});
await optimizer.saveArtifacts(artifacts, './output');

// ── 生成指定 Schema ────────────────────────────────────────────
const schema = new SchemaGenerator();
const org = schema.organization({ name: 'Acme Corp', url: 'https://acme.com' });
const recommended = schema.recommended('saas'); // ['organization', 'softwareApplication', ...]

常见问题

Q:终端显示 command not found: geo,怎么办?

A:重试安装:npm install -g geo-optimization-cli Mac 权限错误加 sudosudo npm install -g geo-optimization-cli


Q:geo fix 生成的文件里的站名、邮箱怎么来的?

A:v1.10.0 起,工具自动从页面 <title> 提取品牌名(如 "产品页 | Acme Corp""Acme Corp"),联系邮箱从域名推导(如 [email protected])。无需手动替换任何占位符。


Q:geo diff 说没有找到快照怎么办?

A:先运行 geo fix <url> 生成修复文件,同时会在 ./geo-artifacts/.geo-snapshot.json 保存当前快照。部署后再运行 geo diff <url> 即可看到前后对比。


Q:geo fixgeo generate 有什么区别?

A:

  • geo fix <url>在线分析 → 根据实际问题生成精准修复文件 → 保存快照 → 写入 fix-manifest.json
  • geo generate -t <type>:按业务类型生成全套模板文件(不需要先分析 URL)

推荐使用 geo fix,它只生成你真正缺失的文件,避免覆盖已有的正确配置。


Q:这和 SEO 工具有什么区别?

A:传统 SEO 优化 Google 搜索排名,GEO 优化 AI 助手的引用意愿。两者互不冲突,可同时做。


Q:文件上传后多久生效?

A:通常 2-4 周后开始看到 AI 更多引用你的内容。llms.txtrobots.txt 改动最快生效,Schema 数据需等爬虫下次抓取。可用 geo diff <url> 随时验证当前状态。


Q:需要每次更新网站都重新生成吗?

A:不需要。只在公司名/网址变更、产品定位大调整、新增主要功能时更新。日常内容更新不需要重新生成。


系统要求

  • Node.js >= 18(免费下载
  • 零外部依赖,安装即用

问题反馈

遇到问题或有功能建议?在 GitHub Issues 提交,或直接提 PR。

开源协议

MIT © redredchen01