FAQ
Common questions and answers about Rawi usage, configuration, and troubleshooting.
General Questions
Section titled “General Questions”What is Rawi?
Section titled “What is Rawi?”Rawi is a powerful command-line interface (CLI) tool that brings AI assistance directly to your terminal. It allows you to interact with various AI providers (OpenAI, Anthropic, Google, DeepSeek, Mistral, Cerebras, etc.) to help with coding, writing, analysis, and many other tasks.
How is Rawi different from other AI tools?
Section titled “How is Rawi different from other AI tools?”- Terminal-native: Works directly in your command line
- Multiple providers: Support for OpenAI, Anthropic, Google, DeepSeek, Mistral, Cerebras, Ollama, LM Studio, Azure, Bedrock, Qwen, and xAI
- Session management: Maintain conversation context across commands
- Act templates: Pre-built prompts for specific tasks
- Shell integration: Pipe data in/out of other commands
- Profile support: Different configurations for different use cases
Is Rawi free to use?
Section titled “Is Rawi free to use?”Rawi itself is free and open-source. However, you’ll need API access to AI providers:
- Free options: Ollama (local), some providers offer free tiers
- Paid options: OpenAI, Anthropic, Google (pay per usage)
- Cost: Typically cents per request for most use cases
Installation and Setup
Section titled “Installation and Setup”What are the system requirements?
Section titled “What are the system requirements?”- Node.js: Version 18 or higher
- Operating System: Windows, macOS, or Linux
- Internet: Required for cloud AI providers (not needed for local providers like Ollama)
- API Keys: Required for cloud providers
How do I install Rawi?
Section titled “How do I install Rawi?”# Install globally via npmnpm install -g rawi
# Or using other package managersyarn global add rawipnpm add -g rawibun add -g rawi
# Use without installing (npx)npx rawi ask "What is TypeScript?"
How do I get started after installation?
Section titled “How do I get started after installation?”# Run interactive configurationrawi configure
# Check your setuprawi info
# Ask your first questionrawi ask "Hello, how can you help me?"
How do I get API keys for different providers?
Section titled “How do I get API keys for different providers?”OpenAI:
- Visit platform.openai.com
- Sign up or log in
- Go to API Keys section
- Create new secret key
Anthropic:
- Visit console.anthropic.com
- Sign up or log in
- Go to API Keys
- Generate new key
Google:
- Visit Google AI Studio
- Sign in with Google account
- Get API key from settings
Ollama (Local):
- Install from ollama.ai
- Run
ollama pull llama2
(or other models) - No API key needed
Usage Questions
Section titled “Usage Questions”How do I ask questions effectively?
Section titled “How do I ask questions effectively?”-
Be specific and provide context:
Terminal window # Goodrawi ask "How do I handle async/await errors in JavaScript when making API calls?"# Too vaguerawi ask "Help with JavaScript" -
Include relevant information:
Terminal window rawi ask "In a React TypeScript app, how do I handle form validation with Formik?" -
Use act templates for specialized help:
Terminal window rawi ask --act code-reviewer "Review this Python function for improvements"
What are act templates?
Section titled “What are act templates?”Act templates are pre-built prompts that transform your AI into specialized experts:
# List all templatesrawi act --list
# Get template detailsrawi act --show software-engineer
# Use a templaterawi ask --act code-reviewer "Review this code for issues"
Popular templates include:
software-engineer
— General development helpcode-reviewer
— Code analysis and improvementstechnical-writer
— Documentation assistancedebugging-expert
— Help with bugs and errors
How do sessions work?
Section titled “How do sessions work?”Sessions maintain conversation context across multiple interactions:
# Start a new sessionrawi ask --new-session "I'm building a REST API in Node.js"
# Continue the conversation (remembers context)rawi ask "How do I add authentication?"rawi ask "What about rate limiting?"
# List your sessionsrawi history --sessions
# Continue a specific sessionrawi ask --session abc123 "Let's continue our API discussion"
How do I use profiles?
Section titled “How do I use profiles?”Profiles store different configurations for different use cases:
# Create profilesrawi configure --profile work --provider openai --model gpt-4rawi configure --profile personal --provider anthropic --model claude-3-5-sonnet
# Use profilesrawi ask --profile work "Help me with this enterprise code"rawi ask --profile personal "Write a creative story"
# List profilesrawi configure --list
Configuration Questions
Section titled “Configuration Questions”How do I switch between AI providers?
Section titled “How do I switch between AI providers?”# Configure different providersrawi configure --provider openai --api-key sk-your-keyrawi configure --provider anthropic --api-key sk-ant-your-key
# Use specific profilerawi ask --profile openai-profile "Your question"
# Change default providerrawi configure --provider anthropic --set-default
Can I use multiple models?
Section titled “Can I use multiple models?”Yes! You can configure different profiles with different models:
# Fast/cheap model for quick questionsrawi configure --profile quick --provider openai --model gpt-3.5-turbo
# Powerful model for complex tasksrawi configure --profile powerful --provider openai --model gpt-4
# Local model for privacyrawi configure --profile private --provider ollama --model llama2
How do I configure environment variables?
Section titled “How do I configure environment variables?”# Set API keys as environment variablesexport OPENAI_API_KEY="sk-your-key"export ANTHROPIC_API_KEY="sk-ant-your-key"
# Default profileexport RAWI_PROFILE="work"
# Add to your shell config (.bashrc, .zshrc)echo 'export OPENAI_API_KEY="sk-your-key"' >> ~/.bashrc
Where are configuration files stored?
Section titled “Where are configuration files stored?”- Linux/macOS:
~/.config/rawi/
- Windows:
%APPDATA%/rawi/
Files include:
config.json
— Main configurationprofiles/
— Profile configurationshistory/
— Session history
Shell Integration
Section titled “Shell Integration”How do I pipe data to Rawi?
Section titled “How do I pipe data to Rawi?”# Analyze filescat app.js | rawi ask --act code-reviewer "Review this code"
# Process command outputps aux | rawi ask "Which processes are using the most memory?"
# Analyze logstail -f app.log | rawi ask "Monitor for any critical errors"
# Git integrationgit diff | rawi ask "Summarize these changes"
How do I save Rawi output?
Section titled “How do I save Rawi output?”# Save to filerawi ask "Explain Docker containers" > docker-notes.txt
# Append to filerawi ask "More Docker info" >> docker-notes.txt
# Pipe to other commandsrawi ask "Generate JSON data" | jq '.'
Can I use Rawi in scripts?
Section titled “Can I use Rawi in scripts?”Yes! Rawi works great in automation scripts:
#!/bin/bash# Code review scriptfor file in src/*.js; do echo "Reviewing $file..." cat "$file" | rawi ask --act code-reviewer "Quick review" > "reviews/$(basename "$file").md"done
Troubleshooting
Section titled “Troubleshooting””Command not found: rawi”
Section titled “”Command not found: rawi””Cause: Rawi not installed or not in PATH
Solutions:
# Reinstall globallynpm install -g rawi
# Check installationnpm list -g rawi
# Use npx if global install failsnpx rawi ask "test"
“No provider configured”
Section titled ““No provider configured””Cause: No AI provider set up
Solution:
# Run interactive configurationrawi configure
# Or configure manuallyrawi configure --provider openai --api-key sk-your-key
“API key not found” or “Authentication failed”
Section titled ““API key not found” or “Authentication failed””Cause: Invalid or missing API key
Solutions:
# Check current configurationrawi configure --show
# Update API keyrawi configure --provider openai --api-key sk-your-new-key
# Verify with environment variableexport OPENAI_API_KEY="sk-your-key"rawi info
“Request failed” or “Network error”
Section titled ““Request failed” or “Network error””Possible causes and solutions:
- Internet connection: Check your network
- API limits: Wait and try again, or upgrade your plan
- Invalid model: Check available models with
rawi provider --models openai
- Provider outage: Try a different provider or wait
# Test with different providerrawi configure --provider anthropicrawi ask "test connection"
# Check API statuscurl -s https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY"
Sessions not working properly
Section titled “Sessions not working properly”Solutions:
# List sessions to check IDsrawi history --sessions
# Clear corrupted sessionsrawi history --cleanup
# Start fresh sessionrawi ask --new-session "Starting fresh conversation"
Large input/output issues
Section titled “Large input/output issues”Solutions:
# Limit input sizehead -100 large-file.txt | rawi ask "Analyze this sample"
# Break large requests into chunkssplit -l 50 large-file.txt chunk_for chunk in chunk_*; do cat "$chunk" | rawi ask "Process this section"done
Performance issues
Section titled “Performance issues”Optimization tips:
-
Use appropriate models:
Terminal window # Fast for simple tasksrawi configure --model gpt-3.5-turbo# Powerful for complex tasksrawi configure --model gpt-4 -
Limit context size:
Terminal window # Use shorter, focused questionsrawi ask "Quick summary of this error" < error.log -
Local providers for speed:
Terminal window # Use Ollama for fast local responsesrawi configure --provider ollama --model llama2
Advanced Usage
Section titled “Advanced Usage”How do I create custom workflows?
Section titled “How do I create custom workflows?”Create shell scripts that combine Rawi with other tools:
#!/bin/bashcase "$1" in "review") git diff | rawi ask --act code-reviewer "Review these changes" ;; "commit") git diff --cached | rawi ask "Generate commit message" ;; "debug") cat "$2" | rawi ask --act debugging-expert "Help debug this code" ;;esac
Can I integrate Rawi with my IDE?
Section titled “Can I integrate Rawi with my IDE?”Yes! Many ways to integrate:
VS Code: Create tasks or use terminal integration Vim/Neovim: Shell commands and custom functions Command palette: Add shell commands to your IDE
Example VS Code task:
{ "label": "AI Code Review", "type": "shell", "command": "cat ${file} | rawi ask --act code-reviewer 'Review this code'"}
How do I backup my configuration?
Section titled “How do I backup my configuration?”# Backup configuration directorycp -r ~/.config/rawi/ ~/rawi-backup/
# Export specific profilerawi configure --profile work --export > work-profile.json
# Export session historyrawi history --export --format json > history-backup.json
Can I use Rawi offline?
Section titled “Can I use Rawi offline?”Partially! Use local providers:
# Install Ollamacurl -fsSL https://ollama.ai/install.sh | sh
# Pull a modelollama pull llama2
# Configure Rawirawi configure --provider ollama --model llama2
# Now works offlinerawi ask "Help me with this code"
Best Practices
Section titled “Best Practices”Security Best Practices
Section titled “Security Best Practices”-
Protect API keys:
Terminal window # Use environment variablesexport OPENAI_API_KEY="sk-your-key"# Don't commit keys to gitecho "*.env" >> .gitignore -
Use local providers for sensitive data:
Terminal window # Ollama for private coderawi configure --profile private --provider ollama -
Regular key rotation:
Terminal window # Update keys periodicallyrawi configure --provider openai --api-key sk-new-key
Cost Management
Section titled “Cost Management”-
Use appropriate models:
Terminal window # Cheap for simple tasksrawi configure --profile budget --model gpt-3.5-turbo# Expensive for complex tasksrawi configure --profile premium --model gpt-4 -
Monitor usage:
Terminal window # Check API usage on provider websites# Set up billing alerts -
Use local providers when possible:
Terminal window # Free with Ollamarawi configure --provider ollama --model llama2
Productivity Tips
Section titled “Productivity Tips”-
Create aliases:
Terminal window alias rwask='rawi ask'alias rwreview='rawi ask --act code-reviewer'alias rwwrite='rawi ask --act technical-writer' -
Use sessions effectively:
Terminal window # Topic-focused sessionsrawi ask --new-session --session project-auth "Working on authentication" -
Combine with other tools:
Terminal window # Git integrationgit diff | rawi ask --act code-reviewer "Review changes" | tee review.md
Getting Help
Section titled “Getting Help”Where can I get more help?
Section titled “Where can I get more help?”- GitHub Repository: github.com/withrawi/rawi
- Documentation: This documentation site
- Issues: Report bugs on GitHub Issues
- Discussions: Community discussions on GitHub
How do I report bugs?
Section titled “How do I report bugs?”- Check existing issues on GitHub
- Provide reproduction steps
- Include system information:
Terminal window rawi infonode --versionnpm --version - Include error messages and logs
How do I request features?
Section titled “How do I request features?”- Check GitHub Issues for existing requests
- Create a new issue with:
- Clear description of the feature
- Use cases and benefits
- Possible implementation approach
See Also
Section titled “See Also”- Installation Guide — Detailed installation instructions
- Quick Start Guide — Get started quickly
- Troubleshooting — Detailed troubleshooting guide
- Configuration Guide — Complete configuration reference