prab-cli
v1.2.7
Published
AI-powered coding assistant for your terminal. Built with Groq's lightning-fast LLMs, featuring autonomous tool execution, syntax-highlighted output, and git integration.
Maintainers
Readme
Prab CLI
An AI-powered coding assistant for your terminal. Built with Groq's lightning-fast LLMs, featuring autonomous tool execution, syntax-highlighted output, and seamless git integration.
Features
- AI-Powered Coding Assistant - Chat with AI that understands your codebase
- Autonomous Tool Execution - AI can read, write, and edit files directly
- Git Integration - Built-in git status, diff, commit, push, and more
- Syntax Highlighting - Beautiful colored output for code blocks and diffs
- Multiple Models - Switch between Groq models on the fly
- Task Tracking - Built-in todo management for complex tasks
- Safety Checks - Confirmation prompts for destructive operations
- Session Logging - Debug and track all AI interactions
Installation
npm install -g prab-cliQuick Start
Get a Groq API Key from console.groq.com
Configure your API key:
groq-cli config- Start chatting:
groq-cliUsage
Interactive Mode
Simply run groq-cli to start an interactive session:
groq-cliYou'll see the welcome banner and can start chatting with the AI:
____ __ ________ ____
/ __ \_________ _/ /_ / ____/ / / _/
/ /_/ / ___/ __ `/ __ \ / / / / / /
/ ____/ / / /_/ / /_/ / / /___/ /____/ /
/_/ /_/ \__,_/_.___/ \____/_____/___/
Active Model: llama-3.3-70b-versatile
Available Tools: 14
> Help me refactor the authentication moduleSlash Commands
Type / during a session to access the command menu:
| Command | Description |
|---------|-------------|
| / | Open command menu |
| /exit | Exit the CLI |
| /clear | Clear chat history |
| /context | Show loaded file context |
| /tools | List available tools |
| /todos | Show current todo list |
Command Menu Options
- Select Model - Switch between available Groq models
- Usage - View current model and session stats
- Tools - List all available tools
- Todos - View task list
- Clear Todos - Reset task list
- Context - Show file context
- Clear History - Reset conversation
- API Key - Update your API key
- Exit - Quit the CLI
Available Tools
The AI has access to these tools for autonomous coding:
File Operations
| Tool | Description |
|------|-------------|
| read_file | Read file contents with line numbers |
| write_file | Create or overwrite files |
| edit_file | Make targeted edits to existing files |
| glob | Find files matching patterns |
| grep | Search file contents with regex |
Git Operations
| Tool | Description |
|------|-------------|
| git_status | Show working tree status |
| git_diff | Show changes between commits |
| git_log | View commit history |
| git_add | Stage files for commit |
| git_commit | Create a commit |
| git_branch | List or create branches |
| git_push | Push commits to remote |
System
| Tool | Description |
|------|-------------|
| bash | Execute shell commands |
| manage_todos | Track tasks and progress |
Colorized Output
The CLI provides rich, colorized output for better readability:
Git Diff
- Added lines in green
- Removed lines in red
- Hunk headers in cyan
- File headers in bold
Code Blocks
- Keywords highlighted in magenta
- Strings in green
- Numbers in yellow
- Comments in gray
- Function calls in cyan
Markdown
- Headers in cyan bold
- Inline code with gray background
- Bullet points with yellow markers
- Bold and italic text styling
Configuration
API Key
Set your Groq API key:
# Interactive prompt
groq-cli config
# Or directly
groq-cli config YOUR_API_KEYReset API Key
groq-cli resetModel Management
groq-cli modelOptions:
- List available models
- Show current model
- Switch to a different model
Supported Models
The CLI supports all Groq models including:
llama-3.3-70b-versatile(default)llama-3.1-70b-versatilellama-3.1-8b-instantmixtral-8x7b-32768gemma2-9b-it- And more...
Models are fetched dynamically from the Groq API.
Session Logging
Debug logs are stored in ~/.prab-cli/logs/. View them with:
# View latest log
npm run log
# List all logs
npm run log:listExamples
Read and Edit a File
> Read the package.json and update the version to 2.0.0The AI will:
- Use
read_fileto view package.json - Use
edit_fileto update the version - Show you the diff of changes
Git Workflow
> Check the git status and commit all changes with a descriptive messageThe AI will:
- Run
git_statusto see changes - Use
git_addto stage files - Create a commit with
git_commit
Code Search
> Find all files that import the 'express' moduleThe AI will use grep to search for import statements.
Safety Features
- Confirmation Prompts - Destructive operations require approval
- Session Memory - Remember choices for similar operations
- Read-Only by Default - Tools like
read_fileandgit_statusrun without confirmation
Requirements
- Node.js 18+
- npm or yarn
- Groq API key
Development
# Clone the repo
git clone https://github.com/prab002/prab-cli.git
cd prab-cli
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build
npm run build
# Run production build
npm startLicense
ISC
Author
Prabhanjan Sharma
