Skip to content

openSVM/osvm-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OSVM CLI

License: MIT Rust Solana

A powerful command-line interface for managing Solana Virtual Machines (SVMs) across networks. Deploy, monitor, and manage SVM infrastructure with AI assistance, MCP server integration, and extensible plugin architecture.

πŸš€ Quick Start

Installation

One-line install:

curl -sSf https://raw.githubusercontent.com/opensvm/osvm-cli/main/install.sh | sh

Alternative methods:

Windows, Docker, and Source installations

Windows:

powershell -Command "Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/opensvm/osvm-cli/main/install.ps1' -OutFile 'install.ps1'; .\install.ps1"

Docker:

docker pull ghcr.io/opensvm/osvm-cli:latest
docker run --rm ghcr.io/opensvm/osvm-cli:latest --version

From Source:

git clone https://github.com/opensvm/osvm-cli.git
cd osvm-cli && cargo build --release
sudo cp target/release/osvm /usr/local/bin/

First Steps

# Check installation
osvm --version

# List available SVMs
osvm svm list

# Get help and examples
osvm examples

# Launch interactive dashboard
osvm svm dashboard

πŸ“‹ Table of Contents

Getting Started

SVM Operations

Advanced Features

Tools & Monitoring

Development

πŸ—οΈ Core Features

Infrastructure Management

  • SVM Deployment - Deploy and manage Solana Virtual Machines across networks
  • Node Operations - Validator and RPC node deployment with automated configuration
  • Remote Management - SSH-based deployment and monitoring
  • Multi-Network Support - Mainnet, testnet, and devnet operations

Intelligence & Automation

  • AI Integration - Built-in AI for security analysis and blockchain queries
  • MCP Server Support - Connect to specialized blockchain data services
  • Plugin Architecture - Extend functionality with custom commands and tools
  • Self-Repair Systems - Automated maintenance and diagnostics

Monitoring & Performance

  • Interactive Dashboard - Real-time TUI monitoring interface
  • Performance Tracking - TPS, latency, and resource monitoring
  • Log Management - Centralized logging and analysis
  • Health Checks - Automated system diagnostics

πŸ“– Basic Commands

Information & Help

# Get help and examples
osvm examples
osvm examples --category svm

# Check system health
osvm doctor
osvm doctor --fix

# Get wallet balance
osvm balance [ADDRESS]

SVM Operations

# List all SVMs
osvm svm list

# Get SVM details
osvm svm get sonic

# Interactive SVM dashboard
osvm svm dashboard

AI Assistance

# Ask AI questions
osvm "How do I deploy a validator?"
osvm "What are Solana security best practices?"
osvm "Explain this error message: [paste error]"

πŸ”§ SVM Management

Viewing SVMs

# List all available SVMs
osvm svm list

# Get detailed information about a specific SVM
osvm svm get sonic
osvm svm get solana
osvm svm get eclipse

Interactive Dashboard

# Launch comprehensive SVM monitoring dashboard
osvm svm dashboard

Dashboard Features:

  • Overview of all SVMs with status indicators
  • Network details (mainnet, testnet, devnet)
  • Performance metrics with real-time visualization
  • Node status monitoring with resource usage
  • Aggregated logs from all nodes

Keyboard Controls:

  • Tab, β†’, ←: Switch between tabs
  • ↑, ↓: Navigate through items
  • n/p: Select next/previous SVM
  • v: Toggle verbosity level
  • h: Toggle help overlay
  • q or Ctrl+C: Quit

πŸš€ Node Deployment

Single Node Deployment

# Deploy validator node (mainnet)
osvm user@host --svm sonic --node-type validator --network mainnet

# Deploy RPC node (testnet)
osvm user@host --svm sonic --node-type rpc --network testnet

# Deploy to devnet for testing
osvm user@host --svm solana --node-type validator --network devnet

Multi-SVM Deployment

# Deploy multiple SVMs to a single server
osvm user@host --svm sonic,solana,eclipse,soon --node-type validator --network devnet

Node Management

# List deployed nodes
osvm nodes list

# Check node status
osvm nodes status NODE-ID

# View node logs
osvm nodes logs NODE-ID
osvm nodes logs NODE-ID --follow

