Chat, search the web, generate images and videos, analyze vision, get embeddings — all through the xAI Grok API, from a single CLI with zero dependencies.
Eight capabilities. Zero dependencies. Install and go.
Real-time streaming, system messages, temperature control. Pipe stdin for code review.
Search the web or X/Twitter via the Responses API. Grounded answers with citations.
Text-to-video, image-to-video, video editing. Async polling with auto-download.
Generate images with standard or pro models. Save to file with -o.
Analyze local images or URLs. Ask questions about what you see. Multimodal chat.
Constrain responses to JSON schemas. Parse-friendly output for automation pipelines.
Only Node.js built-in fetch(). No SDK, no framework, no bloat.
Stdout-first. Pipe files in, chain outputs, use with jq, build scripts.
Every xAI endpoint mapped to a simple command or flag.
| Feature | Command / Flag | Endpoint |
|---|---|---|
| Chat | grok chat | /v1/chat/completions |
| Streaming | --stream | /v1/chat/completions (SSE) |
| Web search | grok search / --search | /v1/responses |
| X search | grok xsearch / --xsearch | /v1/responses |
| Image gen | grok image | /v1/images/generations |
| Video gen | grok video | /v1/videos/generations |
| Vision | grok vision | /v1/chat/completions |
| Embeddings | grok embed | /v1/embeddings |
| Models | grok models | /v1/models |
| Structured output | --response-format | /v1/chat/completions |
| Deferred | --deferred | /v1/chat/completions + polling |
| System messages | --system | All chat/search endpoints |
Nine commands. Fifteen flags. Infinite pipelines.
| Command | Description |
|---|---|
| grok chat | Chat with any Grok model |
| grok search | Web search via Responses API |
| grok xsearch | X/Twitter search via Responses API |
| grok image | Generate images (standard or pro) |
| grok video | Generate videos with polling & download |
| grok vision | Analyze images (local file or URL) |
| grok embed | Generate text embeddings |
| grok models | List available models |
| grok auth | Manage API key (show / set / check) |
Model selection
Stream response tokens
Sampling temperature (0-2)
Max response tokens
Raw API JSON output
System message / instructions
Enable web or X search
Async completion with polling
Constrain output format (JSON)
Pro image model
Video duration (1-15s)
Source media for video gen
Return request_id only
Save to file
Override key / read from file
One install. Set your key. Start prompting.