Skip to main content

Module tools

Module tools 

Source
Expand description

Tool provider system for fetching development tools.

This module provides a pluggable system for fetching development tools from various sources (GitHub, OCI, Nix). Each source is implemented as a ToolProvider that can resolve and fetch tools.

§Architecture

The tool system consists of:

§Example

use cuenv_core::tools::{ToolRegistry, Platform, ToolOptions};

// Create registry with providers
let mut registry = ToolRegistry::new();
registry.register(GitHubToolProvider::new());
registry.register(NixToolProvider::new());

// Resolve and fetch a tool
let provider = registry.get("github").unwrap();
let resolved = provider.resolve(&ToolResolveRequest {
    tool_name: "jq",
    version: "1.7.1",
    platform: &Platform::current(),
    config: &config,
    token: None,
}).await?;
let fetched = provider.fetch(&resolved, &ToolOptions::default()).await?;

Structs§

FetchedTool
Result of fetching a tool.
Platform
Platform identifier combining OS and architecture.
ResolvedTool
A resolved tool ready to be fetched.
ToolOptions
Options for tool operations.
ToolRegistry
Registry of tool providers.
ToolResolveRequest
Request parameters for tool resolution.

Enums§

Arch
CPU architecture.
Os
Operating system.
ToolSource
Source-specific resolution data.

Traits§

ToolProvider
Trait for tool providers (GitHub, OCI, Nix).

Functions§

default_cache_dir
Get the default cache directory for tools.