# Control node operations
osvm nodes restart NODE-ID
osvm nodes stop NODE-ID

πŸ“‘ RPC Services

RPC Deployment

# Deploy Sonic RPC node
osvm rpc sonic user@host --network mainnet

# Deploy with specific configuration
osvm rpc sonic user@host --network testnet --version latest

Local Development

# Start local test validator (instant setup)
osvm rpc-manager test --background --reset

# Check test validator status
osvm rpc-manager test --status

# Stop test validator
osvm rpc-manager test --stop

RPC Monitoring

# Monitor RPC logs
osvm rpc-manager devnet --logs
osvm rpc-manager devnet --logs --follow --lines 100

# Query Solana network
osvm rpc-manager query-solana --info
osvm rpc-manager query-solana --health

RPC Features:

  • Test Validator: Local development with built-in faucet
  • Devnet RPC: Real devnet validator with auto-repair
  • Network Monitoring: Health checks and performance metrics
  • Auto-Configuration: Handles dependencies and setup automatically

πŸ’Ύ eBPF Deployment

Basic Deployment

# Deploy to all networks
osvm deploy ./program.so \
  --program-id ./program-id.json \
  --owner ./owner-keypair.json \
  --fee ./fee-payer.json \
  --publish-idl

# Deploy to specific network
osvm deploy ./program.so \
  --program-id ./program-id.json \
  --owner ./owner-keypair.json \
  --fee ./fee-payer.json \
  --network mainnet

Advanced Deployment

# Deploy with custom IDL
osvm deploy ./program.so \
  --program-id ./program-id.json \
  --owner ./owner-keypair.json \
  --fee ./fee-payer.json \
  --publish-idl \
  --idl-file ./custom-idl.json

File Requirements

Keypair files (for new deployments):

[123,45,67,89,...,234]  // Array of 64 bytes

Pubkey-only files (for upgrades):

{"programId": "HN4tEEGheziD9dqcWg4xZd29htcerjXKGoGiQXM5hxiS"}

Required files:

  • eBPF binary (.so file)
  • Program ID (keypair for new, pubkey for upgrades)
  • Program owner keypair (private key required)
  • Fee payer keypair (private key required)

πŸ€– AI Integration

AI Configuration

# Set up OpenAI
export OPENAI_URL="https://api.openai.com/v1/chat/completions"
export OPENAI_KEY="sk-your-openai-api-key"

# Use local AI (Ollama)
export OPENAI_URL="http://localhost:11434/v1/chat/completions"
export OPENAI_KEY="ollama-key"

AI Queries

# General blockchain questions
osvm "What are the best practices for Solana smart contract security?"

# Deployment guidance
osvm "Help me optimize my validator performance"

# Error analysis
osvm "Analyze this smart contract for vulnerabilities"

Security Auditing

# Audit local code
osvm audit

# Audit GitHub repository
osvm audit https://github.com/user/solana-program

# Audit with specific output format
osvm audit ./contracts --format json --output ./audit-report.json

AI Features:

  • Smart contract security analysis
  • Automated code review
  • Best practices guidance
  • Multi-provider support (OpenAI, Anthropic, local models)
  • Privacy-focused local AI options

πŸ”Œ MCP Server Management

Model Context Protocol (MCP) integration provides specialized blockchain data access and external service connections.

Quick Setup

# Quick setup with Solana MCP server
osvm mcp setup --auto-enable

# List configured servers
osvm mcp list

# Test connectivity
osvm mcp test solana-server

Adding Servers

From GitHub:

# Add official Solana MCP server
osvm mcp add-github solana-mcp https://github.com/openSVM/solana-mcp-server --enabled

# Add custom server
osvm mcp add-github my-server https://github.com/user/custom-mcp-server --enabled

Manual Configuration:

# HTTP server with authentication
osvm mcp add blockchain-data \
  --server-url https://api.blockchain-mcp.com \
  --transport http \
  --auth-type bearer \
  --auth-token your-token \
  --enabled

# WebSocket server
osvm mcp add realtime-data \
  --server-url wss://ws.realtime-mcp.com \
  --transport websocket \
  --auth-type api_key \
  --auth-token your-key \
  --enabled

Using MCP Tools

# List available tools
osvm mcp tools
osvm mcp tools solana-server

