1 unstable release

Uses new Rust 2024

0.19.0 Apr 24, 2026

#996 in Unix APIs

MIT/Apache

515KB
10K SLoC

Client library for communicating with miniboxd daemon.

This crate provides a high-level async client for sending requests to the minibox daemon over a Unix domain socket. It abstracts the protocol handling and connection management.

Examples

use minibox_client::DaemonClient;
use minibox::protocol::DaemonRequest;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let client = DaemonClient::new()?;
    let request = DaemonRequest::List;
    let mut responses = client.call(request).await?;

    while let Some(response) = responses.next().await? {
        println!("{:?}", response);
    }

    Ok(())
}

minibox-client

Low-level async client for communicating with the minibox daemon over Unix socket.

Usage

use minibox_client::DaemonClient;
use minibox_core::protocol::{Request, Command};

let client = DaemonClient::connect("/run/minibox/miniboxd.sock").await?;
let request = Request { id: 1, command: Command::Ps };
let response = client.send(request).await?;

Message Protocol

JSON-over-newline on Unix socket. Each request/response includes:

  • id — Correlation ID for multiplexing
  • type — Message variant (e.g., "RunContainer", "ListContainers")
  • Payload — Variant-specific fields

Streaming

For ephemeral containers, the client receives a stream of ContainerOutput and ContainerStopped messages via broadcast channels, enabling real-time stdout/stderr display.

Dependencies

~17–30MB
~483K SLoC