← 返回
AI智能 Key

grok-search

Search the web or X/Twitter using xAI Grok server-side tools (web_search, x_search) via the xAI Responses API. Use when you need tweets/threads/users from X, want Grok as an alternative to Brave, or you need structured JSON + citations.
通过 xAI Responses API,使用 xAI Grok 服务器端工具(web_search、x_search)在网页或 X/Twitter 上搜索。适用于需要 X 的推文/话题/用户,或想用 Grok 替代 Brave,或需要结构化 JSON 与引用。
notabhay
AI智能 clawhub v0.2.1 1 版本 99236.2 Key: 需要
★ 8
Stars
📥 7,376
下载
💾 1,674
安装
1
版本
#latest

概述

Run xAI Grok locally via bundled scripts (search + chat + model listing). Default output for search is pretty JSON (agent-friendly) with citations.

API key

The script looks for an xAI API key in this order:

  • XAI_API_KEY env var
  • ~/.clawdbot/clawdbot.jsonenv.XAI_API_KEY
  • ~/.clawdbot/clawdbot.jsonskills.entries["grok-search"].apiKey
  • fallback: skills.entries["search-x"].apiKey or skills.entries.xai.apiKey

Run

Use {baseDir} so the command works regardless of workspace layout.

Search

  • Web search (JSON):
  • node {baseDir}/scripts/grok_search.mjs "" --web
  • X/Twitter search (JSON):
  • node {baseDir}/scripts/grok_search.mjs "" --x

Chat

  • Chat (text):
  • node {baseDir}/scripts/chat.mjs ""
  • Chat (vision):
  • node {baseDir}/scripts/chat.mjs --image /path/to/image.jpg ""

Models

  • List models:
  • node {baseDir}/scripts/models.mjs

Useful flags

Output:

  • --links-only print just citation URLs
  • --text hide the citations section in pretty output
  • --raw include the raw Responses API payload on stderr (debug)

Common:

  • --max limit results (default 8)
  • --model (default grok-4-1-fast)

X-only filters (server-side via x_search tool params):

  • --days (e.g. 7)
  • --from YYYY-MM-DD / --to YYYY-MM-DD
  • --handles @a,@b (limit to these handles)
  • --exclude @bots,@spam (exclude handles)

Output shape (JSON)

{
  "query": "...",
  "mode": "web" | "x",
  "results": [
    {
      "title": "...",
      "url": "...",
      "snippet": "...",
      "author": "...",
      "posted_at": "..."
    }
  ],
  "citations": ["https://..."]
}

Notes

  • citations are merged/validated from xAI response annotations where possible (more reliable than trusting the model’s JSON blindly).
  • Prefer --x for tweets/threads, --web for general research.

版本历史

共 1 个版本

  • v0.2.1 当前
    2026-03-28 09:54 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,349 📥 317,700
ai-intelligence

Proactive Agent

halthelobster
将AI智能体从任务执行者升级为主动预判需求、持续优化的智能伙伴。集成WAL协议、工作缓冲区、自主定时任务及实战验证模式。Hal Stack核心组件 🦞
★ 833 📥 212,782
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,055 📥 795,999