# Execute blockchain queries
osvm mcp call solana-server getBalance \
  --args '{"pubkey":"11111111111111111111111111111112"}'

# Chain operations
osvm mcp call solana-server getStakeAccounts \
  --args '{"staker":"Your-Address"}' | \
osvm mcp call solana-server getStakeRewards \
  --args '{"accounts":"@stdin"}'

Server Management

# Enable/disable servers
osvm mcp enable solana-server
osvm mcp disable old-server

# Remove server
osvm mcp remove unused-server

# Search servers
osvm mcp search "solana balance"
Authentication Methods

Bearer Token:

osvm mcp add api-server \
  --server-url https://api.example.com \
  --auth-type bearer \
  --auth-token "Bearer eyJ0eXAiOiJKV1Q..."

API Key:

osvm mcp add data-server \
  --server-url https://data.example.com \
  --auth-type api_key \
  --auth-token "your-api-key"

Basic Auth:

osvm mcp add secure-server \
  --server-url https://secure.example.com \
  --auth-type basic \
  --username your-username \
  --password your-password

🧩 Plugin System

OSVM's plugin architecture allows extending functionality with custom commands, tools, themes, and integrations.

Plugin Management

# List installed plugins
osvm plugins list

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

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

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

# Get plugin info
osvm plugins info weather-plugin

Plugin Types

Command Plugins - Add slash commands:

/echo Hello World      # Built-in example
/weather Boston        # Custom weather plugin
/deploy contracts/     # Custom deployment plugin

Tool Plugins - Provide AI-accessible tools:

# Tools become available to AI automatically
osvm chat "Get the weather in Boston"

Theme Plugins - Visual customization:

osvm chat --theme cyberpunk
osvm chat --theme minimal-dark

Integration Plugins - External services:

/github create-issue "Fix deployment bug"
/db query "SELECT * FROM transactions LIMIT 10"

For detailed plugin development instructions, see Plugin Development.

πŸ“Š Dashboard

Launch the interactive monitoring dashboard:

osvm svm dashboard

Features:

  • Real-time SVM status monitoring
  • Network performance metrics
  • Node resource usage tracking
  • Integrated log viewing
  • Multi-tab interface

Navigation:

  • Tab/Shift+Tab: Switch tabs
  • ↑/↓: Navigate lists
  • Enter: Select/activate
  • q: Quit dashboard

πŸ” System Health

Health Checks

# Run comprehensive diagnostics
osvm doctor

# Auto-fix issues
osvm doctor --fix

# Check specific components
osvm doctor --system-only
osvm doctor --network-only

Self-Repair System

The built-in self-repair system automatically detects and fixes common issues:

  • System Dependencies - Missing build tools, outdated packages
  • User Configuration - Invalid configs, missing keypairs
  • Network Issues - RPC endpoint failures, connectivity problems
  • Permission Problems - File access, system tuning requirements

βš™οΈ CI/CD Integration

Deploy SVM nodes directly from GitHub workflows:

- name: Deploy SVM Node
  uses: ./.github/actions/svm-deploy
  with:
    svm-name: 'my-svm'
    host: '[email protected]'
    ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
    network: 'devnet'
    node-type: 'validator'

Features:

  • Secure deployment using GitHub Secrets
  • Multi-network and node type support
  • Detailed deployment logging
  • Reusable workflow components

View Complete CI/CD Documentation

πŸ› οΈ Plugin Development

Creating Your First Plugin

1. Setup Plugin Directory:

mkdir ~/.osvm/plugins/weather-plugin
cd ~/.osvm/plugins/weather-plugin

2. Create Plugin Manifest (plugin.json):

{
  "name": "weather-plugin",
  "version": "1.0.0",
  "description": "Get weather information for any city",
  "author": "Your Name",
  "license": "MIT",
  "plugin_type": "Command",
  "entry_point": "weather.py",
  "dependencies": ["requests"],
  "permissions": [
    {"NetworkAccess": ["api.openweathermap.org"]},
    "EnvironmentAccess"
  ],
  "min_osvm_version": "0.8.0",
  "supported_platforms": ["linux", "macos", "windows"]
}

3. Create Plugin Script (weather.py):

