Skip to content

Command Reference

Complete reference for all Rawi commands, options, and capabilities.

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.

rawi [global-options] <command> [command-options] [arguments]

Use rawi <command> --help for information on a specific command.

OptionTypeDescription
--debugbooleanTurn on debug logging.
--profile <profile>stringUse a specific profile from your configuration.
--output <format>stringThe formatting style for command output.
Options: json, text, table, yaml, yaml-stream
--region <region>stringThe region to use (for cloud providers). Overrides config/env settings.
--color <mode>stringTurn on/off color output. Options: on, off, auto
--versionDisplay the version of this tool.
--no-paginatebooleanDisable automatic pagination for commands that support it.
--no-cli-pagerbooleanDisable CLI pager for output.
--cli-auto-promptbooleanAutomatically prompt for CLI input parameters.
--no-cli-auto-promptbooleanDisable automatic prompt for CLI input parameters.
--ca-bundle <file>stringThe CA certificate bundle to use when verifying SSL certificates.
--endpoint-url <url>stringOverride the default API endpoint URL.
--no-verify-sslbooleanDo not verify SSL certificates.
--no-sign-requestbooleanDo not sign requests (for local providers).

Start conversations with AI providers. Supports streaming responses, file attachments, act templates, and session management.

Quick Examples:

Terminal window
# Simple question
rawi ask "Explain async/await in JavaScript"
# With file context
rawi ask "Review this code" --file src/app.js
# Using act template
rawi ask "Optimize this SQL" --act database_expert
# Continue previous session
rawi ask "Add error handling" --continue

Use Cases:

  • Code reviews and debugging
  • Technical explanations
  • Creative writing
  • Data analysis
  • Problem solving

Configure AI providers, manage profiles, and customize Rawi’s behavior. Supports interactive setup and manual configuration.

Quick Examples:

Terminal window
# Interactive setup (recommended for first-time users)
rawi configure
# Manual OpenAI setup
rawi configure --provider openai --model gpt-4o --api-key sk-your-key
# Work profile setup
rawi configure --profile work --provider azure --resource-name company-openai
# List all profiles
rawi configure --list

Use Cases:

  • Initial setup and onboarding
  • Multiple provider management
  • Team configuration standardization
  • Environment-specific settings

Search, manage, export, and analyze your AI conversation history and sessions.

Quick Examples:

Terminal window
# Show recent conversations
rawi history
# Search conversations
rawi history --search "docker deployment"
# Export history
rawi history export --format json --output backup.json
# Usage statistics
rawi history stats --from 2024-01-01

Use Cases:

  • Finding previous solutions
  • Conversation analytics
  • Data export and backup
  • Usage monitoring

Get detailed information about your Rawi installation, configuration, and system status.

Quick Examples:

Terminal window
# System overview
rawi info
# Profile details
rawi info --profiles
# Provider status
rawi info --providers

Use Cases:

  • Configuration troubleshooting
  • System health monitoring
  • Support information gathering
  • Setup verification

Convert natural language descriptions into executable CLI commands with safety validation and confirmation prompts.

Quick Examples:

