Installation
Prerequisites
- macOS
- Linux
- macOS 12+ (Monterey or later)
- Xcode Command Line Tools:
xcode-select --install - GCC or Clang
Building the SDK
Simple API (Easiest)
What’s happening:- BoxLite pulls the
python:slimOCI image (first run only) - Creates a lightweight VM with the image
- Executes the Python command inside the VM
- Buffers stdout/stderr and returns the result
- Automatically cleans up when
boxlite_simple_free()is called
Native API (Full Control)
For advanced use cases with streaming output and custom configuration.Running Examples
BoxLite includes 8 comprehensive C examples:| Example | Description |
|---|---|
simple_api_demo.c | Quick start with Simple API |
execute.c | Command execution with streaming output |
shutdown.c | Runtime shutdown with multiple boxes |
01_lifecycle.c | Complete box lifecycle (create/stop/restart/remove) |
02_list_boxes.c | Discovery, introspection, ID prefix lookup |
03_streaming_output.c | Real-time output handling with callbacks |
04_error_handling.c | Error codes, retry logic, graceful degradation |
05_metrics.c | Runtime and per-box metrics |
Error Handling
The C SDK uses structured error handling:| Code | Name | Description |
|---|---|---|
0 | Ok | Success |
2 | NotFound | Resource not found |
5 | InvalidArgument | Invalid parameter |
8 | Image | Image pull/resolution failed |
10 | Execution | Command execution failed |
Next Steps
Core concepts
Understand the different box types, lifecycle, images, and resource configuration.
C SDK Reference
Complete SDK documentation covering Simple API and Native API details, JSON configuration schema, Memory management rules, Threading and safety, and Troubleshooting guide.
C API Reference
Function signatures and parameters for the C SDK.
C Examples
Working code examples on GitHub.

