Complete reference for all Rawi CLI commands and their usage patterns.
Rawi provides a comprehensive set of commands for AI interaction, configuration management, and system administration. This reference covers all commands, options, and usage patterns.
rawi <command> [options] [arguments]
rawi [global-options]
ask
Ask AI questions and get intelligent responses. Supports conversation sessions, act templates, and piped input.
chat
Start interactive chat sessions for back-and-forth conversations with AI models.
exec
Convert natural language descriptions into executable CLI commands with safety validation.
configure
Configure AI provider settings and manage configuration profiles.
history
Manage chat history, sessions, and conversation data.
act
List and explore act templates for specialized prompts.
provider
Show information about supported AI providers and their models.
info
Display system information, version details, and configuration status.
-h, --help
Display help information for commands.
-v, --version
Display the version of Rawi.
--verbose
Show detailed status and debug information (available for most commands).
Primary Commands
ask- Main interface for AI conversationschat- Interactive chat sessions for extended conversationsexec- Convert natural language to executable commands
Supporting Commands
act- Browse and use expert prompt templateshistory- Manage conversation sessions
Configuration Management
configure- Set up providers, models, and profiles
System Information
provider- Explore available AI providers and modelsinfo- View system and configuration details
# Simple question
rawi ask "What is TypeScript?"
# With expert template
rawi ask --act developer "Review this code"
# With file input
cat file.txt | rawi ask "Summarize this"# Generate and execute commands
rawi exec "list all files in current directory"
# Dry run to see command without executing
rawi exec "find large files" --dry-run
# With piped input
echo "show disk usage" | rawi exec
# Interactive mode
rawi exec
# Control clipboard options
rawi exec "show system info" --copy-command # Copy command to clipboard (false)# Set up first provider
rawi configure --provider openai --model gpt-4 --api-key sk-xxx
# Create work profile
rawi configure --profile work --provider anthropic --model claude-3
# View configuration
rawi configure --show# Continue previous session
rawi ask --session abc123 "Continue our discussion"
# Start new session
rawi ask --new-session "Fresh conversation"
# View session history
rawi history show abc123# Find available templates
rawi act --list
# Explore providers
rawi provider --list
# Check specific provider models
rawi provider --list-models anthropic- Pipeline integration
configure— Set up and manage AI providers- Interactive and manual configuration
- Profile management
- Provider switching
- Credential management
history— Manage your conversation data- Search conversations
- Export history
- Session management
- Usage analytics
# 1. Configure (one-time setup)
rawi configure --provider openai --model gpt-4o --api-key sk-xxx
# 2. Ask questions
rawi ask "Your question here"
# 3. Use advanced features
rawi ask --act code-reviewer "Review this code" < file.js# Set up profiles for different use cases
rawi configure --profile work --provider openai --model gpt-4o
rawi configure --profile analysis --provider anthropic --model claude-3-sonnet-20240229
rawi configure --profile local --provider ollama --model llama3.2
# Use profiles for specific tasks
rawi ask "Generate code" --profile work
rawi ask "Analyze data" --profile analysis
rawi ask "Quick question" --profile local# Start a focused conversation
rawi ask "I'm building a React app" --new-session
# Continue the conversation
rawi ask "How should I structure components?"
rawi ask "What about state management?"
# Return to the conversation later
rawi ask "What about testing?" --session abc123-def456# Analyze files
cat file.js | rawi ask --act code-reviewer "Review this code"
# Process git changes
git diff | rawi ask "Write a commit message"
# Analyze data
curl -s api.com/data | rawi ask "Explain this API response"
# Save output
rawi ask "Create a README" > README.mdYou can chain Rawi commands with other tools for powerful workflows:
# Code review and commit
git diff | rawi ask "Review changes" && \
git add . && \
git commit -m "$(git diff --cached | rawi ask 'Generate commit message')"
# Test and document
npm test && \
rawi ask "Document this API" < api.js > docs/api.md
# Analyze logs and report
tail -100 app.log | \
rawi ask "Summarize errors" | \
tee error-report.txt# Process and save analysis
cat data.csv | \
rawi ask "Analyze sales trends" | \
tee analysis-report.md
# API exploration
curl -s api.com/endpoints | \
rawi ask "Document these API endpoints" > api-docs.md
# Log analysis pipeline
grep ERROR app.log | \
rawi ask "Categorize errors" | \
sort | uniq -c | \
rawi ask "Interpret this error frequency data"# Set up multiple providers in sequence
rawi configure --provider openai --model gpt-4o --api-key $OPENAI_KEY && \
rawi configure --profile claude --provider anthropic --model claude-3-sonnet-20240229 --api-key $ANTHROPIC_KEY && \
rawi configure --profile local --provider ollama --model llama3.2
# Backup and restore configuration
rawi configure --show > config-backup.txt
rawi history export --output history-backup.json# Check configuration before asking
rawi info && rawi ask "Your question"
# Use fallback profile
rawi ask "Question" --profile primary || \
rawi ask "Question" --profile fallback
# Validate configuration
if rawi configure --show > /dev/null 2>&1; then
rawi ask "Your question"
else
echo "Please configure Rawi first: rawi configure"
fiUse --verbose with the ask command to see detailed information:
rawi ask "Your question" --verboseThis shows:
- Configuration validation
- Session management
- Response generation progress
- Provider and model details
# Basic usage
rawi ask "Your question"
# With template
rawi ask --act code-reviewer "Review this code"
# With profile
rawi ask "Question" --profile work
# Configuration
rawi configure
rawi configure --show
# History
rawi history
rawi history --search "topic"
# Information
rawi info
rawi act --list
rawi provider --list# Short flags
rawi ask "Question" -p work # --profile work
rawi history -s "topic" # --search "topic"
rawi history -l 100 # --limit 100
# Quick config check
rawi info --profiles
rawi configure --list# Different profiles for different environments
rawi configure --profile dev --provider ollama --model llama3.2 # Fast, local
rawi configure --profile prod --provider openai --model gpt-4o # Production quality
rawi configure --profile analysis --provider anthropic --model claude-3-sonnet-20240229 # Deep analysis# Use specific templates for tasks
rawi ask --act linux-terminal "ls -la" # System administration
rawi ask --act security-expert "Audit this code" # Security analysis
rawi ask --act database-admin "Optimize query" # Database work# Organize sessions by project
rawi ask "Working on project X" --new-session # Start project session
rawi history sessions # List all sessions
rawi ask "Continue project X" --session abc123 # Resume specific projectClick on any command below for comprehensive documentation:
ask— AI Assistant and conversation managementconfigure— Provider setup and profile managementhistory— Conversation history and analytics
act— Expert template explorerprovider— AI provider informationinfo— System and configuration information
Related Pages: