πŸ“ˆ GH Trending Explorer 🎲 Surprise me

← all repos

PointAntStorm / grok-self

git clone https://github.com/PointAntStorm/grok-self.git

grok-cli-self the lightweight, zero-dependency Grok CLI. Chat with xAI's Grok AI (Grok 4) in your terminal: one-shot prompts

β€”
stars, 24h
β€”
stars, 7 days
+488
stars, 30 days Β· #571
488
β˜… total
1
forks Β· 0 open issues

Star history starts 2026-10-20; the chart appears after the second daily snapshot.

LanguageJavaScript
LicenseMIT
Created2026-09-25 (25d ago)
Last push24d ago
Watchers1
OwnerUser

GitHub topics

Links

README excerpt
# grok-cli-self
### The lightweight, zero-dependency Grok CLI β€” chat with xAI's Grok AI directly from your terminal
**One-shot prompts Β· Interactive chat Β· Streaming replies Β· Pipe anything in Β· macOS, Linux & Windows**
Installation Β·
Quick Start Β·
Usage Β·
For Developers Β·
FAQ Β·
Contributing
---
## πŸ€– What is grok-cli-self?
**grok-cli-self** is a free, open-source **command-line interface (CLI) for Grok**, the AI assistant built by **xAI**. It brings the power of Grok's large language models β€” including the latest **Grok 4** family β€” straight into your terminal, so you can ask questions, generate code, explain errors, draft text, and automate AI workflows **without ever leaving your shell**.
If you're searching for a **Grok CLI**, a **Grok command-line tool**, a way to **use Grok in the terminal**, or a **self-hosted Grok chat client** that you fully control β€” this is it. No Electron, no browser tab, no telemetry, no bloat: one small Node.js program, **zero runtime dependencies**, and your own xAI API key.
> ⚠️ **Disclaimer:** grok-cli-self is a community project and is **not an official xAI product**. "Grok" and "xAI" are trademarks of xAI Corp. This tool simply talks to the official, public xAI API using your own key.
---
## ✨ Features
- ⚑ **Blazing fast startup** β€” pure Node.js, zero dependencies, installs in seconds
- πŸ’¬ **Interactive chat mode** β€” a friendly REPL with conversation memory, slash commands and multi-line input
- 🎯 **One-shot mode** β€” `grokself "your question"` prints the answer and exits; perfect for scripts
- 🌊 **Real-time streaming** β€” watch Grok's reply appear token by token
- πŸ”€ **Pipe anything in** β€” `cat error.log | grokself "what's wrong here?"` β€” the Unix way
- 🧠 **Model switching** β€” use `grok-4-latest`, `grok-code-fast-1`, or any model your key can access
- πŸ” **Private by design** β€” your API key lives in `~/.grokself/config.json` (chmod `600`) and is sent only to `api.x.ai`
- πŸ› οΈ **Scriptable & CI-friendly** β€” `--no-stream`, exit codes, env vars (`XAI_API_KEY`, `GROK_BASE_URL`, `GROK_MODEL`)
- 🍎 **Runs anywhere Node 18+ runs** β€” macOS (Apple Silicon & Intel), Linux, Windows (PowerShell / Git Bash / WSL)
---
## πŸš€ Installation
### ⚑ macOS β€” 3-line quick install
Open **Terminal** (press `⌘ + Space`, type `Terminal`, hit Enter) and run these **three lines**, one at a time:
1. Install Apple's command line tools (needed by git & compilers)
 [code] 
2. Install Node.js + npm via nvm β€” see https://nodejs.org/en/download
 [code] 
3. Install grok-cli-self straight from GitHub
 [code] 
Then run it:
 [code] 
### 🐧 Linux / πŸͺŸ Windows
 [code] 
### 🌍 Optional: install globally
If you want the `grokself` command available **everywhere** (not just inside the `grokself` folder):
 [code] 
---
## πŸ§’ Never used a terminal before? (Beginner-friendly guide)
No worries β€” follow these steps exactly and you'll be chatting with Grok in ~5 minutes. **No programming knowledge and no Homebrew needed.**
**Step 1 β€” Open the Terminal app.**
On your Mac, pre