Command Reference
Complete reference for all Rawi commands, options, and capabilities.
Overview
Section titled “Overview”Rawi (راوي) is a unified command-line tool to interact with multiple AI providers, manage chat sessions, and automate AI-powered workflows directly from your terminal.
Synopsis
Section titled “Synopsis”rawi [global-options] <command> [command-options] [arguments]
Use rawi <command> --help
for information on a specific command.
Global Options
Section titled “Global Options”Option | Type | Description |
---|---|---|
--debug | boolean | Turn on debug logging. |
--profile <profile> | string | Use a specific profile from your configuration. |
--output <format> | string | The formatting style for command output. Options: json , text , table , yaml , yaml-stream |
--region <region> | string | The region to use (for cloud providers). Overrides config/env settings. |
--color <mode> | string | Turn on/off color output. Options: on , off , auto |
--version | Display the version of this tool. | |
--no-paginate | boolean | Disable automatic pagination for commands that support it. |
--no-cli-pager | boolean | Disable CLI pager for output. |
--cli-auto-prompt | boolean | Automatically prompt for CLI input parameters. |
--no-cli-auto-prompt | boolean | Disable automatic prompt for CLI input parameters. |
--ca-bundle <file> | string | The CA certificate bundle to use when verifying SSL certificates. |
--endpoint-url <url> | string | Override the default API endpoint URL. |
--no-verify-ssl | boolean | Do not verify SSL certificates. |
--no-sign-request | boolean | Do not sign requests (for local providers). |
Core Commands
Section titled “Core Commands”ask — AI Conversations
Section titled “ask — AI Conversations”Start conversations with AI providers. Supports streaming responses, file attachments, act templates, and session management.
Quick Examples:
# Simple questionrawi ask "Explain async/await in JavaScript"
# With file contextrawi ask "Review this code" --file src/app.js
# Using act templaterawi ask "Optimize this SQL" --act database_expert
# Continue previous sessionrawi ask "Add error handling" --continue
Use Cases:
- Code reviews and debugging
- Technical explanations
- Creative writing
- Data analysis
- Problem solving
configure — Setup & Management
Section titled “configure — Setup & Management”Configure AI providers, manage profiles, and customize Rawi’s behavior. Supports interactive setup and manual configuration.
Quick Examples:
# Interactive setup (recommended for first-time users)rawi configure
# Manual OpenAI setuprawi configure --provider openai --model gpt-4o --api-key sk-your-key
# Work profile setuprawi configure --profile work --provider azure --resource-name company-openai
# List all profilesrawi configure --list
Use Cases:
- Initial setup and onboarding
- Multiple provider management
- Team configuration standardization
- Environment-specific settings
history — Conversation Management
Section titled “history — Conversation Management”Search, manage, export, and analyze your AI conversation history and sessions.
Quick Examples:
# Show recent conversationsrawi history
# Search conversationsrawi history --search "docker deployment"
# Export historyrawi history export --format json --output backup.json
# Usage statisticsrawi history stats --from 2024-01-01
Use Cases:
- Finding previous solutions
- Conversation analytics
- Data export and backup
- Usage monitoring
info — System Information
Section titled “info — System Information”Get detailed information about your Rawi installation, configuration, and system status.
Quick Examples:
# System overviewrawi info
# Profile detailsrawi info --profiles
# Provider statusrawi info --providers
Use Cases:
- Configuration troubleshooting
- System health monitoring
- Support information gathering
- Setup verification
exec — Command Execution
Section titled “exec — Command Execution”Convert natural language descriptions into executable CLI commands with safety validation and confirmation prompts.
Quick Examples:
# Simple file operationsrawi exec "list all files in current directory"
# Preview dangerous operationsrawi exec "delete old log files" --dry-run
# System operationsrawi exec "check memory usage"
Use Cases:
- Server management and monitoring
- Complex file operations and data processing
- Development workflows and git operations
- Learning CLI tools and best practices
Supported AI Providers
Section titled “Supported AI Providers”Provider | Models Available | API Key Required | Local | Best For |
---|---|---|---|---|
OpenAI | GPT-4, GPT-4o, GPT-3.5 | Yes | No | General, coding, creative |
Anthropic | Claude 3.5 Sonnet | Yes | No | Safety, long-form analysis |
Gemini 1.5 Pro | Yes | No | Fast, multimodal | |
Ollama | Llama 2, CodeLlama | No | Yes | Privacy, offline, free |
Azure | GPT-4, GPT-3.5 | Yes + Resource | No | Enterprise, compliance |
Bedrock | Claude, Llama | AWS Credentials | No | AWS integration, enterprise |
xAI | Grok | Yes | No | Real-time, conversational |
LM Studio | Various Local Models | No | Yes | Local hosting, custom models |
Provider Setup Quick Reference
Section titled “Provider Setup Quick Reference”# OpenAIrawi configure --provider openai --model gpt-4o --api-key sk-your-key
# Anthropicrawi configure --provider anthropic --model claude-3-5-sonnet-20241022 --api-key sk-ant-your-key
# Ollama (local)rawi configure --provider ollama --model llama2
# Azure OpenAIrawi configure --provider azure --model gpt-4 --api-key your-key --resource-name your-resource
# AWS Bedrockrawi configure --provider bedrock --model anthropic.claude-3-sonnet --region us-east-1 --use-provider-chain
Command Patterns
Section titled “Command Patterns”Basic Usage Patterns
Section titled “Basic Usage Patterns”# Question → Answerrawi ask "What is Docker?"
# Configuration → Usagerawi configure --provider openairawi ask "Hello world"
# History → Search → Reuserawi history --search "deployment"rawi ask "Continue that deployment discussion" --continue abc123
Advanced Workflows
Section titled “Advanced Workflows”# Code Review Workflowrawi ask "Review this PR" --file changes.diff --act code_reviewer --profile work
# Data Analysis Workflowrawi ask "Analyze this dataset" --file data.csv --act data_analyst --temperature 0.1
# Writing Workflowrawi ask "Write a blog post about AI" --act content_writer --temperature 0.8 --max-tokens 3000
Automation Patterns
Section titled “Automation Patterns”# Automated code reviewgit diff HEAD~1 | rawi ask "Review these changes" --act code_reviewer --profile ci
# Daily standup preprawi ask "Summarize yesterday's commits" --file $(git log --since="1 day ago" --pretty=format:"%h %s")
# Documentation generationrawi ask "Generate README for this project" --file package.json --act documentation_expert
Environment Integration
Section titled “Environment Integration”Shell Integration
Section titled “Shell Integration”Add to your .bashrc
or .zshrc
:
# Quick ask aliasalias ask='rawi ask'
# Code review aliasalias review='rawi ask --act code_reviewer'
# Git commit message helperalias commit-msg='git diff --cached | rawi ask "Write a commit message for these changes" --max-tokens 100'
IDE Integration
Section titled “IDE Integration”Most IDEs can be configured to run Rawi commands:
# VS Code task{ "label": "AI Code Review", "type": "shell", "command": "rawi ask 'Review the current file' --file ${file} --act code_reviewer"}
CI/CD Integration
Section titled “CI/CD Integration”# GitHub Actions example- name: AI Code Review run: | git diff origin/main...HEAD | rawi ask "Review this PR" --act code_reviewer --profile ci > review.md gh pr comment --body-file review.md
Configuration Management
Section titled “Configuration Management”Profile Strategy
Section titled “Profile Strategy”# Development profilesrawi configure --profile dev-fast --provider openai --model gpt-3.5-turbo --temperature 0.3rawi configure --profile dev-thorough --provider anthropic --model claude-3-5-sonnet --temperature 0.1
# Work profilesrawi configure --profile work --provider azure --model gpt-4 --resource-name company-airawi configure --profile personal --provider openai --model gpt-4o --api-key personal-key
# Specialized profilesrawi configure --profile code-review --provider anthropic --temperature 0.1 --max-tokens 4000rawi configure --profile creative --provider openai --temperature 0.9 --max-tokens 3000
Environment Variables
Section titled “Environment Variables”# Default configurationexport RAWI_PROFILE="work"export RAWI_PROVIDER="openai"export RAWI_MODEL="gpt-4"
# API keysexport OPENAI_API_KEY="sk-your-openai-key"export ANTHROPIC_API_KEY="sk-ant-your-anthropic-key"export GOOGLE_API_KEY="your-google-key"
Best Practices
Section titled “Best Practices”Security
Section titled “Security”- API Key Management: Use environment variables for production
- Profile Separation: Different profiles for different security contexts
- Local Providers: Use Ollama for sensitive data
- History Management: Regular cleanup of conversation history
Performance
Section titled “Performance”- Model Selection: Choose appropriate models for your use case
- Token Limits: Set reasonable limits to control costs
- Temperature Settings: Lower for factual tasks, higher for creative
- Streaming: Enable streaming for real-time feedback
Organization
Section titled “Organization”- Meaningful Profiles: Use descriptive names like
work-gpt4
,local-dev
- Consistent Naming: Standardize profile naming across teams
- Documentation: Document your profile configurations
- Regular Maintenance: Clean up unused profiles and history
Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”Command not found:
# Check installationwhich rawi# Reinstall if needednpm install -g rawi
Configuration errors:
# Check configurationrawi info --profiles# Reset if neededrawi configure --reset
Provider connection issues:
# Test configurationrawi configure --test# Check network connectivityping api.openai.com
History issues:
# Check history locationrawi info | grep "History:"# Fix permissions if neededchmod 755 ~/.config/rawi/
Getting Help
Section titled “Getting Help”# Command helprawi <command> --help
# System informationrawi info
# Debug moderawi --debug ask "test question"
# Verbose outputrawi ask "test" --verbose