Quick Start Guide
Get started with Rawi in just a few minutes! This guide will walk you through your first AI conversation and essential features.
Prerequisites
Section titled “Prerequisites”Before starting, make sure you have:
✅ Rawi installed — See Installation Guide
✅ At least one provider configured — Run rawi configure
if needed
✅ Terminal open — Any modern terminal will work
Quick Check
Section titled “Quick Check”Verify your setup:
# Check versionrawi --version
# Verify configurationrawi info
Your First Question
Section titled “Your First Question”Let’s start with a simple question to test your setup:
rawi ask "What is the difference between JavaScript and TypeScript?"
What You’ll See
Section titled “What You’ll See”$ rawi ask "What is the difference between JavaScript and TypeScript?"
🤖 JavaScript and TypeScript are both programming languages, but TypeScriptis essentially JavaScript with static type checking. Here are the keydifferences:
**JavaScript:**- Dynamic typing (variables can change types)- Runtime error detection- No compilation step required- Runs directly in browsers and Node.js- More flexible but potentially error-prone
**TypeScript:**- Static typing (types are checked at compile time)- Compile-time error detection- Compiles to JavaScript- Better IDE support and autocomplete- More verbose but safer for large applications
TypeScript is particularly useful for larger projects where type safetyhelps prevent common programming errors.
🎉 Congratulations! You’ve just had your first AI conversation with Rawi.
Understanding Profiles
Section titled “Understanding Profiles”Profiles allow you to use different AI providers for different tasks. Let’s explore your current setup:
Check Your Current Profile
Section titled “Check Your Current Profile”# Show current configurationrawi configure --show
# List all profilesrawi configure --list
Using Different Profiles
Section titled “Using Different Profiles”If you have multiple profiles configured:
# Use a specific profilerawi ask "Explain React hooks" --profile work
# Set a default profilerawi configure --profile personal --set-default
Creating Additional Profiles
Section titled “Creating Additional Profiles”# Create a work profilerawi configure --profile work --provider anthropic --model claude-3-5-sonnet-20241022
# Create a local profile for privacyrawi configure --profile local --provider ollama --model llama2
Using Act Templates
Section titled “Using Act Templates”Act templates are pre-written prompts that make Rawi behave like specific experts:
List Available Templates
Section titled “List Available Templates”# Show all available act templatesrawi act --list
Using Templates
Section titled “Using Templates”# Act as a code reviewerrawi ask "Review this function" --act code_reviewer --file mycode.js
# Act as a Linux terminalrawi ask "ls -la" --act linux_terminal
# Act as a technical writerrawi ask "Document this API" --act technical_writer
Popular Templates
Section titled “Popular Templates”- code_reviewer — Expert code analysis and suggestions
- linux_terminal — Simulates Linux command execution
- javascript_console — JavaScript interpreter behavior
- english_translator — Translation and language help
- plagiarism_checker — Content originality analysis
- cyber_security_specialist — Security-focused advice
Session Management
Section titled “Session Management”Rawi automatically manages conversation sessions for context continuity:
Continue Conversations
Section titled “Continue Conversations”# Start a conversationrawi ask "Explain REST APIs"
# Continue the conversation (automatic session)rawi ask "Now show me an example in Node.js"
# Explicitly continue a specific sessionrawi ask "Add error handling" --continue abc123-def456
Session Commands
Section titled “Session Commands”# List recent sessionsrawi history
# Show specific sessionrawi history show abc123-def456
# Search conversationsrawi history --search "REST API"
Working with Files
Section titled “Working with Files”Rawi can analyze and work with your files:
Single File Analysis
Section titled “Single File Analysis”# Code reviewrawi ask "Review this code for bugs" --file src/app.js
# Documentationrawi ask "Generate README for this project" --file package.json
# Explanationrawi ask "Explain what this function does" --file utils.py
Multiple Files
Section titled “Multiple Files”# Analyze multiple filesrawi ask "Review these components" --file src/Header.jsx --file src/Footer.jsx
# Compare filesrawi ask "What's the difference between these implementations?" --file old.js --file new.js
Supported File Types
Section titled “Supported File Types”Rawi works with any text-based file:
- Source code (
.js
,.py
,.java
,.cpp
, etc.) - Configuration files (
.json
,.yaml
,.toml
) - Documentation (
.md
,.txt
,.rst
) - Data files (
.csv
,.sql
,.xml
)
Shell Integration Basics
Section titled “Shell Integration Basics”Enhance your terminal workflow with shell integration:
Useful Aliases
Section titled “Useful Aliases”Add these to your shell profile (.bashrc
, .zshrc
):
# Quick ask aliasalias ask='rawi ask'
# Code review workflowalias review='rawi ask --act code_reviewer'
# Terminal simulationalias term='rawi ask --act linux_terminal'
# Quick continuationalias chat='rawi ask --continue'
Command Integration
Section titled “Command Integration”# Git commit message helpergit diff --cached | rawi ask "Write a commit message for these changes"
# Log analysistail -f /var/log/app.log | rawi ask "Analyze these logs for errors"
# Quick documentationls -la | rawi ask "Explain what these files do" --act technical_writer
Pipe Integration
Section titled “Pipe Integration”# Pipe output to Rawiecho "console.log('hello')" | rawi ask "Explain this code"
# Combine with other toolscurl -s https://api.github.com/repos/microsoft/vscode | rawi ask "Summarize this repo data"
Common Use Cases
Section titled “Common Use Cases”Development Workflow
Section titled “Development Workflow”# Code reviewrawi ask "Review this PR for security issues" --file changes.diff --act cyber_security_specialist
# Debug assistancerawi ask "Why is this code throwing an error?" --file buggy.py
# Optimizationrawi ask "How can I optimize this database query?" --file slow_query.sql
Learning and Exploration
Section titled “Learning and Exploration”# Concept explanationrawi ask "Explain microservices architecture with examples"
# Technology comparisonrawi ask "Compare React vs Vue.js for a new project" --profile work
# Tutorial creationrawi ask "Create a beginner's guide to Docker" --act technical_writer
Content Creation
Section titled “Content Creation”# Blog writingrawi ask "Write a blog post about AI in software development" --act content_writer
# Documentationrawi ask "Create API documentation for this endpoint" --file api.js --act technical_writer
# README generationrawi ask "Generate a comprehensive README" --file package.json
Data Analysis
Section titled “Data Analysis”# CSV analysisrawi ask "Analyze this sales data and find trends" --file sales.csv --act data_analyst
# Log interpretationrawi ask "Find error patterns in these logs" --file error.log
# Performance reviewrawi ask "Analyze this performance report" --file metrics.json
Configuration Best Practices
Section titled “Configuration Best Practices”Multiple Provider Setup
Section titled “Multiple Provider Setup”# Fast responses for quick questionsrawi configure --profile quick --provider openai --model gpt-3.5-turbo --temperature 0.3
# Cost-effective with reasoningrawi configure --profile budget --provider deepseek --model deepseek-chat --temperature 0.2
# European AI with GDPR compliancerawi configure --profile europe --provider mistral --model mistral-large-latest --temperature 0.5
# Ultra-fast inferencerawi configure --profile speed --provider cerebras --model llama3.1-70b --temperature 0.7
# Detailed analysisrawi configure --profile detailed --provider anthropic --model claude-3-5-sonnet-20241022 --temperature 0.1
# Local privacy-focusedrawi configure --profile local --provider ollama --model llama3.2
# Work environmentrawi configure --profile work --provider azure --model gpt-4 --resource-name company-ai
Environment-Specific Profiles
Section titled “Environment-Specific Profiles”# Development environmentrawi configure --profile dev --provider openai --model gpt-4o --temperature 0.2
# Production supportrawi configure --profile prod --provider anthropic --model claude-3-5-sonnet-20241022 --temperature 0.1
# Research and experimentationrawi configure --profile research --provider google --model gemini-1.5-pro --temperature 0.8
Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”Command not found:
# Verify installationwhich rawirawi --version
No providers configured:
# Run interactive configurationrawi configure
# Check current statusrawi info
API key issues:
# Test configurationrawi configure --test
# Reconfigure providerrawi configure --provider openai --api-key sk-new-key
Session not found:
# List available sessionsrawi history
# Start new sessionrawi ask "Hello" --new-session
Getting Help
Section titled “Getting Help”# Command helprawi --helprawi ask --help
# Provider informationrawi info --providers
# Debug moderawi --debug ask "test question"
Next Steps
Section titled “Next Steps”Now that you’re comfortable with the basics:
-
Explore Advanced Features:
-
Learn Workflows:
-
Configure More Providers:
-
Join the Community:
Quick Reference
Section titled “Quick Reference”Essential Commands
Section titled “Essential Commands”# Configurationrawi configure # Interactive setuprawi configure --list # List profilesrawi info # System information
# Conversationsrawi ask "question" # Basic questionrawi ask "question" --file code.js # With file contextrawi ask "question" --act expert # With act templaterawi ask "question" --profile work # Specific profile
# Historyrawi history # List sessionsrawi history --search "keyword" # Search conversationsrawi history show session-id # Show specific session
# Templatesrawi act --list # List all templatesrawi act --search "code" # Search templates
Useful Aliases
Section titled “Useful Aliases”alias ask='rawi ask'alias review='rawi ask --act code_reviewer'alias explain='rawi ask --act explainer'alias fix='rawi ask --act debugger'
Happy chatting with AI! 🤖✨
TypeScript:
- Superset of JavaScript with static typing
- Compile-time type checking
- Compiles to JavaScript
- Helps catch errors early in development
- Better tooling and IDE support
The main advantage of TypeScript is that it helps prevent common programming errors by catching them during development rather than at runtime.
## Understanding Profiles
Profiles let you use different AI providers and settings for different projects:
```bash# List available profilesrawi configure --list
# Create a new profile for work projectsrawi configure --profile work --provider openai --model gpt-4
# Use a specific profilerawi ask --profile work "How do I optimize this SQL query?"
Using Act Templates
Section titled “Using Act Templates”Act templates transform your AI into specialized experts:
# Browse available templatesrawi act --list
# Use a template for code reviewrawi ask --act code-reviewer "Review this Python function for improvements"
# Get help with Linux commandsrawi ask --act linux-terminal "Find all files larger than 100MB"
Popular Templates
Section titled “Popular Templates”software-engineer
— General development helpcode-reviewer
— Code analysis and improvementslinux-terminal
— Command line assistancetechnical-writer
— Documentation helpdata-scientist
— Data analysis and visualization
Session Management
Section titled “Session Management”Sessions maintain conversation context across multiple questions:
# Start a new sessionrawi ask --new-session "I'm building a REST API in Node.js"
# Continue the conversation (Rawi remembers the context)rawi ask "What's the best way to handle authentication?"rawi ask "How do I add rate limiting?"
# List your sessionsrawi history --sessions
# Continue a previous sessionrawi ask --session abc123 "Can you explain JWT tokens?"
Shell Integration Basics
Section titled “Shell Integration Basics”Rawi works perfectly with shell pipes and redirects:
# Analyze log filestail -f app.log | rawi ask "Summarize any errors in this log"
# Code analysiscat src/app.js | rawi ask --act code-reviewer "Review this code"
# Save AI responsesrawi ask "Explain Docker containers" > docker-notes.txt
# Process datacurl -s api/data.json | rawi ask "Analyze this JSON data"
Essential Commands
Section titled “Essential Commands”Here are the commands you’ll use most often:
# Basic questionrawi ask "your question here"
# With templaterawi ask --act template-name "your question"
# With profilerawi ask --profile work "your question"
# Continue sessionrawi ask --session session-id "follow-up question"
# Get helprawi --helprawi ask --help
Next Steps
Section titled “Next Steps”Now that you’re familiar with the basics:
- Explore Templates — Run
rawi act --list
to see all available expert templates - Set Up Multiple Profiles — Configure different providers for different projects
- Learn Advanced Features — Check out Shell Integration and Workflows
- Join the Community — Visit our GitHub repository for updates and discussions
Common First-Time Issues
Section titled “Common First-Time Issues”“No provider configured”
rawi configure # Run interactive setup
“API key not found”
rawi configure --provider openai --api-key your-key-here
“Command not found”
npm install -g rawi # Reinstall globally
Happy coding with Rawi! 🚀