grok-x-search
Skill0 starsChanged 3 months agoMITView on GitHub
Use local Grok Build CLI (headless) or xAI Responses API x_search to fetch live X/Twitter posts, threads, handle timelines, and social sentiment. Use when the user asks about X/Twitter, @handles, recent posts, viral threads, or Grok X search; prefer this over Brave for X-native questions.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- lgldlk/lgldlk-agent-skillstheir own version, first seen Nov 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- lgldlk/lgldlk-agent-skills★ 3same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository66 other files it gives its agents.
- adb-android-app-opsSkill
- agents-sdkSkill
- api-documentationSkill
- atlasSkill
- backend-api-auth-guardrailsSkill
- browser-useSkill
- bundleSkill
- changelogSkill
- chatgpt-appsSkill
- chrome-devtools-testSkill
- chronicleSkill
- cloudflare-deploySkill
- cloudflare-email-serviceSkill
- cloudflare-one-migrationsSkill
- cloudflare-oneSkill
- cloudflareSkill
- computer-useSkill
- create-planSkill
- database-analysisSkill
- database-data-guardrailsSkill
- debug-memory-leakSkill
- deep-initSkill
- deploySkill
- develop-web-gameSkill
- dev-workflowSkill
- docSkill
- durable-objectsSkill
- explainSkill
- figmaSkill
- firmware-feature-writerSkill
- fix-bugSkill
- fix-lintSkill
- frontend-mobile-uiux-designerSkill
- frontend-ui-guardrailsSkill
- gemini-cliSkill
- hermes-chromeSkill
- image-file-readerSkill
- imagegenSkill
- infra-ops-mobile-guardrailsSkill
- layout-reviewSkill
- localizeSkill
- multimodal-lookerSkill
- openai-docsSkill
- optimizeSkill
- parallel-devSkill
- plan-modeSkill
- playwrightSkill
- project-planningSkill
- qa-testerSkill
- refactorSkill
- review-changesSkill
- review-fix-shipSkill
- rust-programmerSkill
- sandbox-sdkSkill
- screenshotSkill
- security-auditSkill
- security-scanSkill
- security-threat-modelSkill
- source-command-collab-startSkill
- turnstile-spinSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 8 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Treat results as time-sensitive social evidence, not ground truth.
- Distinctive: line 24
Do not use for:
- Distinctive: line 45
Never put secrets, tokens, cookies, or private keys in the search query or saved prompt files.
- Distinctive: line 46
Prefer public handles and public topics only.
- Very specific: line 49
Do not claim "official X API firehose" when using Grok CLI web_search path.
- Distinctive: line 53
Use the wrapper (recommended):
- Very specific: line 83
When XAI_API_KEY is set:
- Distinctive: line 105
Write a focused query (topic + time window + language).
- Distinctive: line 106
Prefer the wrapper scripts over ad-hoc prompts.
- Distinctive: line 142
If no posts found, say so.
- Very specific: line 143
If CLI fails with auth, instruct: grok login or set XAI_API_KEY.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Grok X Search
Overview
Fetch live X (Twitter) context for the current agent session using:
- Primary — Grok Build CLI (
~/.grok/bin/grok) headless mode withweb_search(works with your existinggrok login/ OAuth session). - Optional — True X Search via xAI Responses API
x_searchwhenXAI_API_KEYis set (server-side X index; better citations and handle filters).
Treat results as time-sensitive social evidence, not ground truth. Cite URLs. Do not invent posts.
When to Use
- User asks what people are saying on X about a topic, product, model, or company.
- Need recent posts from
@handleor a short list of handles. - Need thread / viral post summary with source links.
- User explicitly asks to use Grok CLI or Grok X search.
Do not use for:
- Library API docs (use Context7).
- General web research unrelated to X (use Brave).
- Private DMs, paywalled, or non-public content.
Prerequisites
| Path | Requirement |
| Grok CLI | ~/.grok/bin/grok on PATH or absolute path; grok login already done (or XAI_API_KEY) |
True x_search | export XAI_API_KEY=... from https://console.x.ai |
Check CLI:
command -v grok || test -x "$HOME/.grok/bin/grok"Safety Rules
- Never put secrets, tokens, cookies, or private keys in the search query or saved prompt files.
- Prefer public handles and public topics only.
- Cap agent turns (
--max-turns); do not allow file writes or shell when only searching. - Label uncertainty: web-indexed X posts may lag the live timeline.
- Do not claim "official X API firehose" when using Grok CLI
web_searchpath.
Quick Start (Grok CLI)
Use the wrapper (recommended):
"$HOME/.agents/skills/grok-x-search/scripts/grok-x-search.sh" "What is @xai posting about this week?"With handle filter (prompt-level; CLI path):
"$HOME/.agents/skills/grok-x-search/scripts/grok-x-search.sh" \
--handles xai,elonmusk \
"Summarize the latest public posts and themes"Manual equivalent:
GROK_BIN="${GROK_BIN:-$HOME/.grok/bin/grok}"
"$GROK_BIN" -p "Search X/Twitter (prefer x.com sources). Query: <QUERY>. Return: bullets with post theme, approximate date, and status URLs. No file edits." \
--always-approve \
--max-turns 10 \
--no-memory \
--no-plan \
--no-subagents \
--disallowed-tools "run_terminal_cmd,search_replace,write_file,edit_file,Agent" \
--output-format plainTrue X Search (xAI API, optional)
When XAI_API_KEY is set:
"$HOME/.agents/skills/grok-x-search/scripts/xai-x-search.py" "What are people saying about OpenCode on X?"
"$HOME/.agents/skills/grok-x-search/scripts/xai-x-search.py" --handles elonmusk,xai "Latest product announcements"
"$HOME/.agents/skills/grok-x-search/scripts/xai-x-search.py" --from-date 2026-07-01 --to-date 2026-07-15 "Grok 4.5 reactions"This calls POST https://api.x.ai/v1/responses with tools: [{ "type": "x_search", ... }].
Workflow for the Agent
1. Pick path
| Situation | Path |
| Default / user has Grok login only | grok-x-search.sh (Grok CLI) |
| Need handle allow/exclude + date range + stronger X grounding | xai-x-search.py if XAI_API_KEY present |
| No Grok CLI and no API key | Tell user to grok login or set XAI_API_KEY; do not fake results |
2. Run search
- Write a focused query (topic + time window + language).
- Prefer the wrapper scripts over ad-hoc prompts.
- Timeout: allow up to 3 minutes for CLI path.
3. Present results
Always return:
- Short answer (繁體中文 unless user asks otherwise)
- Bullet findings with source URLs (
https://x.com/...) - Path used:
grok-clivsxai-x_search - Limits / freshness caveats
4. Do not
- Edit repo files as part of a search.
- Chain into unrelated coding work unless the user asked.
- Dump full raw JSON to the user unless they want debug output.
Output Template
## X 搜尋結果
- **路徑**: grok-cli | xai-x_search
- **查詢**: ...
### 重點
- ...
- ...
### 來源
- https://x.com/...Verification
- At least one
x.com/twitter.comURL when claims are specific. - If no posts found, say so; do not invent.
- If CLI fails with auth, instruct:
grok loginor setXAI_API_KEY.
Common Mistakes
- Using Brave only for X questions when this skill is available.
- Letting Grok CLI edit files during a pure search (
--disallowed-toolsrequired). - Confusing Grok model inside OpenCode with Grok CLI tools (OpenCode model ≠ automatic X access).
- Expecting private or deleted posts.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

