grok-cli
An open-source coding agent for the Grok API
Developers working against xAI's Grok API who want a terminal agent.
You do not have a Grok API key from x.ai.
About grok-cli
An open-source terminal coding agent that connects to xAI’s Grok API — real-time X search, web search, the full Grok model lineup, sub-agents on by default, remote control via Telegram (pair once, drive the agent from your phone while the CLI runs), and a terminal UI built with Bun and OpenTUI.
Prerequisites: a Grok API key from x.ai and a modern terminal emulator for the interactive OpenTUI experience. Headless --prompt mode does not depend on terminal UI support. If you want host desktop automation via the built-in computer sub-agent, also enable Accessibility permission for your terminal app on macOS.
For the most reliable interactive OpenTUI experience, use a modern terminal emulator. We currently document and recommend:
grok-cli is an open-source project written primarily in TypeScript, with 3.5k stars on GitHub. It was last updated in July 2026.
grok-cli vs. the alternatives
All 49 alternatives →| Record | Stars | Pricing | ||
|---|---|---|---|---|
| grok-clithis listing | 3.5k | TypeScript | MIT | Open source |
| OpenCode | 211k | — | MIT | Open source |
| gemini-cli | 107k | TypeScript | Apache-2.0 | Open source |
| Zed | 91k | Rust | GPL-3.0-or-later | Open source |
| OpenHands | 89k | — | MIT | Open source |
| Cline | 69k | — | Apache-2.0 | Open source |
