grok-cli
An open-source coding agent for the Grok API
Grok CLI is an open-source terminal coding agent that interfaces with xAI's Grok API, providing both interactive and headless modes for development workflows. Built with TypeScript and Bun, it features live X and web search, multi-agent delegation, desktop automation capabilities, and remote control via Telegram. Developers can run it interactively with a modern terminal UI or invoke it headless for CI/CD pipelines, code reviews, and automated testing, with conversation sessions that persist across runs.
Key Features
Use Cases
- 01Running automated code reviews and refactoring tasks in CI/CD pipelines with headless mode
- 02Testing and verifying applications in isolated sandbox environments with screenshots and video evidence
- 03Controlling desktop applications and capturing UI snapshots for automation workflows on macOS
- 04Managing remote development tasks via Telegram while away from the terminal
- 05Generating project documentation and changelogs on recurring schedules with the daemon
- 06Exploring codebases with parallel sub-agent delegation for faster analysis
Related Agents
View morehermes-agent
The agent that grows with you
agency-agents
A complete AI agency at your fingertips - From frontend wizards to Reddit community ninjas, from whimsy injectors to reality checkers. Each agent is a specialized expert with personality, processes, and proven deliverables.
openinterpreter
A coding agent for open models like Kimi K3
cline
Autonomous coding agent as an SDK, IDE extension, or CLI assistant.
grok-cli — FAQ
What is Grok CLI?+
Grok CLI is an open-source terminal coding agent that connects to xAI's Grok API, offering both interactive chat and headless automation modes. It includes built-in sub-agents for task delegation, desktop automation, and supports remote control through Telegram.
How do I install Grok CLI?+
Run the install script with curl -fsSL https://raw.githubusercontent.com/superagent-ai/grok-cli/main/install.sh | bash, or install globally with Bun using bun add -g grok-dev. The script bundles Bun automatically if not already present.
What API key do I need for Grok CLI?+
You need a Grok API key from x.ai to use this agent. Set it via the GROK_API_KEY environment variable, save it in ~/.grok/user-settings.json, or pass it with the -k flag when running the CLI.
Which terminals work with the interactive mode?+
Modern terminal emulators like WezTerm, Alacritty, Ghostty, and Kitty are recommended for the best OpenTUI experience. Headless mode with --prompt works in any terminal and doesn't require UI support.
Is Grok CLI free to use?+
The Grok CLI software is open-source under the MIT license and free to use. However, you will incur costs based on xAI's API pricing for Grok model usage, which you can review by running grok models.
What platforms support the sandbox and computer use features?+
The Shuru sandbox requires macOS 14 or later on Apple Silicon. The computer use sub-agent for desktop automation also targets macOS and requires Accessibility permissions for your terminal app in System Settings.
How do I install grok-cli?+
Open the source repository on GitHub and follow its README. grok-cli is a agent — MCP Agents Market links you directly to the official repo.
Is grok-cli free?+
grok-cli is an open-source project hosted on GitHub. Check the repository for its license and any usage requirements.