AI Commands

VritraAI's AI commands provide natural language interaction, intelligent explanations, learning assistance, and content generation. These commands leverage AI to understand context, provide helpful responses, and automate various tasks.

Note: All AI commands require an API key to be configured. Use apikey command to set up your Gemini or OpenRouter API key.

Natural Language AI Assistant

ai <prompt>

The main AI assistant command that understands natural language and can perform various tasks including file creation, code generation, explanations, and more.

Features:

  • Natural language understanding
  • Context-aware responses (includes OS, project type, recent commands)
  • Automatic file creation with JSON responses
  • Command suggestions with execution prompts
  • Typewriter effect for better readability
  • Supports file operations, code generation, and general questions

Context Information:

The AI automatically receives context about:

  • Operating system and current directory
  • Detected project type
  • Recent commands executed in the session

File Creation:

When you request file creation, the AI responds with JSON that automatically creates files:

{"action": "create_file", "filename": "filename.ext", "content": "complete file content"}

Examples:

# General questions
ai "explain how git works"
ai "what's the difference between list and tuple in Python?"

# File creation
ai "create a Python script to calculate fibonacci numbers"
ai "generate a web app calculator"
ai "make a bash script to backup files"

# Code generation
ai "create a Flask web application with user authentication"
ai "generate a Python tool to read CSV files"

# Command suggestions
ai "how do I check disk usage?"
ai "what command lists all Python files?"

Tip: The AI can understand natural language commands like "switch to galaxy theme" or "use deepseek model" and will execute them automatically.

Command Explanations

explain <command>

Get detailed explanations of any command, including what it does, key features, use cases, options, examples, and tips.

Features:

  • Comprehensive command explanations
  • Usage examples and common options
  • Best practices and tips
  • Typewriter effect for readability

Examples:

explain git rebase
explain docker compose
explain python decorators
explain ls -la

Directory and File Analysis

summarize [path]

AI-powered analysis of directories or files. Provides intelligent summaries of project structure, file contents, and code organization.

Features:

  • Directory structure analysis
  • File content summarization (up to 4000 characters)
  • Project overview and organization insights
  • Typewriter effect for better readability

Parameters:

  • path - (Optional) Directory or file to summarize. Defaults to current directory (.)

Examples:

# Summarize current directory
summarize

# Summarize specific directory
summarize src/

# Summarize a specific file
summarize app.py

Note: File summarization requires AI to be enabled. Directory summarization uses built-in analysis.

project analyze

Deep project structure analysis with AI-powered insights. Provides comprehensive assessment of architecture, technology stack, complexity, and recommendations.

Features:

  • Architecture assessment
  • Purpose detection based on structure
  • Technology stack analysis
  • Complexity level assessment (Beginner/Intermediate/Advanced)
  • Quality indicators and best practices
  • Development stage assessment
  • Recommendations for improvement
  • Potential issues identification

Examples:

project analyze

Learning Assistant

learn <topic>

Interactive AI tutoring system that provides structured learning content on any topic. Automatically saves learning notes for future reference.

Features:

  • Brief explanations
  • Common use cases
  • Practical examples with code
  • Best practices and tips
  • Common mistakes to avoid
  • Automatic saving to learning notes file
  • Typewriter effect for better readability

Learning Notes:

All learning sessions are automatically saved to ~/.config-vritrasecz/vritraai/learning.md for future reference.

Examples:

learn "bash loops"
learn "git rebase"
learn "python decorators"
learn "docker containers"
learn "regular expressions"

Cheatsheet Generation

cheat <topic>

Generate comprehensive command cheatsheets for any tool, technology, or topic. Perfect for quick reference guides.

Features:

  • Most commonly used commands with explanations
  • Practical usage examples
  • Important options and flags
  • Tips and best practices
  • Clean, readable format (no code blocks)
  • Typewriter effect for better readability

Examples:

cheat git
cheat docker
cheat vim
cheat python
cheat bash

Content Generation

generate <description>

AI content generation helper. A convenient wrapper around the ai command specifically for content generation tasks.

Features:

  • Simplified syntax for content generation
  • Same powerful AI capabilities as ai command
  • Optimized for generating documentation, scripts, and content

Examples:

generate "README for Python project"
generate "bash script to backup files"
generate "documentation for API endpoints"

Note: This command is essentially a shortcut for ai "generate <description>".

AI Response Features

All AI commands share these features:

  • Typewriter Effect: Text appears character-by-character for better readability
  • Context Awareness: AI receives information about your system, project, and recent activity
  • Error Handling: Automatic retry on network errors with user confirmation
  • Internet Check: Verifies connectivity before making API calls
  • Session Tracking: AI interactions are tracked in session statistics

Best Practices

  • Be specific: Provide clear, detailed prompts for better results
  • Use context: The AI knows about your project and recent commands - leverage this
  • Review generated code: Always review AI-generated code before using in production
  • Save learning notes: Use learn command to build a knowledge base
  • Combine commands: Use explain after learning new concepts

💡 Pro Tip: The AI understands natural language commands. Try saying "switch to galaxy theme" or "use deepseek model" - it will understand and execute them!