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

google-ai-search

v1.0.2

Published

Google AI Mode search CLI via OpenCLI Browser Bridge

Readme

google-ai-search

Google AI Mode 搜索 CLI,通过 OpenCLI Browser Bridge 调用。

安装

npm install -g [email protected]

前置要求

  • Node.js >= 20
  • OpenCLI 已安装 (npm install -g @jackwener/opencli)
  • Chrome 浏览器已安装 OpenCLI 扩展并登录 Google 账号
  • 运行 opencli doctor 验证配置

命令

1. 单次搜索 (googleAISearch)

googleAISearch "<搜索内容>" [选项]

选项:

  • --json - 输出完整 JSON 格式
  • --plain - 纯文本输出
  • -p, --profile <name> - 浏览器会话名 (默认: work)
  • -t, --timeout <sec> - 超时秒数 (默认: 60)
  • -o, --output <fmt> - 输出格式: json, plain, pretty (默认: pretty)

示例:

googleAISearch "什么是人工智能"
googleAISearch "AI最新新闻" --json
googleAISearch "机器学习" -p default

2. 多轮对话 (googleAIChat)

googleAIChat <子命令> [选项]

子命令:

  • new - 创建新会话
  • list - 列出所有会话
  • ask <问题> - 在会话中提问
  • clear <session-id> - 删除会话

示例:

googleAIChat new           # 创建新会话
googleAIChat list         # 列出所有会话
googleAIChat ask "解释深度学习" -s <session-id>  # 提问
googleAIChat clear <session-id>  # 删除会话

3. 批量搜索 (googleAIBatch)

googleAIBatch <子命令> [查询...]

子命令:

  • search <queries...> - 批量搜索(自动缓存1小时)
  • compare <queries...> - 对比多个查询结果
  • clear-cache - 清除搜索缓存

示例:

googleAIBatch search "AI新闻" "机器学习" "深度学习"
googleAIBatch compare "Python vs Java" "Python vs JavaScript"
googleAIBatch clear-cache

4. 流式输出 (googleAIStream)

googleAIStream "<搜索内容>" [选项]

选项:

  • -p, --profile <name> - 浏览器会话名
  • -t, --timeout <sec> - 超时秒数
  • -d, --delay <ms> - 流式输出延迟

示例:

googleAIStream "什么是神经网络"

输出格式

JSON 格式

{
  "ok": true,
  "query": "搜索内容",
  "url": "https://www.google.com/search?...",
  "answer": "AI 生成的答案",
  "sources": [
    {"title": "标题", "url": "链接"},
    ...
  ],
  "meta": {
    "profile": "work",
    "elapsed_ms": 7322,
    "page_title": "页面标题"
  }
}

美化输出 (默认)

🤖 AI Answer:
[AI 生成的答案]

📚 Sources:
  1. 标题1
     链接1
  2. 标题2
     链接2

⏱ 7322ms | https://...

缓存

批量搜索默认启用缓存,缓存目录:

  • Windows: %USERPROFILE%\.google-ai-search\cache
  • macOS/Linux: ~/.google-ai-search/cache

缓存有效期: 1小时

使用 --no-cache 禁用缓存(批量搜索命令)。

会话存储

多轮对话会话存储在:

  • Windows: %APPDATA%\conf\google-ai-search
  • 其他: ~/.config/conf/google-ai-search

Claude Code / Codex 集成

Skill 文件已包含在包中:

  • 全局: ~/.claude/skills/google-ai-search/
  • 项目级: ./.claude/skills/google-ai-search/

Claude Code 可通过自然语言调用:

  • "搜索一下 XXX"
  • "用 Google AI 查找 XXX"
  • "批量搜索这几个关键词"

常见问题

Q: 命令报错 "ETIMEDOUT"

A: 网络超时,请检查 OpenCLI 连接和 Chrome 浏览器状态。

Q: 命令报错 "opencli not found"

A: 未安装 OpenCLI,请运行 npm install -g @jackwener/opencli

Q: 如何验证 OpenCLI 配置?

A: 运行 opencli doctor 检查配置。

License

ISC