Documentation Index Fetch the complete documentation index at: https://docs.boxlite.ai/llms.txt
Use this file to discover all available pages before exploring further.
Installation
Add BoxLite to your Cargo.toml:
[ dependencies ]
boxlite = { git = "https://github.com/boxlite-ai/boxlite" }
tokio = { version = "1" , features = [ "full" ] }
futures = "0.3"
Basic Execution
Create a file src/main.rs
use boxlite :: { BoxliteRuntime , BoxOptions , BoxCommand , RootfsSpec };
use futures :: StreamExt ;
#[tokio :: main]
async fn main () -> Result <(), Box < dyn std :: error :: Error >> {
// Create runtime
let runtime = BoxliteRuntime :: default_runtime ();
// Create box
let options = BoxOptions {
rootfs : RootfsSpec :: Image ( "alpine:latest" . into ()),
.. Default :: default ()
};
let litebox = runtime . create ( options , None ) . await ? ;
// Execute command
let mut execution = litebox
. exec ( BoxCommand :: new ( "echo" ) . arg ( "Hello from BoxLite!" ))
. await ? ;
// Stream stdout
let mut stdout = execution . stdout () . unwrap ();
while let Some ( line ) = stdout . next () . await {
println! ( "{}" , line );
}
Ok (())
}
From Source (Development)
For contributing or local development:
Clone the repository
git clone https://github.com/boxlite-ai/boxlite.git
cd boxlite
Initialize submodules
This step is critical! The build will fail without submodules.
git submodule update --init --recursive
Install platform dependencies
Build and test
# Build
cargo build
# Run tests
cargo test
See CONTRIBUTING.md for detailed build instructions.
Next Steps
Core concepts Understand the different box types, lifecycle, images, and resource configuration.
Architecture Documentation Understand how BoxLite works — Core components (Runtime, LiteBox, VMM, Portal), Image management and rootfs preparation, Host-guest communication protocol.
Rust API Reference Complete Rust API reference documentation.