Rawi (راوي) is the developer-friendly AI CLI that brings the power of 11 major AI providers directly to your terminal. With seamless shell integration, persistent conversations, and 200+ specialized prompt templates, Rawi transforms your command line into an intelligent development workspace.
"راوي" means "storyteller" in Arabic — every great story starts with a question.
✨ Why Choose Rawi?
Rawi isn't just another AI CLI tool — it's your complete AI-powered development environment:
🔥 11 AI Providers — OpenAI, Anthropic, Google, DeepSeek, Ollama, LM Studio, Azure, Bedrock, Mistral, Cerebras, and xAI
🛡️ Privacy First — Local AI support with Ollama and LM Studio — no data leaves your machine
⚡ Developer Optimized — Built specifically for coding workflows and technical tasks
🔄 Shell Integration — Perfect pipes, redirects, script automation, and smart completion
📊 Smart Sessions — Persistent conversations with context awareness
🎯 200+ Templates — Expert-level prompt templates for specialized responses
🌍 Multilingual — Full support for English and Arabic (راوي)
📚 Rich History — Search, export, and manage your AI conversations
🔧 Profile Management — Multiple configurations for different projects
🚀 Quick Start
Get your AI-powered terminal companion running in under 30 seconds:
npm install -g rawi
rawi configure
rawi ask "What's the difference between TypeScript and JavaScript?"
🎯 See Rawi in Action
rawi ask "Create a React component for file upload with drag-and-drop"
rawi ask "Fix this Python error: NameError: name 'x' is not defined"
rawi ask --act security-expert "Analyze this authentication code for vulnerabilities"
rawi ask "How do I handle state management?" --new-session
rawi ask "What about Redux specifically?" --session abc123
rawi chat --session-name "React Learning" --list-sessions
git diff | rawi ask "Review these changes for potential issues"
cat server.js | rawi ask --act code-reviewer "Optimize this Express.js code"
rawi history ask --limit 10
rawi history chat --search "debugging"
rawi history exec --search "system"
rawi history ask --all-profiles --provider openai
🤖 AI Providers — Your Choice, Your Control
Access the best AI models through one unified interface:
| 🔵 OpenAI | GPT-4o, GPT-4, O1, O3, GPT-4o-mini | ✅ | ❌ | General development, coding |
| 🟣 Anthropic | Claude 3.5 Sonnet, Claude 3.5 Haiku | ✅ | ❌ | Analysis, safety, long content |
| 🔴 Google | Gemini 2.0 Flash, Gemini 1.5 Pro | ✅ | ❌ | Fast inference, multimodal |
| � DeepSeek | DeepSeek-Chat, DeepSeek-Reasoner | ✅ | ❌ | Cost-effective, reasoning |
| �🟢 Ollama | Llama 3.2, CodeLlama, Qwen, +100 more | ❌ | ✅ | Privacy, offline, free |
| 🔧 LM Studio | Llama 3.3, Phi-4, Gemma-3, Qwen-3 | ❌ | ✅ | Local models, GUI management |
| 🟠 Mistral | Mistral Large, Mistral Small, Pixtral | ✅ | ❌ | European AI, multilingual |
| ⚡ Cerebras | Llama 3.3 70B, Llama 3.1 70B/8B | ✅ | ❌ | Ultra-fast inference, speed |
| 🔷 Azure | Enterprise OpenAI deployments | ✅ | ❌ | Enterprise, compliance |
| 🟠 Bedrock | Claude, Llama, Titan via AWS | ✅ | ❌ | AWS integration, scale |
| 🤖 xAI | Grok-3, Grok-2, Grok-Beta | ✅ | ❌ | Real-time, conversational |
🛡️ Privacy Focused: Use Ollama or LM Studio for complete privacy — all processing happens locally on your machine.
🎯 Act Templates — 200+ Specialized AI Personas
Transform your prompts with expertly crafted AI personas for specialized responses. Templates work globally across all profiles:
rawi act --list
rawi act --show ethereum-developer
rawi act --create
rawi act --edit my-template
rawi act --delete my-template
rawi ask --act linux-terminal "list files in home directory with details"
rawi ask --act code-reviewer "analyze this Python function for improvements"
rawi ask --act security-expert "audit this authentication implementation"
🔥 Popular Templates by Category
🛠️ Development
ethereum-developer — Smart contract development & security
linux-terminal — Terminal command simulation
code-reviewer — Code analysis and optimization
🔒 Security
security-expert — Security analysis and auditing
penetration-tester — Security testing and vulnerability assessment
📝 Documentation
tech-writer — Technical documentation
api-documenter — API documentation and examples
🗄️ Database
database-admin — SQL optimization and database management
data-analyst — Data analysis and insights
🎨 Creative
ux-designer — User experience and interface design
marketing-expert — Marketing copy and strategy
Use rawi act --list to explore all 200+ available templates across 15+ categories!
📋 Core Commands
Master Rawi's powerful command set:
🗣️ rawi ask — Your AI Assistant
The heart of Rawi - ask questions and get intelligent responses.
rawi ask "How do I optimize this SQL query?"
rawi ask "Review this code" --profile work
rawi ask "What about performance optimization?" --session abc123
rawi ask "Start new discussion" --new-session
rawi ask "Continue from list" --list-sessions
rawi ask "Named session" --session-name "API Design Discussion"
rawi ask --act security-expert "Analyze this authentication logic"
cat server.js | rawi ask "Review this Express server for security issues"
git diff | rawi ask "Write a conventional commit message for these changes"
rawi ask "Show session details" --show-session-id
rawi ask "Export this conversation" --export-session abc123
rawi ask "Rename session" --rename-session "New Session Name"
💬 rawi chat — Interactive Conversations
Start interactive chat sessions for back-and-forth conversations with AI.
rawi chat
rawi chat --profile work
rawi chat --act ethereum-developer
rawi chat --verbose
rawi chat --new-session
rawi chat --session abc123
rawi chat --session-name "Project X"
rawi chat --list-sessions
rawi chat --export-session abc123
rawi chat --show-session-id
rawi chat --session-stats
rawi chat --rename-session "New Name"
Perfect for:
- Code reviews with multiple rounds of feedback
- Brainstorming sessions
- Technical discussions
- Learning and exploration
- Problem-solving conversations
⚡ rawi exec — Command Generation
Convert natural language descriptions into executable CLI commands with safety validation.
rawi exec "list all files in current directory"
rawi exec "show disk usage for home directory"
rawi exec "find all Python files larger than 1MB"
echo "compress all log files" | rawi exec
printf "backup database\n" | rawi exec --dry-run
rawi exec
rawi exec "restart nginx service" --dry-run
rawi exec "delete old files" --confirm
rawi exec "long backup process" --timeout 300
rawi exec "show network config" --copy-command
rawi exec "server deployment commands" --profile production
rawi exec "complex git operations" --verbose
Perfect for:
- System administration and server management
- Development workflow automation
- Learning new CLI tools and their syntax
- File operations and data processing
- Quick one-off command generation
Safety Features:
- Command validation and safety checks
- Dry-run mode for preview without execution
- Timeout protection for long-running commands
- User confirmation for potentially dangerous operations
⚙️ rawi configure — Setup & Management
Easy setup and profile management for all your AI providers.
rawi configure
rawi configure --provider openai --model gpt-4o --api-key sk-xxx
rawi configure --provider anthropic \
--model claude-3-5-sonnet-20241022 \
--api-key sk-ant-xxx \
--temperature 0.7 \
--max-tokens 4096
rawi configure --list
rawi configure --show
rawi configure --show --profile work
rawi configure --delete old-profile
📚 rawi history — Conversation Management
Powerful tools to manage your AI conversation history with separate views for ask and chat sessions.
rawi history ask
rawi history chat
rawi history exec
rawi history ask --limit 10
rawi history chat --all-profiles
rawi history exec --limit 5
rawi history ask --search "docker"
rawi history chat --provider openai
rawi history exec --search "git"
rawi history ask --from 2024-01-01
rawi history chat --model gpt-4
rawi history exec --profile work
rawi history ask --profile work
rawi history chat --to 2024-12-31
rawi history ask --search "debugging react"
rawi history chat --search "typescript errors"
rawi history exec --search "system commands"
rawi history ask --provider ollama --model llama3.2
rawi history chat --provider anthropic --model claude-3-5-sonnet
rawi history exec --provider openai --model gpt-4
🎭 rawi act — Template Explorer
Discover and use specialized AI personas.
rawi act --list
rawi act --show ethereum-developer
rawi act --list | grep -i security
🔧 rawi provider — Provider Information
Explore AI providers and their capabilities.
rawi provider --list
rawi provider --list-models openai
rawi provider --list-models anthropic
ℹ️ rawi info — System Information
Get information about Rawi and your configuration.
rawi info
rawi info --profiles
� Session Management — Persistent AI Conversations
Rawi's advanced session management system lets you maintain context across conversations, organize your AI interactions, and never lose track of important discussions.
🎯 What Are Sessions?
Sessions are persistent conversation threads that:
- Preserve context — AI remembers your entire conversation history
- Maintain organization — Group related discussions together
- Enable continuation — Resume conversations from where you left off
- Provide insights — Track usage statistics and conversation metrics
🚀 Quick Session Examples
rawi chat --session-name "API Design Review" --profile work
rawi ask "What about the security concerns we discussed?" --session abc123
rawi ask "Continue where we left off" --list-sessions
rawi history export abc123 --output "project-discussion.json"
💡 Session Workflow Examples
📋 Project Planning Session
rawi chat --session-name "E-commerce Platform Design" --act solution-architect
rawi ask "Let's finalize the database schema" --session ecommerce-123
🐛 Debugging Session
rawi ask "I'm getting authentication errors" --new-session --act debugging-expert
cat error.log | rawi ask "Analyze these authentication errors" --session debug-456
rawi ask "The JWT validation fix worked, now what about rate limiting?" --session debug-456
📚 Learning Session
rawi chat --session-name "Machine Learning Journey" --act ai-instructor
rawi ask "Yesterday we covered neural networks, today let's discuss transformers" --session ml-789
🛠️ Session Operations
Create and Name Sessions
rawi chat --session-name "Sprint Planning Q1"
rawi ask "Quick question" --new-session
Navigate and Select Sessions
rawi history sessions
rawi history sessions --interactive
rawi chat --list-sessions
Session Information
rawi history show abc123
rawi history sessions --stats
rawi chat --show-session-id
Organize and Clean Up
rawi history rename abc123 "Updated Name"
rawi history delete abc123
rawi history cleanup --days 30
Export and Backup
rawi history export abc123
rawi history export --output "backup.json"
🎨 Session Best Practices
- 🏷️ Use Meaningful Names — Create sessions with descriptive names for important topics
- 📁 Organize by Profile — Use different profiles for work, personal, and project contexts
- 🔄 Continue Related Discussions — Keep context by continuing relevant sessions
- 🧹 Clean Up Regularly — Remove old or temporary sessions to stay organized
- 💾 Export Important Conversations — Backup valuable discussions and insights
📈 Session Analytics
Track your AI usage patterns:
rawi history stats
rawi history sessions --table
rawi history sessions --profile work --stats
🔧 Advanced Session Features
Interactive Selection with Full IDs
- Sessions display complete identifiers (no truncation)
- Table format shows all session details clearly
- Interactive prompts for easy session selection
Smart Session Continuation
- Automatic session detection based on context
- Profile-aware session grouping
- Intelligent session suggestions
Export Capabilities
- JSON format with full conversation history
- Metadata preservation (timestamps, providers, models)
- Batch export options for backup and analysis
📚 Session Documentation
�🛠️ Configuration Made Simple
Get up and running with any AI provider in minutes:
🚀 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
rawi configure --provider google --model gemini-2.0-flash-exp --api-key AIza-xxx
rawi configure --provider deepseek --model deepseek-chat --api-key sk-your-deepseek-key
rawi configure --provider ollama --model llama3.2
🏢 Enterprise & Advanced
rawi configure --provider azure \
--model your-deployment-name \
--resource-name your-resource \
--api-key your-azure-key
rawi configure --provider bedrock \
--model anthropic.claude-3-sonnet-20240229-v1:0 \
--use-provider-chain \
--region us-west-2
rawi configure --profile work --provider openai --model gpt-4o
rawi configure --profile personal --provider ollama --model llama3.2
rawi configure --profile enterprise --provider azure --model gpt-4o
🎛️ Fine-Tuning Options
rawi configure --provider openai \
--model gpt-4o \
--temperature 0.7 \
--max-tokens 4096 \
--language english
rawi configure --language arabic
💼 Developer Workflow Integration
See how Rawi integrates seamlessly into your development workflow:
🔍 Code Review & Analysis
git diff | rawi ask "Review these changes for potential issues"
cat src/auth.js | rawi ask --act security-expert "Analyze for vulnerabilities"
rawi ask --act code-reviewer "How can I optimize this function?" < utils.py
git diff --cached | rawi ask "Write a conventional commit message"
git log --oneline $(git describe --tags --abbrev=0)..HEAD | \
rawi ask "Create release notes from these commits"
git log --oneline main..feature-branch | \
rawi ask "Summarize the changes in this feature branch"
🐛 Debugging & Problem Solving
rawi ask "Fix this Python error: NameError: name 'x' is not defined"
tail -100 /var/log/app.log | rawi ask "Summarize errors and suggest fixes"
rawi ask --act code-reviewer "Explain this algorithm step by step" < algorithm.py
rawi ask --act database-admin "Optimize this slow query" < queries.sql
📝 Documentation & Generation
rawi ask --act tech-writer "Document this API endpoint" < api.js
rawi ask "Create a comprehensive README for this project" < package.json
rawi ask --act qa-engineer "Generate unit tests for this function" < utils.js
rawi ask "Generate Docker configuration for this Node.js app"
🔧 Automation & Scripting
rawi ask "Create a GitHub Actions workflow for CI/CD" > .github/workflows/deploy.yml
rawi exec "create a backup script for all project files"
rawi exec "setup development environment for new team member"
rawi ask "Create a database backup script for PostgreSQL" > backup.sh
rawi exec "find and clean up old log files safely"
echo "optimize system performance" | rawi exec --dry-run
rawi ask "Generate nginx config for this Express app" > nginx.conf
cat data.json | rawi ask "Transform this JSON into CSV format" > data.csv
📊 Data Analysis & Processing
cat sales-data.csv | rawi ask "Analyze this sales data and identify trends"
curl -s api.example.com/data | rawi ask "Explain this API response structure"
grep ERROR app.log | rawi ask "Categorize these errors and suggest fixes"
cat docker-compose.yml | rawi ask "Review this Docker configuration for best practices"
📄 Document & File Processing
Process and analyze various document formats with intelligent content extraction:
rawi ask --file report.pdf "Summarize the key findings in this report"
rawi ask --file src/app.js "Review this code for potential improvements"
rawi ask --file sales-data.xlsx "What trends do you see in this data?"
rawi ask --file requirements.docx "Extract the main requirements from this document"
rawi ask --files config.json package.json "Compare these configuration files"
rawi ask --batch "src/**/*.{js,ts}" "Review all TypeScript/JavaScript files for consistency"
rawi ask --file database-schema.sql --act database-admin "Analyze this schema for optimization"
rawi ask --file error-logs.txt "Analyze these logs and suggest solutions"
Supported File Formats:
- 📄 PDF — Extract text from PDF documents
- 📝 DOCX — Microsoft Word documents
- 📊 XLSX — Excel spreadsheets with sheet selection
- 📋 Text Files — .txt, .md, .json, .js, .py, .sql, .yml, etc.
- 🔍 Source Code — All programming languages with syntax context
Advanced File Features:
rawi ask --file data.xlsx --sheet "Q4 Sales" "Analyze Q4 performance"
rawi ask --file data.unknown --file-type txt "Process this as plain text"
rawi ask --batch "docs/**/*.md" --parallel "Create a documentation index"
rawi ask --batch "**/*.json" --continue-on-error "Validate all JSON files"
rawi ask --file large-dataset.csv --verbose "Summarize this data"
📦 Installation
NPM (Recommended)
npm install -g rawi
yarn global add rawi
pnpm add -g rawi
bun add -g rawi
Alternative Package Managers
npx rawi ask "What is TypeScript?"
brew install rawi
scoop install rawi
Verify Installation
rawi --version
rawi info
Shell Completion (Optional)
Enable shell completion for faster and more efficient CLI usage:
rawi completion --install
rawi completion bash --install
rawi completion zsh --install
rawi completion fish --install
rawi completion bash
After installation, restart your terminal or source your shell profile:
source ~/.bashrc
source ~/.zshrc
source ~/.config/fish/config.fish
System Requirements
- Node.js: 18.0.0 or higher
- Operating System: Windows, macOS, Linux
- Terminal: Any modern terminal (Terminal.app, iTerm2, Windows Terminal, etc.)
Platform-Specific Notes
All platforms (Windows, macOS, Linux) support full rawi exec functionality with command generation, execution, and safety prompts.
🚦 Getting Started Guide
Step 1: Install Rawi
npm install -g rawi
Step 2: Choose Your AI Provider
Pick one of these popular options:
🔵 OpenAI (Recommended for beginners)
rawi configure --provider openai --model gpt-4o --api-key sk-your-key
🟢 Ollama (Free & Private)
ollama pull llama3.2
rawi configure --provider ollama --model llama3.2
🟣 Anthropic Claude (Great for analysis)
rawi configure --provider anthropic --model claude-3-5-sonnet-20241022 --api-key sk-ant-xxx
Step 3: Start Using Rawi
rawi ask "Explain the difference between REST and GraphQL"
echo "console.log('Hello World')" | rawi ask "Optimize this JavaScript code"
rawi ask --act security-expert "What are common web security vulnerabilities?"
Step 4: Explore Advanced Features
rawi act --list
rawi history
rawi provider --list
🤝 Contributing
We welcome contributions! Here's how you can help:
🐛 Found a Bug?
💡 Have an Idea?
🔧 Want to Code?
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature)
- Make your changes
- Add tests if applicable
- Commit your changes (
git commit -m 'Add some amazing feature')
- Push to the branch (
git push origin feature/amazing-feature)
- Open a Pull Request
📝 Improve Documentation
- Fix typos and improve clarity
- Add more examples and use cases
- Translate documentation to other languages
- Create video tutorials and guides
Read our full Contributing Guide for detailed information.
📚 Documentation
📄 License
Rawi is licensed under the MIT License.
👨💻 Author
Mohammad Abu Mattar
⭐ Show Your Support
If Rawi helps you be more productive, consider:
- ⭐ Star this repository on GitHub
- 🐛 Report bugs and suggest improvements
- 📝 Contribute to the codebase
- 📢 Share with your developer community
- 💝 Sponsor the project