zoi-rs 1.24.0

Advanced Package Manager & Environment Orchestrator
Documentation

Zoi: The Advanced Package Manager & Environment Orchestrator

This crate provides the core functionality of Zoi as a library, allowing other Rust applications to leverage its package management and environment setup capabilities.

Architectural Design: Zoi's library API is designed around "Pragmatic Transactionality". It allows programmatic control over the two-phase installation process, SAT-based dependency resolution, and cryptographically verified registry state.

For user documentation please visit Zoi's Docs.

Key Library Entry Points:

  • install_sources: The high-level API used by the CLI for standard installations.
  • resolve_dependency_graph: Calculate required packages without modifying disk.
  • build_with_options: Create distributable .zpa archives.

Getting Started

To use Zoi as a library, add it using cargo or as a dependency in your Cargo.toml:

cargo add zoi-rs
[dependencies]
zoi-rs = "1"

Example: Install a package

use zoi::{install_package_with_options, Scope};
use std::path::Path;
use anyhow::Result;

fn main() -> Result<()> {
    let archive_path = Path::new("path/to/your/package-1.0.0-linux-amd64.zpa");
    let options = zoi::PackageInstallOptions {
        scope_override: Some(Scope::User),
        registry_handle: "local".to_string(),
        yes: true,
        ..Default::default()
    };

    let installed_files = install_package_with_options(archive_path, &options)?;

    println!("Package installed successfully. {} files were installed.", installed_files.len());

    Ok(())
}