Configuration Commands

VritraAI provides commands to view your current configuration and create code templates for quick project setup. The configuration system automatically saves your settings and persists them across sessions.

View Configuration

config

Show current VritraAI configuration. Displays all settings including AI configuration, UI preferences, system settings, and configuration file information. This is a read-only command that provides a comprehensive view of your current setup.

Configuration Sections:

  • 🤖 AI Configuration:
    • API Base (OpenRouter/Gemini)
    • AI Enabled status
    • Current model with display name and ID
    • API key status (configured/not configured)
  • 🎨 UI Configuration:
    • Current theme
    • Prompt style
    • Banner ID and name
    • Banner mode (Random/Fixed)
    • Banner color sync mode
  • ⚙️ System Configuration:
    • Safe Mode status
    • Auto Backup status
  • 📁 Configuration Files:
    • Config file path
    • Backup existence status
    • Last updated timestamp
    • Update count

Examples:

# Show current configuration
config

Note: This command is read-only. To change configuration values, use the appropriate commands like theme, prompt, apikey, model set, etc. All changes are automatically saved to the configuration file.

Related Commands:

  • model - Manage AI models
  • theme - Change UI themes
  • prompt - Change prompt styles
  • apikey - Manage API keys
  • api_base - Switch API providers
  • banner - Manage MOTD banners
  • safe_mode - Control safe mode protection

Safe Mode

safe_mode [on|off|enable|disable]

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 Modes:

  • safe_mode - Show current safe mode status and help menu
  • safe_mode on or safe_mode enable - Enable safe mode
  • safe_mode off or safe_mode disable - Disable safe mode

Features:

  • Persistent setting saved in configuration file
  • Protects against dangerous commands (rm, del, format, etc.)
  • Interactive confirmation prompts when safe mode is enabled
  • Status display shows current mode and provides quick help

Protected Commands:

When safe mode is enabled, the following types of commands require confirmation:

  • File deletion commands (rm, del, unlink)
  • Format/wipe commands (format, wipe, dd)
  • System modification commands (chmod 000, chown with dangerous patterns)
  • Other potentially destructive operations

Examples:

# Show safe mode status
safe_mode

# Enable safe mode
safe_mode on
safe_mode enable

# Disable safe mode
safe_mode off
safe_mode disable

Note: Safe mode setting is persistent and saved in your configuration file. It will remain enabled or disabled across sessions until you change it. When safe mode is enabled, you'll be prompted to confirm before executing potentially dangerous commands.

Code Templates

template <type> [filename]

Create code template files for quick project setup. Generates starter files with proper structure, shebangs, and basic boilerplate code. Automatically handles filename conflicts by generating unique names when needed.

Available Templates:

  • python - Basic Python script template with main function
  • bash - Basic bash script template with error handling
  • html - Basic HTML page template with proper structure
  • readme - Project README template with standard sections

Template Details:

Python Template

Creates a Python script with:

  • Shebang line (#!/usr/bin/env python3)
  • Module docstring
  • Main function structure
  • Standard if __name__ == '__main__' guard

Default filename: script.py

Bash Template

Creates a bash script with:

  • Shebang line (#!/bin/bash)
  • Error handling (set -e)
  • Basic structure

Default filename: script.sh

HTML Template

Creates an HTML page with:

  • Proper DOCTYPE declaration
  • Meta tags (charset, viewport)
  • Basic page structure

Default filename: index.html

README Template

Creates a README file with:

  • Project title section
  • Description section
  • Installation section with code blocks
  • Usage section with code blocks
  • License section (MIT License)

Default filename: README.md

Features:

  • Smart filename generation to avoid conflicts
  • Overwrite confirmation if file exists (when filename specified)
  • Automatic unique filename generation (when filename not specified)
  • Tracks created files in session

Parameters:

  • type - Template type (python, bash, html, readme)
  • filename - (Optional) Custom filename. If not provided, uses default filename

Examples:

# Show available templates
template

# Create Python script with default name
template python

# Create Python script with custom name
template python my_script.py

# Create bash script
template bash setup.sh

# Create HTML page
template html index.html

# Create README file
template readme README.md

Smart Filename Handling:

  • If you specify a filename and it exists, you'll be prompted to overwrite
  • If you don't specify a filename and the default exists, a unique name will be generated automatically
  • Created files are tracked in your session for easy reference

Configuration Management

VritraAI uses a unified configuration system that automatically saves your settings:

Configuration Location

  • Config Directory: ~/.config-vritrasecz/vritraai/
  • Config File: ~/.config-vritrasecz/vritraai/config.json
  • Backup File: Automatically created when configuration is updated

Automatic Configuration Saving

The following commands automatically save configuration changes:

  • theme <name> - Saves theme preference
  • prompt <style> - Saves prompt style preference
  • apikey <provider> <key> - Saves API keys
  • api_base <provider> - Saves API base preference
  • model set <id> - Saves model selection
  • banner set <id> - Saves banner preference

Configuration Persistence

All configuration changes persist across sessions. When you restart VritraAI, your settings are automatically loaded from the configuration file.

Best Practices

  • Check configuration regularly: Use config to verify your settings
  • Use templates for quick starts: Use template to quickly scaffold new projects
  • Backup configuration: The system automatically creates backups, but you can manually backup the config directory
  • Customize templates: After creating a template, edit it to fit your project needs
  • Verify settings: After changing settings, use config to confirm they were saved

💡 Pro Tip: Use template to quickly create starter files for new projects. Combine multiple templates to scaffold a complete project structure in seconds!