Index of every page on this site: llms.txt
All skills
carson2222 avatar

/grok-cli

@c29af03
by carsoncarson2222/skills111 stars
4
Run it yourself

Run Grok CLI headless for real-time X/Twitter and news research. Use when the user says "use grok", "ask grok", "dig into twitter/x", "latest on...", or when fresh data past the training cutoff is needed.

Use this Skill: https://skilld.dev/gh/carson2222/skills/grok-cli

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈54 tokens for metadata: the name and description. ≈933 when used: this file.

Description uses 2.7% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈215 characters, or 2.7%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

grok-cli — fresh info via the Grok CLI

grok is xAI's installed CLI (~/.grok/bin/grok, already authenticated). Use it as a sub-agent to fetch real-time info: X/Twitter chatter and news beyond this model's knowledge. It is slow but live.

Do this immediately

When this skill triggers, run the command right away. Do not run --help, --version, which grok, or any discovery — it works, the recipe below is verified.

The one command (copy, fill the prompt)

grok -p "<your question>" -m grok-build --yolo --max-turns 8 --disallowed-tools web_fetch --output-format json | jq -r '.text'

That is the whole interface. Only the <your question> changes.

  • -m grok-build uses the Grok model (not the composer model).
  • --yolo auto-approves grok's tools (required headless, or it hangs).
  • --disallowed-tools web_fetch forces grok onto web_search (xAI live search). This is the key fix: with web_fetch enabled grok loops on X/news URLs and never returns.
  • --max-turns 8 caps it so it can't loop forever.
  • jq -r '.text' returns just the answer. Drop | jq ... if jq is missing and read the JSON text field yourself.

Timing (important)

A live search takes ~1–3 minutes. Set the Bash timeout to 300000 ms (5 min) and wait. Do not assume it failed. If you may keep working meanwhile, run it in the background and poll later.

Prompt templates

Dig deep into X/Twitter — be explicit, ask for specifics:

grok -p "Search X/Twitter for the latest discussion about <TOPIC> (last 24-72h). Surface 5-8 specific posts: @handle, a one-line summary, and the post URL. Quote standout lines. Then give prevailing sentiment, the most influential accounts driving it, and any emerging angle. Be specific, no filler." \
  -m grok-build --yolo --max-turns 10 --disallowed-tools web_fetch --output-format json | jq -r '.text'

News / live web research:

grok -p "What's the latest on <TOPIC> as of this week? Give 3-5 key developments, each one line with a source link, then a 2-sentence takeaway." \
  -m grok-build --yolo --max-turns 8 --disallowed-tools web_fetch --output-format json | jq -r '.text'

Good prompting

  • Ask for concrete output: handles, URLs, quotes, dates, sentiment — not vague summaries.
  • State the time window ("last 48h", "this week").
  • One focused question per call. For a different angle, make a second call.
  • Keep <your question> as a single double-quoted string; escape inner quotes or use single quotes inside.

Follow-ups (same grok session)

Capture the session id, then continue for cheaper, context-aware follow-ups:

SID=$(grok -p "<first question>" -m grok-build --yolo --max-turns 8 --disallowed-tools web_fetch --output-format json | jq -r '.sessionId')
grok -p "<follow-up>" --resume "$SID" -m grok-build --yolo --max-turns 8 --disallowed-tools web_fetch --output-format json | jq -r '.text'

After you get results

Treat grok's output as a fresh source: summarize it for the user and keep the source links/@handles so they can verify. Note it's live data (may be noisy or unverified). If it returns empty or errors, retry once with a tighter prompt or a longer timeout before giving up.

Notes

  • This skill uses -m grok-build (the Grok model). grok-composer-2.5-fast is the CLI default but the composer model is not what we want here.
  • For richer general web research (not X-specific), prefer the existing Exa tooling per global rules; reach for grok when you specifically want X/Twitter or want xAI's live take.
  • Requires the grok CLI installed and authenticated (curl -fsSL https://x.ai/cli/install.sh | bash, then grok login) and jq on PATH.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alert5mo3 checks · Risk SAFE
  • Gen Agent Trust Hub5mo

    This skill provides instructions for using the Grok CLI tool from xAI for real-time research. It includes commands for searching X/Twitter and general news, along with best practices for handling long-running search tasks. It references the official xAI installation script.

  • Socket5mo

    No alerts

  • Snyk5mo

    Risk: CRITICAL · 2 issues

Signed by skilld at c29af03. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 5 months ago

README badge

README badge for carson2222/skills/grok-cli