Skip to content

ask — AI Assistant

The ask command is the heart of Rawi — your direct interface to AI assistance. Use it to ask questions, get code reviews, analyze data, and much more.

rawi ask [query] [options]
Terminal window
# Basic question
rawi ask "What is TypeScript?"
# Multi-word questions (quotes recommended)
rawi ask "How do I deploy a Node.js application to AWS?"
# Code-related questions
rawi ask "Explain async/await in JavaScript with examples"
OptionAliasDescriptionDefault
--profile <profile>-pProfile to use for AI configurationdefault
--session <sessionId>-sContinue an existing chat session
--new-session-nStart a new chat session
--act <template>Use an act template by ID
--file <path>-fProcess content from a file
--files <paths...>-FProcess content from multiple files
--batch <patterns...>-bProcess files matching glob patterns
--file-type <type>Override automatic file type detection
--parallelProcess multiple files in parallel
--max-concurrency <number>Maximum concurrent files to process5
--continue-on-errorContinue processing other files if one fails
--verboseShow detailed status and debug information
--filter-sensitiveFilter sensitive information from prompts and responses
--filter-types <types>Comma-separated list of information types to filter
--show-filteredShow which information was filtered and display filtering statistics
--highlight-filteredShow filtered content with highlighting in terminal output
--save-filter-configSave current filtering configuration as default for future use
--reset-filter-configReset filtering configuration to defaults (enables all filter types)

Supported File Types:

CategoryExtensionsDescription
Documentspdf, docx, pptx, xlsxPDF documents, Word docs, PowerPoint, Excel
OpenDocumentodt, odp, odsOpenDocument text, presentations, spreadsheets
Text & Markuptxt, md, xml, html, htmPlain text, Markdown, XML, HTML files
Web Technologiesjs, jsx, ts, tsx, css, jsonJavaScript, TypeScript, CSS, JSON
Programming Languagespy, java, cpp, c, h, go, rsPython, Java, C/C++, Go, Rust
rb, kt, swift, dart, scalaRuby, Kotlin, Swift, Dart, Scala
r, m, pl, lua, phpR, Objective-C, Perl, Lua, PHP
Configurationyml, yaml, toml, env, iniYAML, TOML, environment, config files
conf, cfgGeneral configuration files
Scripts & Toolssql, sh, bash, vimSQL, shell scripts, Vim config
dockerfile, makefile, gitignoreDocker, Make, Git ignore files
LogslogLog files and system output

File Type Override:

Terminal window
# Process unknown file as text
rawi ask --file data.unknown --file-type txt "Analyze this data"
# Force PDF processing
rawi ask --file document --file-type pdf "Extract text from this"
# Override auto-detection for config files
rawi ask --file config.custom --file-type yaml "Parse this YAML configuration"

Rawi includes built-in filtering to protect sensitive information in your prompts and AI responses.