Terminal window
# Simple file operations
rawi exec "list all files in current directory"
# Preview dangerous operations
rawi exec "delete old log files" --dry-run
# System operations
rawi 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
ProviderModels AvailableAPI Key RequiredLocalBest For
OpenAIGPT-4, GPT-4o, GPT-3.5YesNoGeneral, coding, creative
AnthropicClaude 3.5 SonnetYesNoSafety, long-form analysis
GoogleGemini 1.5 ProYesNoFast, multimodal
OllamaLlama 2, CodeLlamaNoYesPrivacy, offline, free
AzureGPT-4, GPT-3.5Yes + ResourceNoEnterprise, compliance
BedrockClaude, LlamaAWS CredentialsNoAWS integration, enterprise
xAIGrokYesNoReal-time, conversational
LM StudioVarious Local ModelsNoYesLocal hosting, custom models
Terminal window
# OpenAI
rawi configure --provider openai --model gpt-4o --api-key sk-your-key
# Anthropic
rawi configure --provider anthropic --model claude-3-5-sonnet-20241022 --api-key sk-ant-your-key
# Ollama (local)
rawi configure --provider ollama --model llama2
# Azure OpenAI
rawi configure --provider azure --model gpt-4 --api-key your-key --resource-name your-resource
# AWS Bedrock
rawi configure --provider bedrock --model anthropic.claude-3-sonnet --region us-east-1 --use-provider-chain
Terminal window
# Question → Answer
rawi ask "What is Docker?"
# Configuration → Usage
rawi configure --provider openai
rawi ask "Hello world"
# History → Search → Reuse
rawi history --search "deployment"
rawi ask "Continue that deployment discussion" --continue abc123
Terminal window
# Code Review Workflow
rawi ask "Review this PR" --file changes.diff --act code_reviewer --profile work
# Data Analysis Workflow
rawi ask "Analyze this dataset" --file data.csv --act data_analyst --temperature 0.1
# Writing Workflow
rawi ask "Write a blog post about AI" --act content_writer --temperature 0.8 --max-tokens 3000
Terminal window
# Automated code review
git diff HEAD~1 | rawi ask "Review these changes" --act code_reviewer --profile ci
# Daily standup prep
rawi ask "Summarize yesterday's commits" --file $(git log --since="1 day ago" --pretty=format:"%h %s")
# Documentation generation
rawi ask "Generate README for this project" --file package.json --act documentation_expert

Add to your .bashrc or .zshrc:

Terminal window
# Quick ask alias
alias ask='rawi ask'
# Code review alias
alias review='rawi ask --act code_reviewer'
# Git commit message helper
alias commit-msg='git diff --cached | rawi ask "Write a commit message for these changes" --max-tokens 100'

Most IDEs can be configured to run Rawi commands:

Terminal window
# VS Code task
{
"label": "AI Code Review",
"type": "shell",
"command": "rawi ask 'Review the current file' --file ${file} --act code_reviewer"
}
# 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
Terminal window
# Development profiles
rawi configure --profile dev-fast --provider openai --model gpt-3.5-turbo --temperature 0.3
rawi configure --profile dev-thorough --provider anthropic --model claude-3-5-sonnet --temperature 0.1
# Work profiles
rawi configure --profile work --provider azure --model gpt-4 --resource-name company-ai
rawi configure --profile personal --provider openai --model gpt-4o --api-key personal-key
# Specialized profiles
rawi configure --profile code-review --provider anthropic --temperature 0.1 --max-tokens 4000
rawi configure --profile creative --provider openai --temperature 0.9 --max-tokens 3000
Terminal window
# Default configuration
export RAWI_PROFILE="work"
export RAWI_PROVIDER="openai"
export RAWI_MODEL="gpt-4"
# API keys
export OPENAI_API_KEY="sk-your-openai-key"
export ANTHROPIC_API_KEY="sk-ant-your-anthropic-key"
export GOOGLE_API_KEY="your-google-key"
  1. API Key Management: Use environment variables for production
  2. Profile Separation: Different profiles for different security contexts
  3. Local Providers: Use Ollama for sensitive data
  4. History Management: Regular cleanup of conversation history
  1. Model Selection: Choose appropriate models for your use case
  2. Token Limits: Set reasonable limits to control costs
  3. Temperature Settings: Lower for factual tasks, higher for creative
  4. Streaming: Enable streaming for real-time feedback
  1. Meaningful Profiles: Use descriptive names like work-gpt4, local-dev
  2. Consistent Naming: Standardize profile naming across teams
  3. Documentation: Document your profile configurations
  4. Regular Maintenance: Clean up unused profiles and history

Command not found:

Terminal window
# Check installation
which rawi
# Reinstall if needed
npm install -g rawi

Configuration errors:

Terminal window
# Check configuration
rawi info --profiles
# Reset if needed
rawi configure --reset

Provider connection issues:

Terminal window
# Test configuration
rawi configure --test
# Check network connectivity
ping api.openai.com

History issues:

Terminal window
# Check history location
rawi info | grep "History:"
# Fix permissions if needed
chmod 755 ~/.config/rawi/
Terminal window
# Command help
rawi <command> --help
# System information
rawi info
# Debug mode
rawi --debug ask "test question"
# Verbose output
rawi ask "test" --verbose