🔧 vx-core
Core Engine for the vx Universal Tool Manager
Foundational traits, types, and utilities powering the vx ecosystem
🎯 Overview
vx-core
provides the foundational traits, types, and utilities that power the vx tool management system. It defines the core abstractions for tool management, version handling, configuration, and plugin architecture. With the integration of vx-installer, it now offers state-of-the-art installation capabilities with beautiful progress tracking.
✨ Features
🔧 Core Functionality
- Tool Management: Advanced traits for tool installation, version management, and execution
- Plugin Architecture: Extensible plugin system with trait-based design for adding new tools
- Configuration Management: Unified configuration system using Figment with TOML support
- Version Handling: Semantic version parsing, comparison, and constraint resolution
🚀 Enhanced Installation System (via vx-installer)
- 🎨 Beautiful Progress Bars: Rich progress tracking with ETA and transfer rates
- 📦 Universal Format Support: ZIP, TAR.GZ, TAR.XZ, TAR.BZ2, and raw binaries
- 🔒 Security First: Built-in checksum verification and secure HTTPS downloads
- ⚡ Async Performance: Lightning-fast concurrent downloads and installations
- 🎯 Flexible Methods: Support for archives, binaries, scripts, and package managers
🛠️ Advanced Features
- Virtual Environments: Symlink-based virtual environment management with isolation
- Cross-Platform: Seamless operation on Windows, macOS, and Linux
- Error Handling: Comprehensive error types with recovery suggestions
- HTTP Utilities: Advanced HTTP client with retry logic and timeout handling
Core Traits
Tool Management
use ;
// Define a custom tool
;
Plugin System
use ;
// Create a plugin for your tool
;
Configuration
use ;
// Load configuration from multiple sources
let config = load?;
let auto_install = config.auto_install.enabled;
Key Components
Version Management
- Version: Semantic version representation
- VersionManager: Version comparison and resolution
- VersionParser: Parse version strings and constraints
Tool Installation (Enhanced with vx-installer)
- InstallerAdapter: Bridge to the powerful vx-installer engine
- Universal Installation: Support for multiple archive formats and installation methods
- Progress Tracking: Beautiful progress bars with customizable styles
- Security: Checksum verification and secure download protocols
- Platform: Cross-platform path and architecture detection with smart defaults
Virtual Environments
- VirtualEnvironment: Manage isolated tool environments
- SymlinkVenv: Symlink-based virtual environment implementation
Configuration System
- Config: Global and project-specific configuration
- ConfigFigment: Figment-based configuration loading
- InstallConfigs: Tool-specific installation configurations
💡 Usage Examples
Enhanced Tool Installation with vx-installer
use InstallerAdapter;
async
Basic Tool Management
use ;
async
Configuration Management
use ConfigManager;
let config = load?;
// Check if auto-install is enabled
if config.auto_install.enabled
// Get tool-specific configuration
if let Some = config.tools.get
Virtual Environment
use ;
let venv = new?;
// Add tools to the environment
venv.add_tool?;
venv.add_tool?;
// Activate the environment
venv.activate?;
Configuration
vx-core uses a hierarchical configuration system:
- Global Config:
~/.vx/config/global.toml
- Project Config:
.vx.toml
in project root - Environment Variables:
VX_*
prefixed variables
Example Configuration
[]
= true
= 300
[]
= "18.17.0"
= "latest"
[]
= "7d"
= 4
Error Handling
vx-core uses anyhow::Result
for error handling:
use VxError;
Platform Support
- Windows: Full support with proper path handling
- macOS: Native support for both Intel and Apple Silicon
- Linux: Support for major distributions
📦 Dependencies
Core Dependencies
- vx-installer: Universal installation engine with progress tracking
- vx-config: Configuration management system
- vx-plugin: Plugin system and trait definitions
- serde: Serialization and deserialization
- tokio: Async runtime for high-performance operations
- anyhow: Comprehensive error handling
Installation & HTTP
- reqwest: HTTP client for downloads
- figment: Advanced configuration management
- dirs: Platform-specific directory handling
- walkdir: Directory traversal utilities
Development Dependencies
- tempfile: Temporary file handling for tests
- tokio-test: Async testing utilities
Development
Building
Testing
Documentation
Integration
vx-core is designed to be used by:
- vx-cli: Command-line interface
- Tool Plugins: Individual tool implementations
- Package Manager Plugins: Package manager integrations
- External Applications: Third-party integrations
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please see the contributing guidelines for more information.
🔗 Related Crates
vx-installer
- 🆕 Universal installation engine with progress trackingvx-cli
- Command-line interface with rich UXvx-config
- Configuration management systemvx-plugin
- Plugin system and trait definitionsvx-tool-node
- Node.js tool pluginvx-tool-uv
- UV Python tool pluginvx-pm-npm
- NPM package manager plugin
Built with ❤️ for the vx ecosystem