
Grok CLI is an open-source interactive CLI tool that provides a flexible and powerful interface for AI-assisted workflows.
npm i -g @stevederico/grok-cli
grok
Provider | Environment Variable | Description | Example |
---|---|---|---|
Grok (xAI) | XAI_API_KEY |
API key for Grok AI | export XAI_API_KEY="your_grok_api_key" |
Grok (xAI) | XAI_MODEL |
Specific Grok model to use | export XAI_MODEL="grok-4-0709" |
Default Provider | GROK_CLI_PROVIDER |
Set the default AI provider | xai |
Once the CLI is running, you can start interacting with AI models from your shell.
You can start a project from a new directory:
cd new-project
grok
> Write me a Discord bot that answers questions using a FAQ.md file I will provide
Or work with an existing project:
git clone https://github.com/stevederico/skateboard
cd skateboard
grok
> Give me a summary of all of the changes that went in yesterday
Head over to the troubleshooting guide if you're having issues.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
For details on the terms of service and privacy notice applicable to your use of Grok CLI, see the Terms of Service and Privacy Notice.
This project is not an official product or initiative of xAI or Grok. It is an independent endeavor and is not endorsed, sponsored, or affiliated with xAI or Grok in any way.
This project is based on and inspired by the excellent work from Google's Gemini CLI. We acknowledge and appreciate their foundational contributions to the open-source AI tooling ecosystem.