简介
通过 xAI API 对话 Grok-3 系列模型,支持实时 X/Twitter 搜索与图像分析,需自行配置 API 密钥使用。
原始描述
Chat with Grok models via xAI API. Supports Grok-3, Grok-3-mini, vision, and more.
通过你的 Agent 添加
安装目录:xai/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心功能
xAI Skill 提供与 xAI 旗下 Grok 模型的对话能力,核心功能包括:
- 文本对话:调用
grok-3、grok-3-mini、grok-3-fast等模型进行通用问答 - 视觉理解:支持本地图片上传(jpg/png/gif/webp),进行图像内容分析
- 实时搜索:通过 xAI Responses API 的
x_search工具,实时检索 X/Twitter 平台内容并附带引用来源
显著优点
1. 极简安全架构
- 零第三方 npm 依赖,仅使用 Node.js 内置模块(https/fs/path),彻底规避供应链攻击风险
- 代码仅约 550 行,结构清晰,行为透明
2. 严格的输入验证
- 图片上传采用扩展名白名单机制(.jpg/.jpeg/.png/.gif/.webp)
- 使用
path.resolve解析绝对路径,有效防御路径遍历攻击 - 仅读取用户显式指定的图片文件,无任意文件访问能力
3. 官方 API 直连
- 所有通信均通过 HTTPS 与 xAI 官方端点(api.x.ai)加密传输
- 支持 TLS 1.2+,无中间人攻击风险
4. 独特社交数据优势
- Grok 原生集成 X 平台实时数据,在时效性信息查询上具有差异化竞争力
潜在局限
- 平台锁定:完全依赖 xAI 官方服务,模型选择受限
- 成本因素:xAI API 按 token 计费,高频使用需关注费用
- 功能边界:不支持本地模型部署,必须联网使用
- 无对话持久化:不存储历史记录,每次对话独立进行
适合人群
- 需要 AI 辅助写作、编程、分析的普通用户
- 依赖 X/Twitter 实时信息的研究者、媒体人、市场分析师
- 对供应链安全敏感、希望审查代码的技术用户
- 已持有 xAI API Key 的开发者
常规风险提示
- API Key 安全:需通过环境变量
XAI_API_KEY 配置,避免硬编码或共享环境泄露
- 数据出境:对话内容和图片将传输至 xAI 美国服务器,涉及跨境数据流动
- 内容合规:X 平台实时搜索结果可能包含未经审核的用户生成内容
- 建议操作:首次使用前审查脚本代码,定期轮换 API Key
- 需要 AI 辅助写作、编程、分析的普通用户
- 依赖 X/Twitter 实时信息的研究者、媒体人、市场分析师
- 对供应链安全敏感、希望审查代码的技术用户
- 已持有 xAI API Key 的开发者
常规风险提示
- API Key 安全:需通过环境变量
XAI_API_KEY 配置,避免硬编码或共享环境泄露
- 数据出境:对话内容和图片将传输至 xAI 美国服务器,涉及跨境数据流动
- 内容合规:X 平台实时搜索结果可能包含未经审核的用户生成内容
- 建议操作:首次使用前审查脚本代码,定期轮换 API Key
XAI_API_KEY 配置,避免硬编码或共享环境泄露技能正文
name: xai description: Chat with Grok models via xAI API. Supports Grok-3, Grok-3-mini, vision, and more. homepage: https://docs.x.ai user-invocable: true disable-model-invocation: true triggers:
- grok
- xai
- ask grok metadata: clawdbot: emoji: "🤖" primaryEnv: XAI_API_KEY requires: bins: [node] env: [XAI_API_KEY]
xAI / Grok
Chat with xAI's Grok models. Supports text and vision.
Setup
INSTALLATION AND USE INSTRUCTIONS
export XAI_API_KEY="xai-YOUR-KEY"
Get your API key at: https://console.x.ai
Commands
Chat with Grok
node {baseDir}/scripts/chat.js "What is the meaning of life?"
Use a specific model
node {baseDir}/scripts/chat.js --model grok-3-mini "Quick question: 2+2?"
Vision (analyze images)
node {baseDir}/scripts/chat.js --image /path/to/image.jpg "What's in this image?"
🔍 Search X/Twitter (Real-time!)
node {baseDir}/scripts/search-x.js "Remotion video framework"
node {baseDir}/scripts/search-x.js --days 7 "Claude AI tips"
node {baseDir}/scripts/search-x.js --handles @remotion_dev "updates"
node {baseDir}/scripts/chat.js --model grok-3-mini "Quick question: 2+2?"
node {baseDir}/scripts/chat.js --image /path/to/image.jpg "What's in this image?"
🔍 Search X/Twitter (Real-time!)
node {baseDir}/scripts/search-x.js "Remotion video framework"
node {baseDir}/scripts/search-x.js --days 7 "Claude AI tips"
node {baseDir}/scripts/search-x.js --handles @remotion_dev "updates"
node {baseDir}/scripts/search-x.js "Remotion video framework"
node {baseDir}/scripts/search-x.js --days 7 "Claude AI tips"
node {baseDir}/scripts/search-x.js --handles @remotion_dev "updates"
Uses xAI Responses API with x_search tool for real X posts with citations.
List available models
node {baseDir}/scripts/models.js
Available Models
grok-3 - Most capable, best for complex tasks
grok-3-mini - Fast and efficient
grok-3-fast - Optimized for speed
grok-2-vision-1212 - Vision model for image understanding
Example Usage
node {baseDir}/scripts/models.js
grok-3- Most capable, best for complex tasksgrok-3-mini- Fast and efficientgrok-3-fast- Optimized for speedgrok-2-vision-1212- Vision model for image understanding
Example Usage
User: "Ask Grok what it thinks about AI safety" Action: Run chat.js with the prompt
User: "Use Grok to analyze this image" (with attached image) Action: Run chat.js with --image flag
User: "What Grok models are available?" Action: Run models.js
API Reference
xAI API Docs: https://docs.x.ai/api
Environment Variables
XAI_API_KEY - Your xAI API key (required)
XAI_MODEL - Default model (optional, defaults to grok-3)
Security & Permissions
XAI_API_KEY - Your xAI API key (required)XAI_MODEL - Default model (optional, defaults to grok-3)What this skill does:
- Sends chat prompts to xAI's API at
api.x.ai - Vision mode sends images to xAI for analysis
scripts/models.jslists available models (read-only)
What this skill does NOT do:
- Does not read arbitrary local files —
--imageonly accepts files with image extensions (.jpg,.jpeg,.png,.gif,.webp) - Does not read config files or access the filesystem beyond the specified image path
- Does not store conversation history or logs
- Does not send credentials to any endpoint other than
api.x.ai - Cannot be invoked autonomously by the agent (
disable-model-invocation: true)
Bundled scripts: scripts/chat.js (chat), scripts/models.js (list models), scripts/search-x.js (X search)
Review scripts before first use to verify behavior.
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。