grok-search

👤 notabhay 📦 v0.2.1 ⭐ 4.3 ⬇️ 7.8K 下載
📊 資料分析 免費 🔑 需 API Key

📖 技能介紹

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.json → env.XAI_API_KEY
  • ~/.clawdbot/clawdbot.json → skills.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 "<query>" --web
  • X/Twitter search (JSON):

    • node {baseDir}/scripts/grok_search.mjs "<query>" --x

Chat

  • Chat (text):

    • node {baseDir}/scripts/chat.mjs "<prompt>"

      小蔥技能7w4.net有更新,你可以訪問看下。

  • Chat (vision):

    • node {baseDir}/scripts/chat.mjs --image /path/to/image.jpg "<prompt>"

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 <n> limit results (default 8)
  • --model <id> (default grok-4-1-fast)

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

  • --days <n> (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.

🤖 AI 評測

這個 Skill 質量中上,文件寫得很清楚,功能也很實用——能搜網頁也能搜 Twitter,還能聊天和看模型列表。輸出格式整齊,會自動整理引用連結。不足的是沒有處理網路異常或 API 限速的情況,偶爾會卡住或報錯。另外三個指令碼有些功能重複,程式碼可以更簡潔一些。普通使用者用起來基本沒問題,但穩定性還有提升空間。

📊 多維度評分

適應性4.3
規範性3.9
有效性4.6
可靠性4.4
可信度4.3

📁 包含檔案 (7 個)

📄 SKILL.md 2.4 KB
📄 _meta.json 130 B
📄 references/xai-tools-links.md 260 B
📄 scripts/chat.mjs 4.5 KB
📄 scripts/grok_search.mjs 12.3 KB
📄 scripts/models.mjs 2.4 KB
📄 scripts/selftest.mjs 5.3 KB