System Commands
VritraAI provides enhanced system commands for navigation, information, and utility operations. These commands offer improved functionality over standard shell commands with better formatting, error handling, and integration with VritraAI's features.
📹 Video Tutorial
Watch our comprehensive video guide to learn about VritraAI features and commands.
Navigation Commands
cd <directory>
Smart directory navigation with error recovery. Automatically handles common navigation issues and provides helpful suggestions when directories don't exist. Supports path expansion for home directory (~) and environment variables ($VAR or ${VAR}).
Features:
- Smart error handling
- Automatic path resolution
- Path expansion for
~(home directory) and environment variables - Helpful error messages
- Integration with VritraAI's error recovery system
Path Expansion:
VritraAI automatically expands:
~to your home directory$VARor${VAR}to environment variable values
Examples:
# Navigate to directory
cd /home/user/projects
# Navigate to parent directory
cd ..
# Navigate to home directory (expanded automatically)
cd ~
cd ~/Documents
# Navigate using environment variables
cd $HOME/projects
cd ${HOME}/Documents
# Navigate to previous directory
cd -
Note: All file and directory commands in VritraAI support automatic path expansion for ~ and environment variables. This makes it easier to work with paths without manually expanding them.
Enhanced Path Navigation
VritraAI - introduces enhanced path navigation capabilities with support for parent directories and automatic directory changes.
New Path Features:
- Parent Directory Navigation: Use
..standalone to navigate to parent directory - Relative Path Navigation: Use
../folder,../../folderfor multi-level navigation - Home Directory Shortcuts: Use
~standalone or~/Documentsfor home directory navigation - Automatic Directory Change: Using
./folderor/path/to/folderautomatically changes directory if it's a folder - File Execution: Using
./script.pyor./script.shexecutes Python or bash scripts
Examples:
# Navigate to parent directory
..
# Navigate to parent's parent
../..
# Navigate to sibling directory
../sibling-folder
# Navigate to home directory (standalone)
~
# Navigate to Documents in home
~/Documents
# Automatic directory change
./my-folder
/path/to/my-folder
# Execute scripts
./script.py
./script.sh
Security: VritraAI includes path validation warnings for suspicious path traversal patterns (more than 3 ../ references) to prevent security risks.
Sudo Command Support
sudo <command>
Full sudo command execution with color preservation, security warnings, and intelligent validation. VritraAI - introduces comprehensive sudo support with enhanced safety features.
Features:
- Color Preservation: Sudo commands preserve colors (ls colors, grep colors, etc.)
- Command Validation: Checks if commands exist before execution
- Security Warnings: Detects and warns about dangerous operations (rm -rf, dd, etc.)
- Output Capture: Properly captures command output for
explain_lastfunctionality - Environment Preservation: Runs in bash shell with environment variable preservation
- Autocompletion: 30+ common sudo commands available via tab completion
Security Features:
- Dangerous command detection (rm -rf, dd, etc.) with confirmation prompts
- Command validation before execution
- Syntax error detection
- Blocked in chain commands for safety
Examples:
# Execute sudo commands with color preservation
sudo ls -la
sudo grep -r "pattern" /path
# System management commands
sudo apt update
sudo systemctl status service
sudo docker ps
# File operations
sudo cp file1 file2
sudo chmod +x script.sh
Dangerous Command Detection:
VritraAI automatically detects dangerous sudo operations and requires confirmation:
sudo rm -rf *- Recursive deletionsudo dd- Disk operationssudo rm -rf /- System deletion- Other destructive operations
Note: Sudo commands are blocked in chain commands (sudo cmd && other) for safety. Execute sudo commands separately. Sudo output is properly captured for explain_last functionality, allowing AI-powered analysis of sudo command results.
Platform Support: Sudo commands work on Linux systems. On non-Linux systems or mobile devices without sudo, VritraAI will show a warning that sudo is not available.
Security & Safety
safe_mode
Control safe mode protection for potentially dangerous commands. When enabled, VritraAI will prompt for confirmation before executing commands that could cause data loss or system damage.
Usage:
safe_mode- Show current safe mode statussafe_mode onorsafe_mode enable- Enable safe modesafe_mode offorsafe_mode disable- Disable safe mode
Features:
- Persistent setting saved in configuration file
- Protects against dangerous commands (rm, del, format, sudo rm -rf, etc.)
- Interactive confirmation prompts when enabled
- Works in conjunction with sudo security warnings
Examples:
# Show safe mode status
safe_mode
# Enable safe mode
safe_mode on
# Disable safe mode
safe_mode off
Note: For detailed documentation, see the Configuration Commands page. Safe mode works together with sudo security warnings to provide comprehensive protection against dangerous operations.
System Information
sys_info
Comprehensive system information display. Shows operating system details, Python version, CPU information, and boot time (if psutil is available).
Information Displayed:
- Operating system name and version
- System release and machine type
- Processor information
- Python version
- Boot time (if psutil available)
- CPU cores (logical and physical, if psutil available)
Examples:
# Show system information
sys_info
Note: Install psutil for more detailed system information including boot time and CPU core details. The sys_info command includes robust error handling and fallback methods for Termux/Android environments, ensuring reliable system information retrieval across different platforms.
disk_usage [path]
Human-readable disk usage statistics. Shows total, used, and free disk space with percentages for any path. Supports path expansion for home directory (~) and environment variables.
Features:
- Human-readable format (B, KB, MB, GB, TB)
- Shows total, used, and free space
- Percentage calculations
- Works with any path (defaults to current directory)
- Automatic path expansion for
~and environment variables
Parameters:
path- (Optional) Path to check. Defaults to current directory (.). Supports~and$VARexpansion
Examples:
# Check current directory disk usage
disk_usage
# Check specific path
disk_usage /home
disk_usage /var/log
uptime
Show system uptime and boot time. Uses multiple methods to determine uptime for maximum compatibility across platforms.
Features:
- Human-readable uptime format (days, hours, minutes, seconds)
- Boot time display
- Multi-method detection (works on Linux, Termux, and other systems)
- Fallback methods for compatibility
Examples:
# Show system uptime
uptime
memory
Memory usage statistics. Shows total RAM, available memory, used memory, cached memory, and swap information (if psutil is available).
Information Displayed:
- Total RAM
- Available memory (with percentage)
- Used memory (with percentage)
- Cached memory
- Swap total and used (if available)
Examples:
# Show memory information
memory
Requirement: This command requires psutil to be installed. Without it, memory information will not be available.
processes
Show running process information. Displays top processes sorted by CPU usage with PID, name, CPU percentage, and memory percentage.
Features:
- Top 10 processes by CPU usage
- Process ID (PID)
- Process name
- CPU usage percentage
- Memory usage percentage
Examples:
# Show top processes
processes
Requirement: This command requires psutil to be installed.
Environment Management
env [var] [value]
Show or modify environment variables. Can display all environment variables, show a specific variable, or set a variable for the current session.
Usage Modes:
env- Show all environment variablesenv <var>- Show specific environment variableenv <var> <value>- Set environment variable (session only)
Examples:
# Show all environment variables
env
# Show specific variable
env PATH
env HOME
# Set environment variable (session only)
env MY_VAR "value"
env DEBUG "true"
Note: Environment variables set with this command are only valid for the current VritraAI session. They do not persist after exiting.
path [add <dir>]
Show or modify PATH environment variable. Displays all PATH directories with existence indicators, or adds a directory to PATH for the current session.
Usage Modes:
path- Show all PATH directories with existence indicatorspath add <dir>- Add directory to PATH (session only)
Features:
- Shows all PATH directories
- Indicates if each directory exists (✅ or ❌)
- Adds directories to PATH for current session
Examples:
# Show PATH directories
path
# Add directory to PATH
path add /usr/local/bin
path add ~/bin
Note: PATH modifications are only valid for the current VritraAI session. They do not persist after exiting.
which <command>
Find the location of a command in the system PATH. Shows the full path to the executable or indicates if the command is not found.
Features:
- Finds command location in PATH
- Shows full path to executable
- Indicates if command is not found
Parameters:
command- Command name to locate
Examples:
# Find command location
which python
which git
which vritraai
Utility Commands
time
Show current time and date information. Displays local time, date, timestamp, and UTC time.
Information Displayed:
- Current local time (HH:MM:SS)
- Current date (YYYY-MM-DD with day name)
- Unix timestamp
- UTC time
Examples:
# Show current time
time
calc <expression>
Safe mathematical calculator. Evaluates mathematical expressions with support for standard math functions.
Features:
- Basic arithmetic operations (+, -, *, /)
- Mathematical functions (sqrt, sin, cos, log, etc.)
- Safe evaluation (no code execution)
- Built-in functions (abs, round, min, max)
Supported Functions:
All functions from Python's math module are available, plus abs, round, min, and max.
Examples:
# Basic calculations
calc "2+2"
calc "10*5+3"
calc "100/4"
# Mathematical functions
calc "sqrt(16)"
calc "sin(3.14159/2)"
calc "log(100)"
calc "pow(2, 8)"
Shell Commands
clear
Clear the terminal screen. Works on both Windows and Unix-like systems.
Examples:
# Clear screen
clear
exit
Exit VritraAI with enhanced analytics summary. Shows session statistics including commands executed, AI interactions, and session duration.
Session Summary Includes:
- Total commands executed
- AI interactions count
- Session duration
- Working directory
Examples:
# Exit VritraAI
exit
help
Show comprehensive help menu with all available commands organized by category. Displays command syntax, descriptions, and usage examples.
Examples:
# Show help
help
Best Practices
- Use sys_info: Check system information before troubleshooting
- Monitor resources: Use
memoryanddisk_usageto monitor system resources - Check processes: Use
processesto identify resource-intensive applications - Verify commands: Use
whichto verify command locations - Manage PATH: Use
pathto check and manage PATH directories - Session variables: Remember that
envandpath addchanges are session-only
💡 Pro Tip: Many system commands are automatically logged for the explain_last command, allowing you to get AI explanations of system command outputs.