🧩 Plugin System

Extend OSVM with custom commands, tools, themes, and integrations

4 Plugin Types
🔒 Secure Sandboxing
🔗 AI Integration
📦 Easy Distribution

[PLUGIN TYPES]

⌨️

Command Plugins

Add custom slash commands to the chat interface

/weather Boston /github create-issue /db query users
🔧

Tool Plugins

Provide MCP-style tools for AI integration

AI: "Get weather in Boston" → Uses weather tool automatically
🎨

Theme Plugins

Customize visual appearance and styling

osvm chat --theme cyberpunk osvm chat --theme minimal
🔌

Integration Plugins

Connect to external services and APIs

/slack send-message /aws deploy-lambda

[QUICK START]

Installing Plugins ← Click any command to copy
# List available plugins
$ osvm plugins list

# Install from local directory
$ osvm plugins install ./my-plugin/

# Install from GitHub repository
$ osvm plugins install github.com/user/weather-plugin

# Enable/disable plugins
$ osvm plugins enable weather-plugin
$ osvm plugins disable old-plugin

# Get plugin information
$ osvm plugins info weather-plugin
Creating Your First Plugin ← Click any command to copy
# Create plugin directory
$ mkdir ~/.osvm/plugins/my-plugin
$ cd ~/.osvm/plugins/my-plugin

# Create plugin manifest
$ touch plugin.json

# Create entry point script
$ touch main.py && chmod +x main.py

# Test your plugin
$ osvm plugins install .
$ osvm plugins enable my-plugin
Distributing Plugins ← Click any command to copy
# Create GitHub repository
$ git init && git add . && git commit -m "Initial plugin"

# Push to GitHub
$ git remote add origin https://github.com/user/my-plugin.git
$ git push -u origin main

# Others can now install with:
$ osvm plugins install github.com/user/my-plugin

[COMMAND PLUGINS]

Command plugins add new slash commands to the OSVM chat interface. They receive user input and return formatted responses.

How Command Plugins Work

1

User Types Command

/weather Boston
2

Plugin Receives Context

{"user_input": "/weather Boston", "session_id": "..."}
3

Plugin Returns Result

{"success": true, "output": "🌤️ Weather in Boston: 22°C"}

Complete Weather Plugin Example

Plugin Manifest (plugin.json)
{
  "name": "weather-plugin",
  "version": "1.0.0",
  "description": "Get weather information for any city",
  "author": "Your Name",
  "license": "MIT",
  "homepage": "https://github.com/yourusername/osvm-weather-plugin",
  "repository": "https://github.com/yourusername/osvm-weather-plugin",

  "plugin_type": "Command",
  "entry_point": "main.py",
  "dependencies": ["requests", "python-dotenv"],

  "permissions": [
    {"NetworkAccess": ["api.openweathermap.org"]},
    "EnvironmentAccess"
  ],

  "min_osvm_version": "0.8.0",
  "supported_platforms": ["linux", "macos", "windows"],

  "config_schema": {
    "type": "object",
    "properties": {
      "api_key": {
        "type": "string",
        "description": "OpenWeatherMap API key"
      },
      "default_units": {
        "type": "string",
        "enum": ["metric", "imperial"],
        "default": "metric"
      }
    },
    "required": ["api_key"]
  }
}
Python Implementation (main.py)
#!/usr/bin/env python3
import json
import sys
import requests
import os
from datetime import datetime

def main():
    # Read context from stdin
    context = json.loads(sys.stdin.read())

    # Parse command
    user_input = context["user_input"]
    city = user_input.replace("/weather", "").strip()

    if not city:
        return error_response("Please specify a city: /weather Boston")

    # Get configuration
    config = context.get("config", {})
    api_key = config.get("api_key")
    units = config.get("default_units", "metric")

    if not api_key:
        return error_response("API key not configured")

    # Fetch weather data
    try:
        weather_data = fetch_weather(city, api_key, units)
        return success_response(weather_data, city, units)
    except Exception as e:
        return error_response(f"Failed to get weather: {str(e)}")

def fetch_weather(city, api_key, units):
    url = "http://api.openweathermap.org/data/2.5/weather"
    params = {
        "q": city,
        "appid": api_key,
        "units": units
    }

    response = requests.get(url, params=params, timeout=10)
    response.raise_for_status()
    return response.json()

