Profile Management
Profile management in Rawi allows you to maintain different configurations for various projects, AI providers, and use cases. Each profile can have its own provider, model, API keys, and settings.
What Are Profiles?
Section titled “What Are Profiles?”Profiles are named configurations that contain:
- AI provider settings (OpenAI, Anthropic, etc.)
- Model selection and parameters
- API keys and endpoints
- Default templates and preferences
- Custom settings for specific use cases
Basic Profile Commands
Section titled “Basic Profile Commands”Listing Profiles
Section titled “Listing Profiles”# List all profilesrawi configure --list
# Show current active profilerawi configure --show
# Show specific profile detailsrawi configure --profile work --show
Creating Profiles
Section titled “Creating Profiles”# Create a new profile interactivelyrawi configure --profile work
# Create profile with specific settingsrawi configure --profile personal \ --provider openai \ --model gpt-4 \ --api-key sk-your-personal-key
# Create profile for local AIrawi configure --profile local \ --provider ollama \ --model llama2 \ --base-url http://localhost:11434
Using Profiles
Section titled “Using Profiles”# Use specific profile for a questionrawi ask --profile work "How do I optimize this database query?"
# Switch default profilerawi configure --profile personal --set-default
# Use profile with other featuresrawi ask --profile work --act code-reviewer "Review this code"
Common Profile Setups
Section titled “Common Profile Setups”Work vs Personal Profiles
Section titled “Work vs Personal Profiles”Work Profile (Enterprise/Secure):
rawi configure --profile work \ --provider azure \ --model gpt-4 \ --api-key your-work-key \ --base-url https://company.openai.azure.com \ --temperature 0.1
Personal Profile (Flexible):
rawi configure --profile personal \ --provider openai \ --model gpt-4 \ --api-key your-personal-key \ --temperature 0.7
Provider-Specific Profiles
Section titled “Provider-Specific Profiles”OpenAI Profile:
rawi configure --profile openai-pro \ --provider openai \ --model gpt-4 \ --temperature 0.5 \ --max-tokens 2000
Anthropic Profile:
rawi configure --profile claude \ --provider anthropic \ --model claude-3-5-sonnet-20241022 \ --temperature 0.3
Local AI Profile:
rawi configure --profile offline \ --provider ollama \ --model codellama \ --base-url http://localhost:11434
Use Case Profiles
Section titled “Use Case Profiles”Code Review Profile:
rawi configure --profile code-review \ --provider anthropic \ --model claude-3-5-sonnet-20241022 \ --temperature 0.1 \ --default-act code-reviewer
Creative Writing Profile:
rawi configure --profile creative \ --provider openai \ --model gpt-4 \ --temperature 0.9 \ --default-act creative-writer
Data Analysis Profile:
rawi configure --profile data \ --provider openai \ --model gpt-4 \ --temperature 0.2 \ --default-act data-scientist
Advanced Profile Management
Section titled “Advanced Profile Management”Profile Configuration
Section titled “Profile Configuration”# Set profile-specific settingsrawi configure --profile work \ --temperature 0.1 \ --max-tokens 1500 \ --timeout 30 \ --retry-count 3
# Configure profile defaultsrawi configure --profile work \ --default-act software-engineer \ --auto-session true \ --verbose false
Environment-Based Profiles
Section titled “Environment-Based Profiles”Development Environment:
rawi configure --profile dev \ --provider ollama \ --model codellama \ --temperature 0.3
Production Environment:
rawi configure --profile prod \ --provider azure \ --model gpt-4 \ --temperature 0.1 \ --max-tokens 1000
Testing Environment:
rawi configure --profile test \ --provider openai \ --model gpt-3.5-turbo \ --temperature 0.2
Profile Workflows
Section titled “Profile Workflows”Project-Based Workflows
Section titled “Project-Based Workflows”# Web development projectrawi ask --profile web-dev "How do I implement SSR in Next.js?"
# Mobile development projectrawi ask --profile mobile "Best practices for React Native navigation?"
# Data science projectrawi ask --profile data-science "How do I visualize this dataset?"
Team Collaboration
Section titled “Team Collaboration”# Shared team profile (same settings for consistency)rawi configure --profile team-standard \ --provider azure \ --model gpt-4 \ --temperature 0.3 \ --max-tokens 1500
# Individual customizationrawi configure --profile john-personal \ --provider openai \ --model gpt-4 \ --temperature 0.7
Cost Management
Section titled “Cost Management”Premium Profile (High-quality, higher cost):
rawi configure --profile premium \ --provider openai \ --model gpt-4 \ --max-tokens 4000
Budget Profile (Good quality, lower cost):
rawi configure --profile budget \ --provider openai \ --model gpt-3.5-turbo \ --max-tokens 1000
Free Profile (Local, no API costs):
rawi configure --profile free \ --provider ollama \ --model llama2
Profile Best Practices
Section titled “Profile Best Practices”1. Naming Conventions
Section titled “1. Naming Conventions”Use clear, descriptive names:
# Good namingwork-azurepersonal-openailocal-developmentcode-review-claude
# Avoid generic namesprofile1testtemp
2. Environment Separation
Section titled “2. Environment Separation”# Separate work and personalrawi configure --profile work-openairawi configure --profile personal-claude
# Separate by projectrawi configure --profile project-alpharawi configure --profile project-beta
3. Provider Redundancy
Section titled “3. Provider Redundancy”Set up multiple providers for reliability:
# Primary providerrawi configure --profile main --provider openai
# Backup providerrawi configure --profile backup --provider anthropic
# Local fallbackrawi configure --profile local --provider ollama
4. Security Considerations
Section titled “4. Security Considerations”# Use environment variables for sensitive keysexport OPENAI_API_KEY="sk-your-key"rawi configure --profile secure --provider openai --api-key "$OPENAI_API_KEY"
# Separate profiles for different security levelsrawi configure --profile public-demos --provider ollama # No API keysrawi configure --profile internal --provider azure # Company keys
Profile Configuration Files
Section titled “Profile Configuration Files”Location
Section titled “Location”Profiles are stored in:
- Linux/macOS:
~/.config/rawi/profiles/
- Windows:
%APPDATA%/rawi/profiles/
Manual Editing
Section titled “Manual Editing”# Edit profile configuration directlynano ~/.config/rawi/profiles/work.json
# Copy profile configurationcp ~/.config/rawi/profiles/work.json ~/.config/rawi/profiles/work-backup.json
Profile Export/Import
Section titled “Profile Export/Import”# Export profile settingsrawi configure --profile work --export > work-profile.json
# Import profile settingsrawi configure --profile new-work --import work-profile.json
# Share team profilerawi configure --profile team --export | base64 # Share encoded config
Troubleshooting Profiles
Section titled “Troubleshooting Profiles”Common Profile Issues
Section titled “Common Profile Issues”Profile not found:
# List available profilesrawi configure --list
Profile authentication errors:
# Check profile configurationrawi configure --profile work --showrawi configure --profile work --test-connection
Profile conflicts:
# Reset profile to defaultsrawi configure --profile work --reset
# Delete problematic profilerawi configure --profile old-profile --delete
Profile Validation
Section titled “Profile Validation”# Test profile configurationrawi configure --profile work --validate
# Check API connectivityrawi ask --profile work "test connection"
# Verify model availabilityrawi provider --models openai
Integration Examples
Section titled “Integration Examples”Profile + Sessions
Section titled “Profile + Sessions”# Start work session with work profilerawi ask --profile work --new-session "Starting the API refactoring project"
# Continue with same profile and sessionrawi ask --profile work --session abc123 "How do we handle data migration?"
Profile + Templates
Section titled “Profile + Templates”# Code review with specific profilerawi ask --profile claude-code --act code-reviewer "Review this function"
# Technical writing with creative profilerawi ask --profile creative --act technical-writer "Write user documentation"
Profile + Shell Integration
Section titled “Profile + Shell Integration”# Analyze logs with data profiletail -f app.log | rawi ask --profile data-analysis "Summarize errors"
# Code review with work profilecat src/app.js | rawi ask --profile work --act code-reviewer "Review this"
Automation and Scripting
Section titled “Automation and Scripting”Profile-Based Scripts
Section titled “Profile-Based Scripts”#!/bin/bash# Daily standup helperrawi ask --profile work --new-session "Generate standup report for $(date +%Y-%m-%d)"
#!/bin/bash# Code review automationfor file in src/*.js; do echo "Reviewing $file..." cat "$file" | rawi ask --profile code-review --act code-reviewer "Review this file"done
Environment Detection
Section titled “Environment Detection”#!/bin/bash# Auto-select profile based on directoryif [[ $PWD == *"/work/"* ]]; then PROFILE="work"elif [[ $PWD == *"/personal/"* ]]; then PROFILE="personal"else PROFILE="default"fi
rawi ask --profile "$PROFILE" "$@"
See Also
Section titled “See Also”- configure command — Profile configuration details
- Supported AI Providers — Provider setup guides
- Environment Variables — Environment-based configuration
- Session Management — Using profiles with sessions