🔌 vx-plugin
Extensible Plugin System for the vx Universal Tool Manager
Powerful, trait-based plugin architecture with beautiful installation experience
🎯 Overview
vx-plugin provides the powerful plugin architecture for vx, enabling developers to create custom tools and package managers that integrate seamlessly with the vx ecosystem. With the integration of vx-installer, plugins now benefit from beautiful progress tracking and advanced installation capabilities.
✨ Features
🔧 Core Plugin System
- Tool Plugins: Create custom tool implementations with automatic version management
- Package Manager Plugins: Integrate custom package managers with unified interfaces
- Plugin Registry: Discover and manage plugins dynamically with hot-loading support
- Extensible Architecture: Clean trait-based design for maximum flexibility and type safety
🚀 Enhanced Installation Integration
- 🎨 Beautiful Progress Bars: Automatic progress tracking for all plugin installations
- 📦 Universal Format Support: Plugins can handle ZIP, TAR.GZ, TAR.XZ, TAR.BZ2, and binaries
- 🔒 Security First: Built-in checksum verification and secure downloads for plugin tools
- ⚡ Async Performance: Non-blocking operations with concurrent installation support
🛠️ Advanced Features
- Dynamic Loading: Load plugins at runtime with dependency resolution
- Version Constraints: Sophisticated version matching and constraint resolution
- Error Recovery: Comprehensive error handling with helpful suggestions
- Cross-Platform: Seamless operation across Windows, macOS, and Linux
Quick Start
Creating a Simple Tool Plugin
use ;
use async_trait;
;
Creating a Package Manager Plugin
use ;
use async_trait;
use Path;
;
Creating a Combined Plugin
use ;
use async_trait;
;
🚀 Enhanced Installation Features
vx-plugin integrates seamlessly with the vx-installer engine to provide beautiful installation experiences:
📊 Automatic Progress Tracking
When your plugin installs tools, users automatically get:
# Beautiful progress bars appear automatically
)
🔒 Built-in Security
All plugin installations automatically include:
- HTTPS-only downloads for secure connections
- Automatic checksum verification to ensure file integrity
- Secure archive extraction with path validation
- Permission validation before installation
📦 Universal Format Support
Your plugins can handle multiple archive formats without additional code:
// This automatically handles ZIP, TAR.GZ, TAR.XZ, TAR.BZ2, and raw binaries
async
Core Traits
VxTool
The VxTool trait is the core interface for implementing tool support. Tools can be anything from compilers and interpreters to CLI utilities and development tools.
Required Methods:
name()- Return the tool namefetch_versions()- Fetch available versions from the tool's source
Optional Methods (Enhanced with vx-installer):
install_version()- Install a specific version with beautiful progress barsdefault_install_workflow()- Custom installation with automatic progress trackingexecute()- Execute the tool with arguments and environment isolationget_status()- Get tool installation status with detailed informationget_download_url()- Provide download URLs for automatic installationverify_installation()- Verify tool installation integrity- And many more with sensible defaults and enhanced UX
VxPackageManager
The VxPackageManager trait provides a unified interface for different package managers across various ecosystems.
Required Methods:
name()- Return the package manager nameecosystem()- Return the ecosystem (Node, Python, Rust, etc.)install_packages()- Install packages in a project
Optional Methods:
remove_packages()- Remove packagesupdate_packages()- Update packageslist_packages()- List installed packagessearch_packages()- Search for packages
VxPlugin
The VxPlugin trait is the main interface for creating plugins that can provide both tools and package managers.
Required Methods:
name()- Return the plugin name
Optional Methods:
tools()- Return tools provided by this pluginpackage_managers()- Return package managers provided by this plugininitialize()- Initialize the pluginshutdown()- Shutdown the plugin
Plugin Registry
The PluginRegistry manages all loaded plugins and provides discovery functionality:
use ;
// Create a registry with plugins
let registry = new
.with_plugin
.build
.await?;
// Use the registry
let tool = registry.get_tool;
let pm = registry.get_package_manager;
Examples
See the examples/ directory for complete working examples:
simple_tool_plugin.rs- Basic tool plugin implementationpackage_manager_plugin.rs- Package manager plugin implementationcombined_plugin.rs- Plugin providing both tools and package managers
🔗 Related Crates
vx-installer- 🆕 Universal installation engine with progress trackingvx-core- Core functionality and utilitiesvx-cli- Command-line interface with rich UXvx-config- Configuration management system
Example Plugins
vx-tool-node- Node.js tool plugin with NPX supportvx-tool-uv- UV Python tool plugin with UVX supportvx-tool-go- Go toolchain pluginvx-tool-rust- Rust and Cargo pluginvx-pm-npm- NPM package manager plugin
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Build powerful plugins for the vx ecosystem