Skip to content
BYOK Tools

Grok CLI

Open-source terminal coding agent for the xAI Grok API.

3.8 editor score•Command Line•Free & open source•Verified 22 Nov 2026

Best for

Developers and power users who live in the terminal, especially if you want to keep your key on your own device and pay nothing for the software.

Skip it if

You need offline or local models or you use a provider other than xAI or OpenAI-compatible.

Rank in Command Line

27th of 29 by editor score

Key Safety

77/100 (grade B), safer than 7% of its category

Overview

Grok CLI is an open-source conversational coding agent that runs in your terminal on your own xAI key. It can read and edit files, run shell commands and use MCP tools, and also works with other OpenAI-compatible endpoints.

Key features

  • File editing
  • Shell commands
  • MCP tools
  • Custom instructions per project

Works with these providers

2 provider options, fewer than the 6.6 average for command line. Usage is billed by the provider at its list price.

Our verdict

Grok CLI is ranked 27th of 29 command line on BYOK Tools and trails its category on key safety. Its standout strength: lightweight. The main trade-off: narrow provider focus.

What we like

  • Lightweight
  • Made for Grok models

Watch out for

  • Narrow provider focus

How Grok CLI compares

Against the highest-rated command line on BYOK Tools. Scores are out of 5 (editor) and 100 (Key Safety).

Grok CLI compared with other command line
ToolEditor scoreKey SafetyPricingProvidersOpen sourceLocal modelsKey stays local
Grok CLI3.877Open source2–
LLM (Simon Willison)4.693Open source13
Fabric4.593Open source14
AIChat4.493Open source15
Gemini CLI4.475Open source1–

How to use Grok CLI with your own API key

  1. 1

    Create an API key

    Get a key from your provider's console: xAI. Create a separate key just for Grok CLI so you can revoke it on its own.

  2. 2

    Set a spending limit

    Set a monthly budget or usage cap in the provider dashboard before you start. It is the simplest protection against a leaked key or a runaway agent.

  3. 3

    Install Grok CLI

    Install Grok CLI from the command line using the instructions in its repository or docs.

  4. 4

    Add your key

    Paste the key into Grok CLI's provider or model settings. Your key is stored on your device and requests go directly to the provider.

What it costs to run Grok CLI

Pricing for Grok CLI itself: Open source (Free & open source). Model usage is billed by your provider. Estimated monthly API spend by usage level, using live list prices:

ModelLight~5 messages a dayRegular~20 messages a dayHeavy~80 messages a day
Grok 4.7xAI · Flagship$0.46$3.80$49

Estimates assume typical chat-length messages with conversation history and no prompt caching. Prices from OpenRouter's public models API. Run your own numbers.

BYOK Key Safety Score

Key handling in Grok CLI

How we score
77/ 100

Grade B

Your key is stored on your device and requests go directly to the provider.

Category average: 88/100

  • Key storage

    Key stays on your device; requests go direct to the provider.

    40/40
  • Auditable code

    Open source: anyone can verify how keys are handled.

    25/25
  • Self-hosting

    Runs as a local app, but not as a self-hosted service.

    8/15
  • Offline option

    Cloud providers only.

    0/10
  • Provider choice

    2 provider options, which lets you pick the provider whose data terms you trust.

    4/10

Whatever the score, give each app its own key, set a monthly spend limit with your provider, and revoke keys you no longer use. Read the key-safety checklist.

Grok CLI FAQ

Does Grok CLI support bring your own key?
Yes. Grok CLI accepts your own API key from xAI and OpenAI-compatible. Usage is billed by the provider at its API rates.
Where does Grok CLI store my API key?
On your device. Requests go directly from Grok CLI to the provider. Its BYOK Tools Key Safety Score is 77/100.
Is Grok CLI free?
Open source: Free & open source. API usage is billed separately by your model provider.
How much does it cost to use Grok CLI with my own API key?
For regular use (about 20 messages a day), API costs run from roughly $3.80 to $3.80 a month depending on the model, based on current list prices.
Is Grok CLI open source?
Yes. The source code is at https://github.com/superagent-ai/grok-cli.
Can Grok CLI run local models?
No. Grok CLI works with cloud providers only.
Which platforms does Grok CLI support?
CLI, macOS, Windows, Linux.
What are the best alternatives to Grok CLI?
Popular alternatives include LLM (Simon Willison), AIChat, mini-swe-agent and kubectl-ai. See the comparison table above for pricing, providers and key safety side by side.

Community reviews

No reviews yet.