Rawi (راوي) — The AI-Powered CLI That Transforms Your Terminal Into an Intelligent Workspace
- Introduction
- Installation
- Quick Start
- Core Commands
- Advanced Features
- Practical Examples
- Troubleshooting
Rawi is a developer-friendly AI-powered CLI tool that brings the power of multiple AI providers directly to your terminal. Whether you're debugging code, writing documentation, analyzing data, or learning new technologies, Rawi provides intelligent assistance through a simple command-line interface.
- AI-Powered Assistance: Ask questions and get intelligent responses using state-of-the-art AI models
- Multi-Provider Support: Works with OpenAI, Anthropic, Google, DeepSeek, Mistral, Cerebras, Ollama, LM Studio, Azure, AWS Bedrock, and xAI
- Expert Templates: 200+ specialized prompt templates for different domains and use cases
- Session Management: Persistent conversations with context awareness
- Shell Integration: Perfect integration with pipes, redirects, and shell scripting
- Profile Management: Multiple configurations for different projects or providers
- ⚡ Fast: Get instant AI responses without leaving your terminal
- 🛡️ Private: Use local AI providers like Ollama for complete privacy
- 🔧 Developer-Focused: Built specifically for coding workflows and technical tasks
- 🌍 Multilingual: Full support for English and Arabic
- 📚 Rich History: Search, export, and manage your AI conversations
# Install globally via npm
npm install -g rawi
# Or using other package managers
yarn global add rawi
pnpm add -g rawi
bun add -g rawi# Using npx (no installation required)
npx rawi ask "What is TypeScript?"
# Verify installation
rawi --version
rawi info- Node.js: 18.0.0 or higher
- Operating System: Windows, macOS, Linux
- Terminal: Any modern terminal
npm install -g rawiChoose one of these popular options:
OpenAI (Recommended for beginners)
# Get API key from: https://platform.openai.com/api-keys
rawi configure --provider openai --model gpt-4o --api-key sk-your-keyOllama (Free & Private)
# Install Ollama first: https://ollama.com/download
ollama pull llama3.2
rawi configure --provider ollama --model llama3.2Anthropic Claude (Great for analysis)
# Get API key from: https://console.anthropic.com/
rawi configure --provider anthropic --model claude-3-5-sonnet-20241022 --api-key sk-ant-xxxDeepSeek (Cost-effective with reasoning)
# Get API key from: https://platform.deepseek.com/api_keys
rawi configure --provider deepseek --model deepseek-chat --api-key sk-your-deepseek-keyMistral (European AI)
# Get API key from: https://console.mistral.ai/api-keys/
rawi configure --provider mistral --model mistral-large-latest --api-key your-mistral-keyCerebras (Ultra-fast inference)
# Get API key from: https://cloud.cerebras.ai
rawi configure --provider cerebras --model llama3.1-70b --api-key csk-your-cerebras-key# Ask your first question
rawi ask "Explain the difference between REST and GraphQL"
# Try with code analysis
echo "console.log('Hello World')" | rawi ask "Optimize this JavaScript code"
# Use a specialized template
rawi ask --act security-expert "What are common web security vulnerabilities?"Ask questions and get intelligent responses.
Basic Usage:
rawi ask [query] [options]Options:
-p, --profile <profile>— Use specific profile (default: default)-s, --session <sessionId>— Continue existing session-n, --new-session— Start new session--act <template>— Use expert template--verbose— Show detailed information
Examples:
# Simple questions
rawi ask "How do I optimize this SQL query?"
rawi ask "What is the difference between TypeScript and JavaScript?"
# Use specific profile
rawi ask "Review this code" --profile work
# Continue conversations
rawi ask "How do I handle state management?" --new-session
rawi ask "What about Redux specifically?" --session abc123
# Use expert templates
rawi ask --act ethereum-developer "explain smart contract security"
rawi ask --act linux-terminal "list files in home directory"
# Pipe integration
git diff | rawi ask "Review these changes for potential issues"
cat server.js | rawi ask --act code-reviewer "Optimize this Express.js code"Convert natural language descriptions into executable CLI commands.
Basic Usage:
rawi exec [description] [options]Options:
-p, --profile <profile>— Use specific profile (default: default)--dry-run— Show command without executing--confirm— Always prompt for confirmation--timeout <seconds>— Set custom execution timeout--verbose— Show detailed information--copy-command— Copy the command to clipboard before execution (default: false)
Examples:
# Generate and execute commands
rawi exec "list all files in current directory"
rawi exec "show disk usage for home directory"
# Safety options
rawi exec "restart service" --dry-run
rawi exec "delete old files" --confirm
# Clipboard control
rawi exec "find large files" --copy-command # Default behavior
# Pipe and interactive
echo "compress log files" | rawi exec
rawi exec # Interactive promptConfigure AI providers and manage profiles.
Basic Usage:
rawi configure [options]Options:
-p, --profile <profile>— Profile name (default: default)--provider <provider>— AI provider--model <model>— AI model name--api-key <apiKey>— API key--temperature <temp>— Sampling temperature (0-2)--max-tokens <tokens>— Maximum response tokens--language <lang>— Language (english, arabic)
Management Options:
--show— Show current configuration--list— List all profiles--delete <profile>— Delete profile
Examples:
# Interactive setup (recommended)
rawi configure
# Quick provider setup
rawi configure --provider openai --model gpt-4o --api-key sk-your-key
rawi configure --provider anthropic --model claude-3-5-sonnet-20241022 --api-key sk-ant-xxx
# View configuration
rawi configure --show
rawi configure --list
# Multiple profiles
rawi configure --profile work --provider openai --model gpt-4o
rawi configure --profile personal --provider ollama --model llama3.2
# Delete profile
rawi configure --delete old-profileManage your AI conversation history.
Basic Usage:
rawi history [options]Options:
-p, --profile <profile>— Profile to show (default: default)-l, --limit <number>— Number of sessions (default: 50)-s, --search <query>— Search messages--provider <provider>— Filter by provider--model <model>— Filter by model--from <date>— From date (YYYY-MM-DD)--to <date>— To date (YYYY-MM-DD)
Subcommands:
sessions— List and manage sessionsshow <sessionId>— Show session detailsdelete <sessionId>— Delete sessionstats— Show usage statisticscleanup— Clean old sessionsexport— Export history to file
Examples:
# View recent conversations
rawi history
rawi history --limit 100
# Search and filter
rawi history --search "docker deployment"
rawi history --provider openai --from 2024-01-01
# Session management
rawi history sessions
rawi history show abc123-def456
rawi history delete abc123-def456
# Statistics
rawi history stats
rawi history stats --profile work
# Cleanup and export
rawi history cleanup --days 30
rawi history export --output backup.jsonDiscover and use specialized AI personas.
Basic Usage:
rawi act [options]Options:
-l, --list— List all templates-s, --show <template>— Show template details
Examples:
# Browse all templates
rawi act --list
# Show template details
rawi act --show ethereum-developer
# Use with ask command
rawi ask --act security-expert "Analyze authentication code"Explore available AI providers and models.
Basic Usage:
rawi provider [options]Options:
-l, --list— List all providers-m, --list-models <provider>— List models for provider
Examples:
# List all providers
rawi provider --list
# Show provider models
rawi provider --list-models openai
rawi provider --list-models anthropicGet information about Rawi and your configuration.
Basic Usage:
rawi info [options]Options:
--profiles— Show profile details
Examples:
# System information
rawi info
# Profile information
rawi info --profilesUse multiple profiles for different projects or providers:
# Create profiles for different use cases
rawi configure --profile development --provider openai --model gpt-4o
rawi configure --profile analysis --provider anthropic --model claude-3-5-sonnet-20241022
rawi configure --profile local --provider ollama --model llama3.2
# Use specific profiles
rawi ask "Review this code" --profile development
rawi ask "Analyze this data" --profile analysis
rawi ask "Explain this concept" --profile localMaintain conversation context across multiple interactions:
# Start a new session for a project
rawi ask "I'm building a React app with TypeScript" --new-session
# Continue the conversation (uses current session)
rawi ask "How do I implement state management?"
rawi ask "What about testing strategies?"
# Continue specific session later
rawi ask "Can you suggest some performance optimizations?" --session abc123-def456Use specialized AI personas for domain-specific assistance:
# Development templates
rawi ask --act ethereum-developer "review this smart contract"
rawi ask --act code-reviewer "analyze this Python function"
rawi ask --act linux-terminal "show disk usage"
# Security templates
rawi ask --act security-expert "audit authentication implementation"
rawi ask --act penetration-tester "assess vulnerability"
# Documentation templates
rawi ask --act tech-writer "create API documentation"
rawi ask --act api-documenter "document these endpoints"
# Browse all templates
rawi act --listRawi integrates seamlessly with shell pipes and redirects:
# Pipe input to Rawi
cat file.js | rawi ask "Review this code"
git diff | rawi ask "Write a commit message"
curl -s api.com/data | rawi ask "Explain this API response"
# Redirect output
rawi ask "Create a Docker setup for Node.js" > Dockerfile
rawi ask "Generate TypeScript interfaces" > types.ts
# Combine with other tools
grep ERROR app.log | rawi ask "Categorize these errors"
ls -la | rawi ask "Explain these file permissions"# Code review
git diff | rawi ask "Review these changes for potential issues"
# Generate tests
cat src/utils.js | rawi ask "Generate unit tests for these functions"
# Debug errors
rawi ask "Fix this Python error: NameError: name 'x' is not defined"
# Create documentation
rawi ask "Create README for a TypeScript CLI tool" > README.md
# Generate commit messages
git diff --cached | rawi ask "Write a conventional commit message"# Analyze CSV data
cat sales-data.csv | rawi ask "Analyze this sales data and find trends"
# Process logs
tail -100 /var/log/app.log | rawi ask "Summarize errors and suggest fixes"
# API analysis
curl -s api.example.com/data | rawi ask "Explain this API structure"# Quick explanations
rawi ask "Explain React hooks with examples"
# Compare technologies
rawi ask "Compare PostgreSQL vs MongoDB for a social media app"
# Best practices
rawi ask "Security best practices for Node.js APIs"# Generate configurations
rawi ask "Create ESLint config for React TypeScript" > .eslintrc.js
rawi ask "Generate Docker configuration for Node.js app"
# Create scripts
rawi ask "Create a backup script for PostgreSQL" > backup.sh
rawi ask "Generate CI/CD workflow for GitHub Actions"Configuration Problems:
# Check current configuration
rawi configure --show
rawi info
# List all profiles
rawi configure --list
# Reconfigure if needed
rawi configure --provider openai --model gpt-4o --api-key your-new-keyAPI Key Issues:
# Check if API key is configured
rawi configure --show
# Update API key
rawi configure --api-key sk-your-new-key
# Test configuration
rawi ask "Hello, can you hear me?"Provider-Specific Issues:
Ollama:
# Ensure Ollama is running
ollama serve
# Pull required model
ollama pull llama3.2
# Configure Rawi
rawi configure --provider ollama --model llama3.2Azure OpenAI:
# Ensure all required parameters
rawi configure --provider azure \
--model your-deployment-name \
--api-key your-key \
--resource-name your-resourceAWS Bedrock:
# Use provider chain (recommended)
rawi configure --provider bedrock \
--model anthropic.claude-3-sonnet-20240229-v1:0 \
--use-provider-chain \
--region us-east-1
# Or explicit credentials
rawi configure --provider bedrock \
--model anthropic.claude-3-sonnet-20240229-v1:0 \
--access-key-id your-key \
--secret-access-key your-secret# General help
rawi --help
# Command-specific help
rawi ask --help
rawi configure --help
rawi history --help
# System information
rawi info
# Check version
rawi --version"No configuration found":
# Set up configuration
rawi configure"Incomplete configuration":
# Check what's missing
rawi configure --show
# Reconfigure with all required parameters
rawi configure --provider openai --model gpt-4o --api-key sk-your-key"Unknown command":
# Check available commands
rawi --help
# Use correct command syntax
rawi ask "your question"Network/API errors:
- Check your internet connection
- Verify API key is valid and has sufficient quota
- Check provider status pages
- Use appropriate models: Larger models are more capable but slower
- Adjust temperature: Lower values (0.1-0.3) for factual responses, higher (0.7-1.0) for creative tasks
- Manage token limits: Set appropriate max-tokens for your use case
- Use profiles: Create optimized profiles for different tasks
- Local providers: Use Ollama or LM Studio for faster responses without API limits
For more detailed information, visit the official documentation or check the GitHub repository.