Advanced Usage

This guide covers advanced usage patterns, tips, tricks, and best practices for power users who want to maximize their productivity with VritraAI. Learn how to combine features effectively, optimize workflows, and leverage VritraAI's full potential.

Advanced AI Workflows

Combining AI Commands

VritraAI's AI commands can be combined in powerful workflows for comprehensive code analysis and project management.

Code Review Workflow:

# Complete code review workflow
review src/                    # Review entire source directory
security_scan src/             # Check for security issues
optimize_code src/main.py      # Get optimization suggestions
refactor src/utils.py "improve error handling"  # Refactor with specific goal

Project Analysis Workflow:

# Comprehensive project analysis
project_type                   # Detect project type
dependencies_check             # Check dependencies
project_health                 # Analyze project health
missing_files                  # Find missing files
project_optimize               # Get optimization suggestions

Documentation Workflow:

# Generate comprehensive documentation
doc docstring src/*.py         # Generate docstrings for all Python files
doc readme .                   # Generate project README
doc tutorial                   # Create tutorial from session history
doc diagram src/main.py        # Generate architecture diagram

Command Chaining Strategies

Efficient Multi-Command Workflows

Use command chaining to create efficient workflows that combine multiple operations.

File Operations Chain:

# Create, validate, and format in one chain
template python new_script.py && validate new_script.py && format new_script.py

System Analysis Chain:

# Quick system check
sys_info; disk_usage .; memory; uptime

Search and Review Chain:

# Find files, then review them
find_files "*.py" src/ && review src/

Advanced AI Prompting

Effective AI Communication

Learn how to craft effective prompts for the AI to get the best results.

Structured Prompts:

When asking the AI to perform complex tasks, structure your prompts clearly:

# Good: Structured and specific
ai "Create a Python function that:
1. Takes a list of numbers
2. Filters out negative numbers
3. Returns the sum of remaining numbers
4. Includes error handling and docstring"

# Better: Include context
ai "I'm working on a data processing script. Create a function that filters and sums positive numbers from a list, with proper error handling and documentation."

File Creation with AI:

The AI can create files directly when you specify the format:

# Create a file with specific content
ai "Create a file called config.json with a JSON object containing api_key, timeout, and retry settings"

# Create multiple files
ai "Create a Python package structure: __init__.py, main.py, and utils.py with basic structure"

Code Editing with AI:

Use the AI to modify existing files:

# Edit existing file
ai "In app.py, add error handling to the main function and improve logging"

# Refactor code
ai "Refactor utils.py to use type hints and add docstrings to all functions"

Model Selection Strategies

Choosing the Right Model

Different AI models have different strengths. Learn when to use which model for optimal results.

Model Selection Guide:

  • For Speed: Use smaller models like gf3 (Gemini 2.5 Flash Lite) or ll4 (LLaMA 3.2 3B)
  • For Quality: Use larger models like gp1 (Gemini 2.5 Pro) or ll2 (LLaMA 3.1 405B)
  • For Code: Use specialized models like qw1 (Qwen 3 Coder)
  • For Reasoning: Use ds3 (DeepSeek Prover v2)
  • For Multimodal: Use ms3 (Pixtral 12B)

Workflow Example:

# Switch models based on task
model set qw1                  # Use code model for programming tasks
ai "Review this Python code for best practices"

model set gp1                  # Switch to pro model for complex analysis
ai "Analyze the architecture of this project and suggest improvements"

model set gf1                  # Use fast model for quick questions
ai "What does this command do?"

Session Management Best Practices

Effective Session Tracking

Use session management to track your work and create reproducible workflows.

Regular Session Saves:

# Save session at key milestones
session save milestone_1.json
session save before_refactoring.json
session save final_state.json

Session Analysis:

Use session data to understand your workflow patterns and identify areas for improvement.

Error Recovery Workflows

Leveraging Error Recovery

Use VritraAI's error recovery system to learn from mistakes and improve your workflow.

Error Learning Workflow:

# When an error occurs:
# 1. The error is automatically captured
# 2. Use explain_last to understand what went wrong
explain_last

# 3. Use AI to get fix suggestions
ai "How do I fix this error: [paste error message]"

# 4. Apply the fix and verify
validate fixed_file.py

Performance Optimization

Optimizing VritraAI Performance

Tips for getting the best performance from VritraAI.

Model Selection:

  • Use faster models for quick tasks
  • Use larger models only when quality is critical
  • Switch models based on task requirements

Command Efficiency:

  • Use command chaining to reduce round trips
  • Batch related operations together
  • Use built-in commands instead of system commands when possible

Configuration:

  • Keep configuration file clean and organized
  • Regularly clear old session data if not needed
  • Use appropriate themes for your terminal

Advanced Search Techniques

Powerful Search Workflows

Combine different search methods for comprehensive code exploration.

Multi-Method Search:

# Combine regex and semantic search
search_regex "def.*test" *.py    # Find test functions
search_semantic "authentication logic" src/  # Find auth-related code

# Use recent to find recently worked files
recent files

Documentation Generation Workflows

Comprehensive Documentation

Create complete documentation for your projects using VritraAI's documentation tools.

Complete Documentation Workflow:

# 1. Generate docstrings for all code files
for file in $(find src -name "*.py"); do
    doc docstring "$file"
done

# 2. Generate project README
doc readme .

# 3. Generate architecture diagram
doc diagram src/main.py

# 4. Create tutorial from session
doc tutorial

Project Management Workflows

Complete Project Lifecycle

Use VritraAI throughout your project lifecycle for comprehensive management.

Project Setup:

# 1. Detect project type
project_type

# 2. Check dependencies
dependencies_check

# 3. Generate initial documentation
doc readme .

# 4. Create project structure
template python src/main.py
template python tests/test_main.py

Ongoing Maintenance:

# Regular health checks
project_health
dependencies_check
missing_files

# Code quality
review src/
security_scan src/

Learning and Development

Using VritraAI as a Learning Tool

Leverage VritraAI's learning features to improve your skills.

Learning Workflow:

# Learn a new concept
learn "python decorators"

# Get a cheatsheet
cheat git

# Practice with AI assistance
ai "Create examples of using decorators in Python"

# Review your code
review my_practice.py

Customization for Productivity

Optimize Your Environment

Customize VritraAI to match your workflow and preferences.

Theme Selection:

  • Choose themes that reduce eye strain for long sessions
  • Use professional themes for work environments
  • Match prompt style to your personality for motivation

Banner Configuration:

  • Use random banners for variety
  • Sync banner colors with your theme
  • Preview banners before setting

Troubleshooting Tips

Common Issues and Solutions

Solutions for common issues you might encounter.

AI Not Responding:

  • Check API key: apikey show
  • Test API connection: apikey test
  • Verify model selection: model current
  • Check network: network check

Configuration Issues:

  • View current config: config
  • Check config file permissions
  • Verify config file location
  • Restore from backup if needed

Command Not Working:

  • Check command syntax: help
  • Verify file paths exist
  • Check command permissions
  • Use explain_last for error analysis

Power User Tips

  • Use history effectively: Use history to recall complex commands
  • Save important sessions: Export sessions at key milestones
  • Combine features: Chain commands and AI operations for complex workflows
  • Switch models strategically: Use the right model for each task
  • Leverage error recovery: Learn from errors using explain_last
  • Use semantic search: Find code by meaning, not just text
  • Generate documentation: Keep documentation up-to-date automatically
  • Regular health checks: Use project health commands regularly

💡 Pro Tip: Create your own workflows by combining VritraAI's features. For example, set up a daily routine: check project health, review recent changes, update documentation, and save your session. This keeps your projects healthy and well-documented!