d41a31cf362fa0f2b8a847de0a62feb7e573a8ac
Grok CLI
A conversational AI CLI tool powered by Grok-3 with intelligent text editor capabilities and tool usage.
Features
- 🤖 Conversational AI: Natural language interface powered by Grok-3
- 📝 Smart File Operations: AI automatically uses tools to view, create, and edit files
- ⚡ Bash Integration: Execute shell commands through natural conversation
- 🔧 Automatic Tool Selection: AI intelligently chooses the right tools for your requests
- 💬 Interactive UI: Beautiful terminal interface built with Ink
- 🌍 Global Installation: Install and use anywhere with
npm i -g grok-cli
Installation
Prerequisites
- Node.js 16+
- Grok API key from X.AI
Global Installation (Recommended)
npm install -g grok-cli
Local Development
git clone <repository>
cd grok-cli
npm install
npm run build
npm link
Setup
-
Get your Grok API key from X.AI
-
Set up your API key (choose one method):
Method 1: Environment Variable
export GROK_API_KEY=your_api_key_here
Method 2: .env File
cp .env.example .env
# Edit .env and add your API key
Method 3: Command Line Flag
grok --api-key your_api_key_here
Usage
Start the conversational AI assistant:
grok
Or specify a working directory:
grok -d /path/to/project
Example Conversations
Instead of typing commands, just tell Grok what you want to do:
💬 "Show me the contents of package.json"
💬 "Create a new file called hello.js with a simple console.log"
💬 "Find all TypeScript files in the src directory"
💬 "Replace 'oldFunction' with 'newFunction' in all JS files"
💬 "Run the tests and show me the results"
💬 "What's the current directory structure?"
Development
# Install dependencies
npm install
# Development mode
npm run dev
# Build project
npm run build
# Run linter
npm run lint
# Type check
npm run typecheck
Architecture
- Agent: Core command processing and execution logic
- Tools: Text editor and bash tool implementations
- UI: Ink-based terminal interface components
- Types: TypeScript definitions for the entire system
License
MIT
Description
An open-source autonomous agent powered by Grok.
1,018 KiB
0 Stars
1 Watchers
0 Forks
Languages
TypeScript
99.1%
Shell
0.9%