def success_response(data, city, units):
    temp = data["main"]["temp"]
    feels_like = data["main"]["feels_like"]
    description = data["weather"][0]["description"].title()
    humidity = data["main"]["humidity"]

    unit_symbol = "°C" if units == "metric" else "°F"

    output = f"""🌤️ Weather in {city}:
Temperature: {temp}{unit_symbol} (feels like {feels_like}{unit_symbol})
Condition: {description}
Humidity: {humidity}%
Updated: {datetime.now().strftime('%Y-%m-%d %H:%M')}"""

    result = {
        "success": True,
        "output": output,
        "data": {
            "city": city,
            "temperature": temp,
            "description": description,
            "humidity": humidity,
            "units": units
        },
        "suggestions": [
            f"/weather forecast {city}",
            f"/weather alerts {city}"
        ]
    }

    print(json.dumps(result))

def error_response(message):
    result = {
        "success": False,
        "error": message
    }
    print(json.dumps(result))

if __name__ == "__main__":
    main()
Using the Weather Plugin
# Install the plugin
$ osvm plugins install ./weather-plugin

# Configure API key
$ osvm plugins config weather-plugin api_key YOUR_API_KEY

# Use in chat
$ osvm chat
> /weather Boston
🌤️ Weather in Boston:
Temperature: 22°C (feels like 25°C)
Condition: Partly Cloudy
Humidity: 65%
Updated: 2024-01-15 14:30

> /weather forecast Boston
📅 5-Day Forecast for Boston:
Tomorrow: 18°C, Rain
Thu: 20°C, Cloudy
Fri: 24°C, Sunny
...

[TOOL PLUGINS]

Tool plugins provide MCP-style tools that AI can use automatically. They're perfect for data retrieval, analysis, and automation tasks.

AI Integration Example

User: "What's the weather like in Boston and should I bring an umbrella?"
AI: I'll check the weather in Boston for you.
🔧 weather-tool {"city": "Boston"}
AI: The weather in Boston is currently 22°C and partly cloudy with 65% humidity. There's no rain expected today, so you won't need an umbrella! It's a beautiful day for outdoor activities.

[THEME PLUGINS]

Theme plugins customize the visual appearance of OSVM interfaces. Create custom color schemes, layouts, and animations.

Creating Custom Themes

Theme Configuration (theme.json)
{
  "name": "my-custom-theme",
  "version": "1.0.0",
  "description": "My custom OSVM theme",
  "author": "Your Name",
  "plugin_type": "Theme",

  "colors": {
    "primary": "#00ff41",
    "secondary": "#ff00ff",
    "background": "#0d0208",
    "surface": "#1a0f0f",
    "text": "#e0e0e0",
    "accent": "#00ffff",
    "warning": "#ffaa00",
    "error": "#ff0055",
    "success": "#00ff41"
  },

  "styles": {
    "chat_input": {
      "background": "surface",
      "text": "text",
      "border": "accent",
      "border_width": 2
    },
    "message_user": {
      "text": "primary",
      "prefix": "► "
    },
    "message_assistant": {
      "text": "text",
      "prefix": "◉ "
    },
    "commands": {
      "text": "accent",
      "background": "transparent"
    }
  },

  "animations": {
    "typing_indicator": "dots",
    "transition_speed": "fast",
    "enable_particles": true
  }
}

[SECURITY & PERMISSIONS]

🔒 Sandboxed Execution

All plugins run in isolated environments with limited system access

📋 Permission System

Granular permissions for files, network, and system resources

🔍 Code Review

All plugin submissions undergo security review

🛡️ Safe Defaults

Plugins start with minimal permissions, request more as needed

Permission Types

ReadFiles(["~/data", "/tmp"]) Read access to specific directories
WriteFiles(["~/output"]) Write access to specific directories
NetworkAccess(["api.example.com"]) Network access to specific hosts
ExecuteCommands Execute system commands (high risk)
EnvironmentAccess Access to environment variables
MCPAccess Access to MCP servers
AIAccess Access to AI services

[PLUGIN MARKETPLACE]

🚀

Coming Soon: Plugin Marketplace

Discover, install, and share plugins through the official OSVM marketplace

🔍 Search & Discovery ⭐ Ratings & Reviews 🔄 Automatic Updates 🛡️ Security Scanning

[DEVELOPMENT RESOURCES]

🛠️ Tools & Templates

  • Plugin Generator CLI
  • TypeScript Plugin Template
  • Python Plugin Template
  • Rust Plugin Template

🤝 Community

  • Discord #plugin-dev Channel
  • GitHub Discussions
  • Plugin Showcase
  • Monthly Developer Calls

🔧 Advanced Topics

  • Custom Permission Types
  • Plugin Performance Optimization
  • Error Handling Best Practices
  • Multi-Language Support