Crate zoi

Crate zoi 

Source
Expand description

§Zoi: The Universal Package Manager & Environment Setup Tool

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

For user documentation please visit Zoi’s Docs, for the library documentation using this or Zoi’s Lib Docs is fine.

§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 = { version = "1" } // Replace with the latest version

§Example: Install a package

use zoi::{install_package, 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.pkg.tar.zst");
    let scope = Some(Scope::User);
    let registry_handle = "local";

    let installed_files = install_package(archive_path, scope, registry_handle, true, None)?;

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

    Ok(())
}

Re-exports§

pub use pkg::types;
pub use pkg::types::Scope;

Modules§

cli
cmd
pkg
project
utils

Functions§

build
Builds a Zoi package from a local .pkg.lua file.
install_package
Installs a Zoi package from a local package archive.
uninstall_package
Uninstalls a Zoi package.