history — Conversation Management
The history
command lets you search, manage, and analyze your AI conversation history with separate views for ask, chat, and exec sessions.
Basic Usage
Section titled “Basic Usage”rawi history <subcommand> [options]
View your AI conversation history organized by session type:
# Show ask session historyrawi history ask
# Show chat session historyrawi history chat
# Show exec session historyrawi history exec
Quick Commands
Section titled “Quick Commands”# Search ask sessionsrawi history ask --search "docker"
# Show recent chat sessionsrawi history chat --limit 10
# Show recent exec commandsrawi history exec --limit 20
# Filter by profilerawi history ask --profile work
Subcommands
Section titled “Subcommands”Show ask session history. View and search your ask sessions and messages.
rawi history ask [options]
Purpose: View all your one-off questions and quick interactions with AI models.
Show chat session history. View and search your chat sessions and messages.
rawi history chat [options]
Purpose: View all your interactive chat conversations and longer discussions.
Show exec session history. View and search your exec sessions and generated commands.
rawi history exec [options]
Options
Section titled “Options”All options are available for both ask
and chat
subcommands:
Option | Alias | Description | Default |
---|---|---|---|
--profile <profile> | -p | Profile to show history for | default |
--limit <number> | -l | Number of sessions to show | 50 |
--search <query> | -s | Search messages containing text | |
--provider <provider> | Filter by AI provider | ||
--model <model> | Filter by AI model | ||
--from <date> | Show sessions from date (YYYY-MM-DD) | ||
--to <date> | Show sessions to date (YYYY-MM-DD) | ||
--all | Show all sessions without pagination limit | ||
--all-profiles | Show sessions from all profiles |
Search and Filtering
Section titled “Search and Filtering”Text Search
Section titled “Text Search”Search for specific content in your ask or chat sessions:
# Search ask sessionsrawi history ask --search "docker deployment"
# Search chat sessionsrawi history chat --search "debugging"
# Case-insensitive searchrawi history ask --search "TypeScript"
Provider and Model Filtering
Section titled “Provider and Model Filtering”Filter conversations by AI provider or model:
# Filter ask sessions by providerrawi history ask --provider openairawi history chat --provider anthropic
# Filter by modelrawi history ask --model gpt-4orawi history chat --model claude-3-5-sonnet
# Combine filtersrawi history ask --provider openai --model gpt-4o
Date Range Filtering
Section titled “Date Range Filtering”Filter conversations by date:
# Show ask sessions from specific daterawi history ask --from 2024-01-01
# Show chat sessions within date rangerawi history chat --from 2024-01-01 --to 2024-12-31
Profile Filtering
Section titled “Profile Filtering”Filter by specific profiles:
# Show ask sessions from work profilerawi history ask --profile work
# Show chat sessions from all profilesrawi history chat --all-profiles
Examples
Section titled “Examples”Basic Usage
Section titled “Basic Usage”# Show recent ask sessionsrawi history ask
# Show recent chat sessionsrawi history chat
# Show recent exec sessionsrawi history exec
# Limit resultsrawi history ask --limit 5rawi history chat --limit 10rawi history exec --limit 15
Example output:
📚 Ask Session History (3 sessions):
┌──────────────────────┬──────────────────────────────────────┬────────────┬──────────┬──────────────────┐│ Title │ ID │ Profile │ Messages │ Updated │├──────────────────────┼──────────────────────────────────────┼────────────┼──────────┼──────────────────┤│ Create React comp... │ abc123-def456-ghi789 │ default │ 2 │ 1 hour ago ││ Docker deployment │ def456-ghi789-jkl012 │ work │ 4 │ 2 hours ago ││ TypeScript types │ ghi789-jkl012-mno345 │ default │ 6 │ 1 day ago │└──────────────────────┴──────────────────────────────────────┴────────────┴──────────┴──────────────────┘
💡 Tips: • Use --session <id> with ask command to continue a session • Use --search <query> to search message content
Search Examples
Section titled “Search Examples”# Search for Docker-related ask sessionsrawi history ask --search "docker"
# Search for debugging in chat sessionsrawi history chat --search "debugging"
# Search for file operations in exec sessionsrawi history exec --search "file"
# Search across all profilesrawi history ask --search "react" --all-profilesrawi history exec --search "git" --all-profiles
Advanced Filtering
Section titled “Advanced Filtering”# Ask sessions using OpenAI from January 2024rawi history ask --provider openai --from 2024-01-01
# Chat sessions using GPT-4 in work profilerawi history chat --model gpt-4 --profile work
# Exec sessions with commands from last weekrawi history exec --from $(date -d '1 week ago' +%Y-%m-%d)
# All exec sessions without paginationrawi history exec --all
# Recent ask sessions from specific date rangerawi history ask --from 2024-01-01 --to 2024-01-31 --limit 20
Complex Queries
Section titled “Complex Queries”# All ask sessions without paginationrawi history ask --all
# All chat sessions without paginationrawi history chat --all
# Recent ask sessions from specific date rangerawi history ask --from 2024-01-01 --to 2024-01-31 --limit 20
Cross-Session Type Analysis
Section titled “Cross-Session Type Analysis”# Compare ask vs chat vs exec activityrawi history ask --limit 10rawi history chat --limit 10rawi history exec --limit 10
# Search same topic across all typesrawi history ask --search "kubernetes"rawi history chat --search "kubernetes"rawi history exec --search "kubernetes"
# Find all OpenAI interactionsrawi history ask --provider openairawi history chat --provider openairawi history exec --provider openai
Use Cases
Section titled “Use Cases”Development Workflow
Section titled “Development Workflow”# Review recent coding helprawi history ask --search "code review"rawi history chat --search "debugging"
# Review command generation historyrawi history exec --search "docker"rawi history exec --search "git"
# Find specific technology discussionsrawi history ask --search "typescript"rawi history chat --search "react"rawi history exec --search "npm"
Project Organization
Section titled “Project Organization”# Separate work and personal conversationsrawi history ask --profile workrawi history chat --profile personal
# Find discussions about specific projectsrawi history ask --search "project-alpha"rawi history chat --search "project-alpha"
Learning and Research
Section titled “Learning and Research”# Track learning sessionsrawi history chat --search "tutorial"rawi history ask --search "how to"
# Find AI model comparisonsrawi history ask --provider anthropicrawi history ask --provider openai
Data Analysis
Section titled “Data Analysis”# Usage patterns by providerrawi history ask --provider ollama --limit 100rawi history chat --provider gpt-4 --limit 100
# Time-based analysisrawi history ask --from 2024-01-01 --to 2024-01-31rawi history chat --from 2024-01-01 --to 2024-01-31
Interactive Features
Section titled “Interactive Features”Both ask
and chat
history views support interactive navigation:
- Pagination: Navigate through multiple pages of results
- Session details: View complete session information
- Smart filtering: Results update based on your criteria
Pagination Navigation
Section titled “Pagination Navigation”When you have more sessions than the display limit, you’ll see pagination options:
Page 1 of 3 | Total: 25 sessions
? What would you like to do?❯ Next page Previous page Exit
Session Information Display
Section titled “Session Information Display”Each session shows:
- Title: Auto-generated or custom session name
- ID: Unique session identifier
- Profile: The profile used for the session
- Messages: Number of messages in the session
- Updated: Last activity timestamp
Performance Tips
Section titled “Performance Tips”Optimizing Large Histories
Section titled “Optimizing Large Histories”# Use limits for faster resultsrawi history ask --limit 20
# Filter by recent datesrawi history chat --from 2024-08-01
# Search specific profilesrawi history ask --profile work
Efficient Searching
Section titled “Efficient Searching”# Use specific search termsrawi history ask --search "docker compose"
# Combine filters to narrow resultsrawi history chat --search "error" --provider openai --from 2024-08-01