Extra Features

VritraAI includes many advanced features that enhance your terminal experience beyond basic command execution. These features provide intelligent assistance, security, convenience, and powerful capabilities for developers and system administrators.

Error Recovery System

Intelligent Error Handling

VritraAI includes a sophisticated error recovery system that provides AI-powered assistance when errors occur. Instead of silent failures, you get helpful explanations and suggestions.

Features:

  • AI-powered error analysis and explanation
  • Context-aware error messages
  • Automatic fix suggestions
  • Recovery recommendations
  • Graceful handling of missing files and invalid paths

How It Works:

When an error occurs during command execution, VritraAI:

  1. Captures the error and context
  2. Analyzes the error using AI
  3. Provides a detailed explanation
  4. Suggests fixes and alternatives
  5. Offers recovery options

Example:

If you try to read a file that doesn't exist, VritraAI will explain the error and suggest checking the file path, listing the directory, or creating the file if needed.

Command Logging System

Smart Command Logging

VritraAI automatically logs system commands and whitelisted built-in commands for the explain_last feature. This enables intelligent command explanation and analysis.

Whitelisted Commands:

The following commands are automatically logged:

  • File Operations: ls, dir, search_file, find_files
  • Utilities: hash, validate, format
  • Search: search_regex
  • Navigation: cd
  • System Info: sys_info, disk_usage, env, path, which
  • System Monitoring: uptime, memory, processes
  • Utilities: time, calc, template
  • Encoding: encode, decode

Features:

  • Automatic logging of system commands
  • Output capture including Rich-formatted output
  • Exit code tracking
  • Command history preservation
  • Integration with explain_last command

Log File:

Commands are logged to: ~/.config-vritrasecz/vritraai/lastcmd.log

Multi-Command Execution

Command Chaining

VritraAI supports command chaining with strict validation for safety. Execute multiple commands in sequence or conditionally.

Supported Separators:

  • ; - Sequential execution (always executes all commands)
  • && - Conditional execution (executes next command only if previous succeeds)

Rules:

  1. Only System Commands: Multi-command sequences only allow system commands and whitelisted built-ins
  2. No AI Commands: AI commands must be executed separately
  3. Validation: Each command in the sequence is validated before execution
  4. Labeled Output: Each command's output is labeled for clarity

Allowed Commands in Multi-Command:

  • File Operations: ls, dir, read_file, search_file, mkdir, create_dir, find_files, compare, diff, hash, validate, format, tree
  • System Commands: cd, clear, exit, help, sys_info, disk_usage, env, path, which, uptime, memory, processes, time, calc, config, template, theme, prompt, encode, decode, network, analyze_system
  • API/Model Management: apikey, api_base, model

Examples:

# Sequential execution
ls -la; cd /tmp; pwd

# Conditional execution
cd /path && ls -la && pwd

# Mixed operations
sys_info; disk_usage /home; memory

Built-in Aliases

Command Shortcuts

VritraAI includes built-in aliases for common commands, providing convenient shortcuts for frequently used operations.

Available Aliases:

  • llls -la - Long listing with hidden files
  • lals -a - List all files including hidden
  • lls - Simple list
  • gpgit push - Git push
  • gsgit status - Git status
  • gagit add - Git add
  • gcgit commit - Git commit

Usage:

# Use aliases like regular commands
ll
gs
ga file.txt
gc -m "Initial commit"

Interactive Shell Features

Enhanced Terminal Experience

VritraAI uses prompt-toolkit to provide a rich, interactive shell experience with advanced features.

Features:

  • Command History: Persistent command history across sessions
  • Auto-completion: Intelligent command and path completion
  • Auto-suggestions: Suggestions based on command history
  • Syntax Highlighting: Rich syntax highlighting for code and commands
  • Multi-line Input: Support for multi-line commands
  • Keyboard Shortcuts: Standard terminal keyboard shortcuts

History File:

Command history is stored in: ~/.config-vritrasecz/vritraai/history

Completion Features:

  • Command name completion
  • File and directory path completion
  • Built-in command suggestions
  • Context-aware completions

Rich Formatting

Beautiful Terminal Output

VritraAI uses the Rich library to provide beautiful, formatted terminal output with colors, tables, panels, and syntax highlighting.

Features:

  • Color-coded output (success, error, warning, info)
  • Syntax highlighting for code files
  • Formatted tables for structured data
  • Panels and borders for better organization
  • Progress indicators
  • Markdown rendering support

Benefits:

  • Easier to read command output
  • Better visual organization
  • Improved error visibility
  • Professional appearance

Security Features

Built-in Security

VritraAI includes multiple security features to protect you from accidental mistakes and dangerous operations.

Dangerous Command Warnings:

The following commands require confirmation before execution:

  • rm -rf, rm -rfv, rm *
  • dd, mkfs, fdisk
  • shutdown, reboot, halt
  • chmod 777, chown -R
  • sudo rm, sudo dd
  • > /dev/null, truncate, shred

Safe Mode:

Enhanced protection mode that provides additional warnings and confirmations for potentially dangerous operations.

Command Validation:

Commands are validated before execution to ensure they're safe and valid.

Session Logging:

Complete audit trail of all commands executed, providing accountability and debugging capabilities.

Session Management

Session Tracking

VritraAI tracks your session data including commands executed, files modified, and session statistics.

Session Information:

  • Session start time
  • Commands executed
  • Files modified
  • Session duration
  • Statistics and summaries

Session Files:

  • Session Log: ~/.config-vritrasecz/vritraai/session.log
  • Command History: ~/.config-vritrasecz/vritraai/history
  • Last Command Log: ~/.config-vritrasecz/vritraai/lastcmd.log

Session Commands:

  • session - Show session information
  • session save [filename] - Save session to JSON
  • session clear - Clear session data

Platform Compatibility

Cross-Platform Support

VritraAI is designed to work across different platforms with platform-specific optimizations.

Linux Compatibility:

  • Full support for Linux distributions
  • Uses standard Linux commands and utilities
  • Compatible with common Linux shells
  • Works with system package managers

Termux Compatibility:

  • Optimized for Termux on Android
  • Uses Termux-specific paths and utilities
  • Compatible with Termux package manager
  • Works with Android file system

Windows Compatibility:

  • Cross-platform Python code
  • Windows-specific command handling
  • Path handling for Windows

Configuration Persistence

Automatic Configuration Saving

All configuration changes are automatically saved and persist across sessions.

Automatically Saved Settings:

  • Theme preferences
  • Prompt style preferences
  • API keys (securely stored)
  • Model selections
  • API base preferences
  • Banner preferences
  • System settings (safe mode, auto backup, etc.)

Configuration Location:

~/.config-vritrasecz/vritraai/config.json

Backup System:

Automatic backups are created when configuration is updated, ensuring you can recover from accidental changes.

Best Practices

  • Use command logging: Take advantage of automatic command logging for explain_last
  • Chain commands safely: Use multi-command execution for related operations
  • Leverage aliases: Use built-in aliases to speed up common tasks
  • Review dangerous commands: Always review confirmation prompts for dangerous operations
  • Save sessions: Use session save to export important work sessions
  • Check history: Use history to recall previous commands
  • Enable safe mode: Keep safe mode enabled for additional protection

💡 Pro Tip: Combine multiple features for powerful workflows. For example, chain commands together, use explain_last to understand the results, and save your session for future reference!