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:
ToolProvider- Trait implemented by each source (GitHub, Nix, etc.)ToolRegistry- Collection of registered providersPlatform,Os,Arch- Platform identification typesToolSource- Source-specific resolution dataResolvedTool- A fully resolved tool ready to fetchFetchedTool- Result of fetching a tool
§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§
- Fetched
Tool - Result of fetching a tool.
- Platform
- Platform identifier combining OS and architecture.
- Resolved
Tool - A resolved tool ready to be fetched.
- Tool
Options - Options for tool operations.
- Tool
Registry - Registry of tool providers.
- Tool
Resolve Request - Request parameters for tool resolution.
Enums§
- Arch
- CPU architecture.
- Os
- Operating system.
- Tool
Source - Source-specific resolution data.
Traits§
- Tool
Provider - Trait for tool providers (GitHub, OCI, Nix).
Functions§
- default_
cache_ dir - Get the default cache directory for tools.