Stats
Links
Categories
CLI tool for searching and browsing X (Twitter) content via xAI API
npx claudepluginhub tani-shi/xai-clixai CLI skill for Claude Code
CLI tool for searching and browsing X (Twitter) content via xAI API.
uv tool install .
Or run directly:
uv run xai --help
Set your xAI API key:
# Option 1: Environment variable
export XAI_API_KEY="xai-xxx"
# Option 2: Interactive setup
xai config init
# Option 3: Direct config
xai config set api_key "xai-xxx"
xai search "Rust programming"
xai search "OpenAI" --from 2025-12-01 --to 2026-01-31
xai search "AI news" --from-user @elonmusk --from-user @OpenAI
xai search "AI" --exclude @spam_bot
xai search "infographic" --images
xai search "Bitcoin" --format json
xai search "topic" --no-stream
xai user @elonmusk
xai user @elonmusk --from 2026-01-01
xai user @elonmusk "about SpaceX"
xai thread https://x.com/user/status/123456789
xai thread https://x.com/user/status/123456789 --summary
xai trending
xai trending --category tech
xai trending "topic name"
xai web "latest Python release"
xai web "AI research" --domain arxiv.org --domain openai.com
xai web "news" --exclude-domain reddit.com
xai config init # Interactive setup
xai config set default_model grok-4-1-fast # Change model
xai config get default_model # Get a value
xai config list # Show all settings
xai models
xai models --format json
--format json) -- Full API response as JSON, suitable for piping to jq--format markdown) -- Rich Markdown rendering# Pipe JSON to jq
xai search "AI" --format json | jq '.output'
# Save to file
xai search "Rust" > results.txt
Stored at ~/.config/xai/config.toml:
[auth]
api_key = "xai-xxx"
[defaults]
model = "grok-4-1-fast-non-reasoning"
stream = true
format = "text"
[search]
enable_image_understanding = false
enable_video_understanding = false
XAI_API_KEY, XAI_DEFAULT_MODEL)This repository is also a Claude Code plugin that provides the xai skill.
claude plugin marketplace add tani-shi/xai-cli
claude plugin install xai-cli@xai-cli
The skill enables Claude Code to use xai commands for searching X posts, browsing user timelines, retrieving threads, discovering trending topics, and performing web searches.
uv sync
uv run pytest
uv run ruff check src/ tests/
MIT