Terminal window
# Enable sensitive information filtering
rawi ask --filter-sensitive "Review this log file with user data"
# Process files with filtering enabled
rawi ask --file user-data.txt --filter-sensitive "Analyze this data"
Terminal window
# Filter specific types of information
rawi ask --filter-types "email,phone" "Process this customer contact list"
# Filter multiple types
rawi ask --filter-types "email,phone,creditcard,ssn" --file sensitive-data.csv "Analyze patterns"
# Combine with file processing
rawi ask --files logs/*.log --filter-types "ip,email" "Check for security issues"
Terminal window
# Show what was filtered
rawi ask --filter-sensitive --show-filtered "Analyze this user database"
# Highlight filtered content in output
rawi ask --filter-sensitive --highlight-filtered "Review this authentication log"
# Combine visibility options
rawi ask --filter-types "email,phone" --show-filtered --highlight-filtered "Process contacts"
Terminal window
# Save current filter settings as default
rawi ask --filter-types "email,phone,creditcard" --save-filter-config "Set up my preferred filtering"
# Reset to default filter configuration
rawi ask --reset-filter-config "Reset filtering to defaults"
# Use saved configuration (automatic)
rawi ask "Process data with my saved filter settings"
Filter TypeDescriptionExamples
emailEmail addressesuser@example.com, test@domain.org
phonePhone numbers(555) 123-4567, +1-800-555-0199
creditcardCredit card numbers4111-1111-1111-1111
ssnSocial Security Numbers123-45-6789
ipIP addresses192.168.1.1, 10.0.0.1
urlURLs and web addresseshttps://example.com/private
api_keyAPI keys and tokenssk-1234567890abcdef
passwordPassword-like stringspassword123, secretkey

Sessions allow you to have continuous conversations where each question remembers the previous context.

Terminal window
# Explicitly start a new session
rawi ask "I'm building a React application" --new-session
# Shorter version
rawi ask "I'm building a React application" -n
Terminal window
# Continue current session (automatic)
rawi ask "How should I structure my components?"
# Continue specific session
rawi ask "What about state management?" --session abc123-def456
Terminal window
# Start a project conversation
$ rawi ask "I'm building a REST API with Node.js and Express" --new-session
🤖 Great! I'd be happy to help you build a REST API with Node.js and Express.
What specific aspects would you like to focus on? Here are some areas I can assist with:
...
# Continue the conversation
$ rawi ask "How should I structure my project folders?"
🤖 Based on our discussion about your REST API, here's a recommended folder structure:
...
# Add more context
$ rawi ask "What about database integration with MongoDB?"
🤖 For your Express REST API, here's how to integrate MongoDB effectively:
...

Act templates transform the AI into specialized experts for different domains.

Terminal window
# Use template with question
rawi ask --act code-reviewer "Review this function for performance issues"
# Combine with file input
cat server.js | rawi ask --act security-expert "Analyze for vulnerabilities"
# Use with profile
rawi ask --act database-admin "Optimize this query" --profile work
Terminal window
# Code review
rawi ask --act code-reviewer "Review this Python function"
# Linux terminal simulation
rawi ask --act linux-terminal "list files in /home with details"
# Software engineering
rawi ask --act software-engineer "Design a scalable authentication system"
Terminal window
# Security analysis
rawi ask --act security-expert "Audit this authentication code"
# Cybersecurity specialist
rawi ask --act cybersecurity-specialist "Assess web application vulnerabilities"
Terminal window
# Technical writing
rawi ask --act technical-writer "Document this API endpoint"
# API documentation
rawi ask --act api-documentation-expert "Create docs for these REST endpoints"
Terminal window
# Database administration
rawi ask --act database-expert "Optimize this SQL query"
# Data analysis
rawi ask --act data-scientist "Analyze trends in this dataset"
Terminal window
# List all available templates
rawi act --list
# Show template details
rawi act --show code-reviewer

Profiles let you use different AI providers and configurations for different tasks.

Terminal window
# Use work profile
rawi ask "Review this code" --profile work
# Use local profile (e.g., Ollama)
rawi ask "Quick question" --profile local
# Use analysis profile (e.g., Claude)
rawi ask "Analyze this data" --profile analysis
Terminal window
# Use Claude for deep code analysis
rawi ask --act code-reviewer "Analyze architecture" --profile claude
# Use local AI for quick questions
rawi ask --act linux-terminal "ls -la" --profile local
# Use GPT-4 for documentation
rawi ask --act technical-writer "Create README" --profile openai

Rawi integrates seamlessly with shell commands and pipes.

Terminal window
# Analyze code files
cat app.js | rawi ask --act code-reviewer "Review this JavaScript code"
# Process command output
ps aux | rawi ask "Which processes are using the most memory?"
# Analyze logs
tail -f error.log | rawi ask "Monitor for critical issues"
# Git integration
git diff | rawi ask "Summarize these changes"
Terminal window
# Save AI responses
rawi ask "Explain Docker containers" > docker-notes.txt
# Process AI output
rawi ask "List popular Python libraries" | grep -i "data"
# Complex pipelines
cat data.csv | rawi ask --act data-scientist "Analyze this data" | tee analysis.txt
Terminal window
# Process sensitive documents safely
rawi ask --file employee-data.xlsx --filter-sensitive "Create summary statistics"
# Analyze logs with IP and email filtering
rawi ask --file access.log --filter-types "ip,email" --show-filtered "Find unusual access patterns"
# Batch process with filtering
rawi ask --batch "logs/**/*.log" --filter-sensitive --parallel "Analyze all logs for security issues"
# Review code with API key filtering
rawi ask --files src/**/*.js --filter-types "api_key,password" --act code-reviewer "Security review"
Terminal window
# Audit configuration files
rawi ask --file .env --filter-types "password,api_key" --act security-expert "Review configuration security"
# Process database dumps safely
rawi ask --file backup.sql --filter-sensitive --show-filtered "Analyze schema structure"
# Review application logs
rawi ask --file app.log --filter-types "email,ip,creditcard" --highlight-filtered "Check for data leaks"
Terminal window
# Code review entire files
cat src/server.js | rawi ask --act code-reviewer "Comprehensive code review focusing on security and performance"
# Documentation generation
cat api/routes.js | rawi ask --act technical-writer "Generate API documentation for these routes"
# Error analysis
cat error.log | rawi ask --act debugging-expert "Identify and categorize these errors"
Terminal window
# Development workflow
rawi ask --new-session --act software-engineer "I'm building a user authentication system"
rawi ask "What are the security considerations?"
rawi ask "Show me the database schema"
rawi ask "How should I handle password reset?"
Terminal window
# Review multiple files
for file in src/*.js; do
echo "Reviewing $file..."
cat "$file" | rawi ask --act code-reviewer "Quick review of this file"
done
# Analyze logs from multiple servers
for log in logs/*.log; do
cat "$log" | rawi ask --act system-administrator "Summarize issues in this log"
done
  1. Be Specific: Include context and requirements

    Terminal window
    rawi ask --act code-reviewer "Review this React component for performance issues and accessibility compliance"
  2. Provide Context: Mention your tech stack and constraints

    Terminal window
    rawi ask "How do I implement caching in a Node.js Express API using Redis?"
  3. Use Templates: Choose appropriate expertise for your task

    Terminal window
    rawi ask --act database-expert "Optimize this PostgreSQL query for large datasets"
  1. Start Sessions for Related Work: Group related questions together
  2. Use Descriptive First Messages: Set clear context
  3. Reference Previous Discussion: Build on earlier conversation points
  1. Choose Appropriate Models: Use lighter models for simple tasks
  2. Limit Input Size: Process large files in chunks if needed
  3. Use Local Providers: For speed and privacy when possible
  1. Filter Sensitive Data: Use --filter-sensitive when processing sensitive files

    Terminal window
    rawi ask --file user-data.csv --filter-sensitive "Analyze user behavior patterns"
  2. Custom Filtering: Specify exactly what to filter for better control

    Terminal window
    rawi ask --filter-types "email,phone,ssn" --file contacts.txt "Process contact information"
  3. Verify Filtering: Use --show-filtered to see what was filtered

    Terminal window
    rawi ask --filter-sensitive --show-filtered --file logs.txt "Review application logs"

Session not found:

Terminal window
# List available sessions
rawi history --sessions
# Start new session if old one expired
rawi ask --new-session "Continuing previous work on authentication"

Large input errors:

Terminal window
# Process in chunks for large files
head -100 large-file.txt | rawi ask "Analyze this sample"

Network issues:

Terminal window
# Check configuration
rawi info
# Try different profile/provider
rawi ask --profile backup "Test question"
Terminal window
# Pre-commit code review
git diff --cached | rawi ask --act code-reviewer "Review staged changes"
# Commit message generation
git diff --cached | rawi ask "Generate a conventional commit message"
# Release notes
git log --oneline v1.0..HEAD | rawi ask --act technical-writer "Create release notes"
Terminal window
# API testing
curl -s https://api.example.com/users | rawi ask --act api-tester "Analyze this API response"
# Log monitoring
tail -f /var/log/app.log | rawi ask --act incident-responder "Monitor for critical alerts"
# Documentation updates
find . -name "*.js" -newer docs/ | while read file; do
cat "$file" | rawi ask --act technical-writer "Update documentation for changes in this file"
done

Show details of a specific act template:

Terminal window
$ rawi ask --act ethereum-developer --show

For more information, see the Rawi documentation or run rawi ask --help.