Skip to content
Back to search

grok-skill

Codex skill: aggressive web research via OpenAI-compatible Grok endpoint (2api)

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/frankieli123--grok-skill/badge.svg)](/listings/frankieli123--grok-skill)

HTML

<a href="/listings/frankieli123--grok-skill"><img src="/api/listings/frankieli123--grok-skill/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Method 1: Git Clone (Recommended)

# Clone the repository
git clone https://github.com/Frankieli123/grok-skill.git

# Enter the directory
cd grok-skill

# Run the install script (Windows PowerShell)
powershell -ExecutionPolicy Bypass -File .\install.ps1

Method 2: Manual Download

1. Download ZIP from: https://github.com/Frankieli123/grok-skill/archive/refs/heads/main.zip 2. Extract to any folder 3. Run `install.ps1` in PowerShell

Installation Path

After installation, the skill will be located at:

C:\Users\<YourUsername>\.codex\skills\grok-search\

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 57 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ---
  2. name: grok-search
  3. description: Real-time web research/search with sources (outputs JSON).
  4. ---
  5. ## When to use (aggressive)
  6. - Default to using this skill before answering anything that might be outdated, ambiguous, or requires external confirmation (APIs, versions, errors, docs, releases).
  7. - If you feel even slightly unsure, search first, then answer with evidence.
  8. ## Quick start
  9. ### Configure (recommended)
  10. Run once to write config:
  11. ```powershell
  12. powershell -ExecutionPolicy Bypass -File "$env:USERPROFILE\.codex\skills\grok-search\configure.ps1"
  13. ```
  14. Default config path (recommended): `C:\Users\<you>\.codex\skills\grok-search\config.json` (override with `--config` or `GROK_CONFIG_PATH`).
  15. Write to user-level config instead (optional):
  16. ```powershell
  17. powershell -ExecutionPolicy Bypass -File "$env:USERPROFILE\.codex\skills\grok-search\configure.ps1" -Global
  18. ```
  19. ### Configure (env vars)
  20. If you prefer env vars:
  21. ```powershell
  22. $env:GROK_BASE_URL="https://your-grok-endpoint.example"
  23. $env:GROK_API_KEY="YOUR_API_KEY"
  24. $env:GROK_MODEL="grok-2-latest"
  25. ```
  26. ### Run
  27. ```bash
  28. python scripts/grok_search.py --query "What changed in X recently?"
  29. ```
  30. ## Output
  31. Prints JSON to stdout:
  32. - `content`: the synthesized answer
  33. - `sources`: best-effort list of URLs (and optional titles/snippets)
  34. - `raw`: raw assistant content (if parsing failed)
  35. ## Notes
  36. - Endpoint: `POST {GROK_BASE_URL}/v1/chat/completions` (also supports `{GROK_BASE_URL}/chat/completions` if you set `GROK_BASE_URL` ending with `/v1`).
  37. - You can override model via `--model` or `GROK_MODEL`.
  38. - If your 2api requires custom flags to enable web search, pass them via `--extra-body-json` / `GROK_EXTRA_BODY_JSON`.
README.md · README · 323 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # grok-search
  2. **[English](#english)** | **[中文](#中文)**
  3. ---
  4. <a name="english"></a>
  5. ## 🌐 English
  6. A Codex/Claude skill that enables aggressive web research via your OpenAI-compatible Grok endpoint (2api). Perfect for real-time information queries, version checking, and documentation lookup.
  7. ### ✨ Features
  8. - 🔍 Real-time web search through Grok API
  9. - 📋 Structured JSON output with `content` + `sources`
  10. - 🔐 Secure config with local override support
  11. - 🌍 Environment variable configuration
  12. - ⚡ Easy one-click installation
  13. ### 📦 Installation
  14. #### Method 1: Git Clone (Recommended)
  15. ```bash
  16. # Clone the repository
  17. git clone https://github.com/Frankieli123/grok-skill.git
  18. # Enter the directory
  19. cd grok-skill
  20. # Run the install script (Windows PowerShell)
  21. powershell -ExecutionPolicy Bypass -File .\install.ps1
  22. ```
  23. #### Method 2: Manual Download
  24. 1. Download ZIP from: https://github.com/Frankieli123/grok-skill/archive/refs/heads/main.zip
  25. 2. Extract to any folder
  26. 3. Run `install.ps1` in PowerShell
  27. #### Installation Path
  28. After installation, the skill will be located at:
  29. ```
  30. C:\Users\<YourUsername>\.codex\skills\grok-search\
  31. ```
  32. ### ⚙️ Configuration
  33. #### Option A: Interactive Configuration (Recommended)
  34. ```powershell
  35. powershell -ExecutionPolicy Bypass -File "$env:USERPROFILE\.codex\skills\grok-search\configure.ps1"
  36. ```
  37. #### Option B: Manual Edit
  38. Edit the config file at:
  39. ```
  40. C:\Users\<YourUsername>\.codex\skills\grok-search\config.json
  41. ```
  42. ```json
  43. {
  44. "base_url": "https://your-grok-endpoint.example",
  45. "api_key": "YOUR_API_KEY",
  46. "model": "grok-2-latest",
  47. "timeout_seconds": 60,
  48. "extra_body": {},
  49. "extra_headers": {}
  50. }
  51. ```
  52. | Field | Description |
  53. |-------|-------------|
  54. | `base_url` | Your Grok API endpoint URL |
  55. | `api_key` | Your API key (**DO NOT commit to Git**) |
  56. | `model` | Model name (e.g., `grok-2-latest`) |
  57. | `timeout_seconds` | Request timeout in seconds |
  58. | `extra_body` | Additional request body parameters |
  59. | `extra_headers` | Additional HTTP headers |
  60. #### Option C: Environment Variables
  61. ```powershell
  62. $env:GROK_BASE_URL="https://your-grok-endpoint.example"
  63. $env:GROK_API_KEY="YOUR_API_KEY"
  64. $env:GROK_MODEL="grok-2-latest"
  65. ```
  66. #### 🔒 Secure API Key Storage
  67. For security, create `config.local.json` in the same directory (gitignored):
  68. ```json
  69. {
  70. "api_key": "your-real-api-key-here"
  71. }
  72. ```
  73. ### 🚀 Usage
  74. #### Direct Command Line
  75. ```bash
  76. python scripts/grok_search.py --query "What is the latest version of Node.js?"
  77. ```
  78. #### Output Format
  79. ```json
  80. {
  81. "content": "The synthesized answer...",
  82. "sources": [
  83. {"url": "https://example.com", "title": "Source Title"}
  84. ]
  85. }
  86. ```
  87. ### 🤖 Enable Auto-Invocation in Codex/Claude
  88. Add the following prompt to your global agent configuration:
  89. **File:** `C:\Users\<YourUsername>\.codex\AGENTS.md` or `~/.claude/CLAUDE.md`
  90. ```markdown
  91. ## Web Search Rule
  92. When encountering any of the following situations, ALWAYS use the `grok-search` skill first before providing an answer:
  93. 1. Version numbers, release dates, or changelog information
  94. 2. API documentation or SDK usage
  95. 3. Error messages or troubleshooting
  96. 4. Current status of any project, service, or technology
  97. 5. Any information that might be time-sensitive or outdated
  98. 6. Package installation commands or dependencies
  99. 7. Official documentation links
  100. Usage example:
  101. ​```bash
  102. python ~/.codex/skills/grok-search/scripts/grok_search.py --query "Your search query here"
  103. ​```
  104. After receiving search results, cite the sources in your response.
  105. ```
  106. ### 📁 Project Structure
  107. ```
  108. grok-search/
  109. ├── SKILL.md # Skill definition for Codex/Claude
  110. ├── README.md # This file
  111. ├── config.json # Configuration template
  112. ├── install.ps1 # Installation script
  113. ├── configure.ps1 # Interactive configuration script
  114. └── scripts/
  115. └── grok_search.py # Main search script
  116. ```
  117. ---
  118. <a name="中文"></a>
  119. ## 🌐 中文
  120. 一个 Codex/Claude 技能插件,通过你的 OpenAI 兼容 Grok 接口(2api)实现激进的联网检索。适用于实时信息查询、版本检查和文档查找。
  121. ### ✨ 功能特性
  122. - 🔍 通过 Grok API 进行实时网络搜索
  123. - 📋 结构化 JSON 输出,包含 `content` + `sources`
  124. - 🔐 安全配置,支持本地覆盖
  125. - 🌍 支持环境变量配置
  126. - ⚡ 一键安装
  127. ### 📦 安装方法
  128. #### 方法一:Git 克隆(推荐)
  129. ```bash
  130. # 克隆仓库
  131. git clone https://github.com/Frankieli123/grok-skill.git
  132. # 进入目录
  133. cd grok-skill
  134. # 运行安装脚本(Windows PowerShell)
  135. powershell -ExecutionPolicy Bypass -File .\install.ps1
  136. ```
  137. #### 方法二:手动下载
  138. 1. 从这里下载 ZIP:https://github.com/Frankieli123/grok-skill/archive/refs/heads/main.zip
  139. 2. 解压到任意文件夹
  140. 3. 在 PowerShell 中运行 `install.ps1`
  141. #### 安装路径
  142. 安装完成后,技能将位于:
  143. ```
  144. C:\Users\<你的用户名>\.codex\skills\grok-search\
  145. ```
  146. ### ⚙️ 配置说明
  147. #### 方式 A:交互式配置(推荐)
  148. ```powershell
  149. powershell -ExecutionPolicy Bypass -File "$env:USERPROFILE\.codex\skills\grok-search\configure.ps1"
  150. ```
  151. #### 方式 B:手动编辑
  152. 编辑配置文件:
  153. ```
  154. C:\Users\<你的用户名>\.codex\skills\grok-search\config.json
  155. ```
  156. ```json
  157. {
  158. "base_url": "https://your-grok-endpoint.example",
  159. "api_key": "YOUR_API_KEY",
  160. "model": "grok-2-latest",
  161. "timeout_seconds": 60,
  162. "extra_body": {},
  163. "extra_headers": {}
  164. }
  165. ```
  166. | 字段 | 说明 |
  167. |------|------|
  168. | `base_url` | 你的 Grok API 端点地址 |
  169. | `api_key` | 你的 API 密钥(**不要提交到 Git**) |
  170. | `model` | 模型名称(如 `grok-2-latest`) |
  171. | `timeout_seconds` | 请求超时时间(秒) |
  172. | `extra_body` | 额外的请求体参数 |
  173. | `extra_headers` | 额外的 HTTP 请求头 |
  174. #### 方式 C:环境变量
  175. ```powershell
  176. $env:GROK_BASE_URL="https://your-grok-endpoint.example"
  177. $env:GROK_API_KEY="YOUR_API_KEY"
  178. $env:GROK_MODEL="grok-2-latest"
  179. ```
  180. #### 🔒 安全存储 API 密钥
  181. 为了安全,在同目录下创建 `config.local.json`(已加入 .gitignore):
  182. ```json
  183. {
  184. "api_key": "你的真实API密钥"
  185. }
  186. ```
  187. ### 🚀 使用方法
  188. #### 直接命令行调用
  189. ```bash
  190. python scripts/grok_search.py --query "Node.js 最新版本是什么?"
  191. ```
  192. #### 输出格式
  193. ```json
  194. {
  195. "content": "综合后的答案...",
  196. "sources": [
  197. {"url": "https://example.com", "title": "来源标题"}
  198. ]
  199. }
  200. ```
  201. ### 🤖 在 Codex/Claude 中启用自动调用
  202. 将以下提示词添加到你的全局 Agent 配置中:
  203. **文件位置:** `C:\Users\<你的用户名>\.codex\AGENTS.md` 或 `~/.claude/CLAUDE.md`
  204. ```markdown
  205. ## 联网搜索规则
  206. 遇到以下任何情况时,必须先使用 `grok-search` 技能进行搜索,然后再回答:
  207. 1. 版本号、发布日期或更新日志信息
  208. 2. API 文档或 SDK 使用方法
  209. 3. 错误信息或故障排除
  210. 4. 任何项目、服务或技术的当前状态
  211. 5. 任何可能过时或时效性强的信息
  212. 6. 包安装命令或依赖项
  213. 7. 官方文档链接
  214. 使用示例:
  215. ​```bash
  216. python ~/.codex/skills/grok-search/scripts/grok_search.py --query "你的搜索查询"
  217. ​```
  218. 收到搜索结果后,在回答中引用来源。
  219. ```
  220. ### 📁 项目结构
  221. ```
  222. grok-search/
  223. ├── SKILL.md # Codex/Claude 技能定义文件
  224. ├── README.md # 本文件
  225. ├── config.json # 配置模板
  226. ├── install.ps1 # 安装脚本
  227. ├── configure.ps1 # 交互式配置脚本
  228. └── scripts/
  229. └── grok_search.py # 主搜索脚本
  230. ```
  231. ---
  232. ## 📄 License
  233. MIT License
  234. ## 🤝 Contributing
  235. Issues and PRs are welcome!

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.