Expand description
§vx-installer
Installation utilities and helpers for the vx universal tool manager.
This crate provides a unified interface for downloading, extracting, and installing development tools across different platforms and archive formats.
§Features
- Unified Installation API: Single interface for all installation operations
- Multiple Archive Formats: Support for ZIP, TAR.GZ, TAR.XZ, and binary files
- Progress Tracking: Built-in progress bars for downloads and extractions
- Platform Agnostic: Works across Windows, macOS, and Linux
- Async Support: Fully async API for non-blocking operations
§Example
use vx_installer::{Installer, InstallConfig, InstallMethod, ArchiveFormat};
use std::path::PathBuf;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let installer = Installer::new().await?;
let config = InstallConfig::builder()
.tool_name("node")
.version("18.17.0")
.download_url("https://nodejs.org/dist/v18.17.0/node-v18.17.0-linux-x64.tar.gz")
.install_method(InstallMethod::Archive {
format: ArchiveFormat::TarGz
})
.install_dir(PathBuf::from("/opt/vx/tools/node/18.17.0"))
.build();
let executable_path = installer.install(&config).await?;
println!("Installed to: {}", executable_path.display());
Ok(())
}Re-exports§
pub use downloader::Downloader;pub use error::Error;pub use error::Result;pub use installer::ArchiveFormat;pub use installer::InstallConfig;pub use installer::InstallConfigBuilder;pub use installer::InstallMethod;pub use installer::Installer;pub use progress::ProgressReporter;pub use progress::ProgressStyle;pub use formats::ArchiveExtractor;pub use formats::FormatHandler;
Modules§
- downloader
- Download utilities for vx-installer
- error
- Error types for vx-installer
- formats
- Archive format handling for vx-installer
- installer
- Installation utilities and configuration
- progress
- Progress reporting utilities for installation operations
Constants§
- USER_
AGENT - Default user agent for HTTP requests
- VERSION
- Version information for the vx-installer crate