Get started with Rawi in just a few minutes! This guide will walk you through your first AI conversation and essential features.
- Prerequisites
- Your First Question
- Understanding Profiles
- Using Act Templates
- Session Management
- Shell Integration Basics
- Next Steps
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
Verify your setup:
# Check version
rawi --version
# Verify configuration
rawi infoLet's start with a simple question to test your setup:
rawi ask "What is the difference between JavaScript and TypeScript?"$ rawi ask "What is the difference between JavaScript and TypeScript?"
🤖 JavaScript and TypeScript are both programming languages, but TypeScript
is essentially JavaScript with static type checking. Here are the key
differences:
**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 safety
helps prevent common programming errors.🎉 Congratulations! You've just had your first AI conversation with Rawi.
Profiles allow you to use different AI providers for different tasks. Let's explore your current setup:
# Show current configuration
rawi configure --show
# List all profiles
rawi configure --listIf you have multiple profiles configured:
# Use a specific profile
rawi ask "Explain React hooks" --profile work
# Shorter version
rawi ask "Explain React hooks" -p work# Create a profile for local AI
rawi configure --profile local --provider ollama --model llama3.2
# Create a profile for analysis work
rawi configure --profile analysis --provider anthropic --model claude-3-5-sonnet-20241022Act templates are pre-built prompts that make the AI behave like different experts. They're one of Rawi's most powerful features!
# List all templates (interactive)
rawi act --list
# Show details of a specific template
rawi act --show code-reviewer# Get a Linux terminal simulation
rawi ask --act linux-terminal "list files in home directory with details"
# Code review assistance
rawi ask --act code-reviewer "Review this Python function for improvements"
# Security expert analysis
rawi ask --act security-expert "What are common web vulnerabilities?"
# Ethereum developer guidance
rawi ask --act ethereum-developer "Explain smart contract security best practices"code-reviewer— Code analysis and optimizationlinux-terminal— Terminal command simulationsecurity-expert— Security analysis and auditingtech-writer— Technical documentationdatabase-admin— SQL optimization and database managementapi-documenter— API documentation and examples
Sessions allow you to have continuous conversations with context. Each question remembers previous ones in the same session.
# Start a new session
rawi ask "I'm building a React app with TypeScript" --new-session
# Continue the conversation (automatically uses current session)
rawi ask "How should I structure my components?"
# Ask a follow-up
rawi ask "What about state management?"# Continue a specific session later
rawi ask "What about testing strategies?" --session abc123-def456
# Start a new session for a different topic
rawi ask "Now I want to learn Python" --new-session# Show recent conversations
rawi history
# Show sessions only
rawi history sessions
# Show details of a specific session
rawi history show abc123-def456Rawi integrates seamlessly with your shell, making it perfect for developer workflows.
# Pipe file content for analysis
cat server.js | rawi ask "Review this Express.js server for security issues"
# Analyze git changes
git diff | rawi ask "Review these changes and suggest improvements"
# Process command output
ls -la | rawi ask "Explain these file permissions"
# Analyze logs
tail -100 app.log | rawi ask "Summarize these log entries"# Generate and save code
rawi ask "Create a TypeScript interface for a User" > user.ts
# Create documentation
rawi ask "Write README for a CLI tool" > README.md
# Generate configurations
rawi ask "Create ESLint config for React TypeScript" > .eslintrc.js# Search and analyze
grep ERROR app.log | rawi ask "Categorize these errors by type"
# Process API responses
curl -s api.example.com/data | rawi ask "Explain this API structure"
# Database analysis
echo "SELECT * FROM users LIMIT 5" | rawi ask --act database-admin "Optimize this query"# Simple question
rawi ask "Your question here"
# With specific profile
rawi ask "Your question" --profile work
# With expert template
rawi ask --act code-reviewer "Your code question"
# Start new session
rawi ask "Your question" --new-session# Interactive setup
rawi configure
# Show current config
rawi configure --show
# List all profiles
rawi configure --list# Show recent conversations
rawi history
# Search conversations
rawi history --search "docker"
# Show session details
rawi history show session-id# System info
rawi info
# Available providers
rawi provider --list
# Available templates
rawi act --list# Debug an error
rawi ask "Fix this Python error: NameError: name 'x' is not defined"
# Code review
git diff | rawi ask --act code-reviewer "Review these changes"
# Generate tests
cat utils.js | rawi ask "Generate unit tests for these functions"
# Create documentation
rawi ask --act tech-writer "Document this API endpoint" < api.js# Quick explanations
rawi ask "Explain async/await in JavaScript"
# Compare technologies
rawi ask "Compare React vs Vue.js for a small project"
# Best practices
rawi ask --act security-expert "Web security best practices for Node.js"# Analyze CSV data
cat data.csv | rawi ask "Analyze this sales data and identify trends"
# Process logs
grep ERROR app.log | rawi ask "What types of errors are most common?"
# Explain data structures
echo '{"users": [{"id": 1, "name": "John"}]}' | rawi ask "Explain this JSON structure"# ❌ Vague
rawi ask "Help with code"
# ✅ Specific
rawi ask "Review this React component for performance issues" < component.jsx# ❌ Generic
rawi ask "Check my database query"
# ✅ With expert template
rawi ask --act database-admin "Optimize this SQL query for performance" < query.sql# ❌ No context
rawi ask "Fix this error"
# ✅ With context
rawi ask "Fix this Python Flask error in a REST API: AttributeError: 'NoneType'"# Start a session for a project
rawi ask "I'm building a microservices architecture with Node.js" --new-session
# Continue building context
rawi ask "How should I handle authentication between services?"
rawi ask "What about database design for this architecture?"Now that you're familiar with the basics, explore these advanced features:
- Configuration Guide — Set up multiple providers and profiles
- Act Templates — Master the 200+ expert templates
- Shell Integration — Advanced terminal workflows
- Session Management — Deep dive into conversations
- Commands Reference — Complete command documentation
- Stuck? Check the Troubleshooting Guide
- Questions? Browse the FAQ
- More Examples? See Workflow Guides
- Community? Join GitHub Discussions
Related Pages: