GROK
AI Agent in Your Terminal
A conversational AI CLI tool powered by Grok with intelligent text editor capabilities and tool usage. Ask questions, edit files, run commands — all from a single prompt.
Built for developers
Everything you need to work faster. Powered by Grok's cutting-edge AI models with deep tool integration.
Intelligent Text Editor
View, create, and edit files through natural language with smart diff rendering.
Bash Execution
Run shell commands with AI-powered safety confirmations. Auto-approve or review each one.
MCP Protocol
Connect external tools via Model Context Protocol. Extend your agent with custom capabilities.
Web Search
Search the web directly from your terminal. Grok fetches real-time information.
Streaming Responses
Real-time token streaming. See results as they generate — zero lag.
Git Automation
AI-generated commit messages and one-command push to remote.
Install in seconds
Choose your method. Requires Node.js 18+ and a Grok API key from x.ai.
npm
recommendednpm install -g grokcli
npx
no installnpx grokcli
Git Clone
git clone https://github.com/grok-cli/grok-cli.git cd grok-cli && npm install && npm start
API Key
# Set your key export GROK_API_KEY="xai-your-key" # Or pass as flag grok serve --api-key xai-your-key
Slash Commands
| Command | Description |
|---|
Choose your engine
Switch models on-the-fly with /model. From lightning-fast code completions to deep reasoning.
⚡ grok-code-fast-1
Optimized for coding. 256K context. Fast and accurate for edits and debugging.
◎ grok-4-latest
Flagship reasoning model. 256K context. Best for complex multi-step tasks.
▸ grok-4-1-fast-reasoning
Latest gen. 2M context with reasoning. Fast inference for large codebases.
● grok-3-mini-fast
Lightweight and cost-effective. 131K context. Perfect for quick queries.