#!/usr/bin/env python3
import json
import sys
import requests
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:
        result = {
            "success": False,
            "error": "Please specify a city: /weather Boston"
        }
        print(json.dumps(result))
        return

    # Get weather data (simplified example)
    try:
        # Your weather API logic here
        result = {
            "success": True,
            "output": f"🌀️ Weather in {city}: 22°C, Partly Cloudy",
            "suggestions": [f"/weather forecast {city}"]
        }
    except Exception as e:
        result = {
            "success": False,
            "error": f"Failed to get weather: {str(e)}"
        }

    print(json.dumps(result))

if __name__ == "__main__":
    main()

4. Make Executable and Test:

chmod +x weather.py
osvm plugins install .
osvm plugins enable weather-plugin

# Test in chat
osvm chat
# Type: /weather Boston

Advanced Plugin Development

Rust Tool Plugin Example

Cargo.toml:

[package]
name = "osvm-database-plugin"
version = "1.0.0"
edition = "2021"

[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1.0", features = ["full"] }
anyhow = "1.0"

src/main.rs:

use anyhow::Result;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

#[derive(Deserialize)]
struct PluginContext {
    user_input: String,
    session_id: String,
    config: HashMap<String, serde_json::Value>,
}

#[derive(Serialize)]
struct PluginResult {
    success: bool,
    output: String,
    error: Option<String>,
    suggestions: Vec<String>,
}

#[tokio::main]
async fn main() -> Result<()> {
    let mut input = String::new();
    std::io::stdin().read_line(&mut input)?;
    let context: PluginContext = serde_json::from_str(&input)?;

    // Your plugin logic here
    let result = PluginResult {
        success: true,
        output: "Database query executed successfully".to_string(),
        error: None,
        suggestions: vec![]
    };

    println!("{}", serde_json::to_string(&result)?);
    Ok(())
}
Theme Plugin Example

theme.json:

{
  "name": "cyberpunk-theme",
  "version": "1.0.0",
  "plugin_type": "Theme",
  "colors": {
    "primary": "#00ff41",
    "secondary": "#ff00ff",
    "background": "#0d0208",
    "text": "#00ff41",
    "accent": "#00ffff"
  },
  "styles": {
    "chat_input": {
      "background": "background",
      "text": "primary",
      "border": "accent"
    },
    "message_user": {
      "text": "primary",
      "prefix": "β–Ί "
    },
    "message_assistant": {
      "text": "text",
      "prefix": "β—‰ "
    }
  }
}

Plugin Security

Permission System:

  • ReadFiles(["~/data"]) - File read access
  • WriteFiles(["~/output"]) - File write access
  • ExecuteCommands - System command execution
  • NetworkAccess(["api.example.com"]) - Network access
  • EnvironmentAccess - Environment variables
  • MCPAccess - MCP server access
  • AIAccess - AI service access

Best Practices:

  • Request minimal permissions
  • Validate all user input
  • Use secure connections
  • Handle errors gracefully
  • Store secrets in config, not code

πŸ“š Documentation

Core Guides

Advanced Features

Development Resources

For complete documentation, visit docs.opensvm.org.

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Setup

Install Pre-commit Hooks:

./install-pre-commit-hook.sh

Development Commands:

# Format code
cargo fmt --all

# Run linting
cargo clippy --all-targets --all-features

# Run tests
cargo test

# Build and test
make dev

Code Quality Checks:

  • cargo fmt --all -- --check - Formatting verification
  • cargo clippy - Linting checks
  • cargo test - Test suite

Monetization Strategy & Business Model

$OVSM Token Economy

Tiered Token Gating System:

  • Platinum Tier (1M+ tokens): 1 $OVSM per AI prompt
  • Gold Tier (100k+ tokens): 10 $OVSM per AI prompt
  • Silver Tier (<100k tokens): 100 $OVSM per AI prompt
  • Guest Users: 10 prompts / day free, then 200 $OVSM per AI prompt

Premium Feature Gates:

  • Social Features: Minimum 100,000 $OVSM token holding required
  • Advanced Analytics: Token consumption for complex queries
  • Unlimited Threads: Premium tier exclusive (free users limited to 10)
  • Extended AI Reasoning: 5 expansions for free, unlimited for premium

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


Need Help?