Crate vx_core

Source
Expand description

Core traits and interfaces for vx tool manager

This crate provides a highly abstracted plugin system that makes it easy for developers to implement new tools and package managers with minimal boilerplate code.

§Quick Start for Plugin Developers

To create a new tool plugin, implement the VxTool trait:

use vx_core::{VxTool, ToolContext, VersionInfo, Result};

#[derive(Default)]
struct MyTool;

#[async_trait::async_trait]
impl VxTool for MyTool {
    fn name(&self) -> &str { "mytool" }

    async fn fetch_versions(&self, _include_prerelease: bool) -> Result<Vec<VersionInfo>> {
        // Fetch versions from your tool's API
        Ok(vec![])
    }

    async fn install_version(&self, version: &str, force: bool) -> Result<()> {
        // Download and install the tool
        Ok(())
    }
}

Re-exports§

pub use plugin::ConfigurableTool;
pub use plugin::StandardPlugin;
pub use plugin::ToolMetadata;
pub use plugin::UrlBuilder;
pub use plugin::VersionParser;
pub use plugin::VxPackageManager;
pub use plugin::VxPlugin;
pub use plugin::VxTool;
pub use config::GlobalConfig;
pub use config::ToolConfig;
pub use config_figment::ConfigStatus;
pub use config_figment::DefaultConfig;
pub use config_figment::FigmentConfigManager;
pub use config_figment::ProjectInfo;
pub use config_figment::ProjectType;
pub use config_figment::VxConfig;
pub use error::Result;
pub use error::VxError;
pub use install_configs::get_install_config;
pub use install_configs::get_manual_install_instructions;
pub use install_configs::supports_auto_install;
pub use installer::InstallConfig;
pub use installer::InstallProgress;
pub use installer::InstallStage;
pub use package_manager::Ecosystem;
pub use package_manager::PackageInfo;
pub use package_manager::PackageSpec;
pub use registry::PluginRegistry;
pub use registry::ToolRegistry;
pub use tool::AsyncTool;
pub use tool::Configuration;
pub use tool::Environment;
pub use tool::Plugin;
pub use tool::Tool;
pub use tool::ToolContext;
pub use tool::ToolExecutionResult;
pub use tool::ToolInfo;
pub use tool::ToolStatus;
pub use version::VersionInfo;
pub use downloader::ToolDownloader;
pub use environment::EnvironmentConfig;
pub use environment::ToolInstallation;
pub use environment::VxEnvironment;
pub use global_tool_manager::GlobalToolInfo;
pub use global_tool_manager::GlobalToolManager;
pub use global_tool_manager::VenvDependency;
pub use http::get_http_client;
pub use http::HttpUtils;
pub use platform::Architecture;
pub use platform::OperatingSystem;
pub use platform::Platform;
pub use proxy::ProxyContext;
pub use proxy::ToolProxy;
pub use shim_integration::VxShimManager;
pub use symlink_venv::SymlinkVenv;
pub use symlink_venv::SymlinkVenvManager;
pub use url_builder::GenericUrlBuilder;
pub use url_builder::GoUrlBuilder;
pub use url_builder::NodeUrlBuilder;
pub use url_builder::PythonUrlBuilder;
pub use url_builder::RustUrlBuilder;
pub use url_builder::UvUrlBuilder;
pub use venv::ProjectConfig;
pub use venv::ProjectSettings;
pub use venv::VenvConfig;
pub use venv::VenvManager;
pub use version_manager::Version;
pub use version_manager::VersionManager;
pub use version_parser::GitHubVersionParser;
pub use version_parser::GoVersionParser;
pub use version_parser::NodeVersionParser;
pub use version_parser::VersionParserUtils;

Modules§

config
Configuration management traits and types
config_figment
Figment-based configuration system for vx Leverages the excellent figment crate for layered configuration Supports reading from existing project configuration files
downloader
Download and extraction utilities for VX tool manager
environment
Environment management for VX tool manager
error
Error types for vx
global_tool_manager
Global tool management system
http
HTTP utilities for tool version fetching and downloading
install_configs
installer
Installer utilities and types
package_manager
Package manager trait and related types
platform
Platform detection and utilities
plugin
High-level plugin traits for easy implementation
proxy
Transparent proxy system for vx
registry
Plugin and tool registry for managing loaded plugins
shim_integration
Shim integration for vx tool manager
symlink_venv
Symlink-based virtual environment system
tool
Four-layer tool architecture with environment isolation and configuration management
url_builder
URL building utilities for different tools
venv
Simplified virtual environment management for vx
version
Version fetching trait and related types
version_manager
version_parser
Version parsing utilities for different tools

Macros§

tool_not_found
tool_not_installed
version_not_found