55BoxLite provides lightweight micro-VMs using libkrun (Hypervisor.framework on macOS, KVM on Linux). This adapter supports two modes of operation:
66
77- ** Remote mode** — Connect to a [ BoxRun] ( https://github.com/nicholasgasior/boxlite ) REST API server
8- - ** Local mode** — Run VMs directly on the local machine via the boxlite Python SDK
8+ - ** Local mode** — Run VMs directly on the local machine via the official BoxLite Node.js SDK
99
1010## Install
1111
1212``` bash
1313pnpm add @sandbank.dev/core @sandbank.dev/boxlite
1414```
1515
16- For local mode, you also need the boxlite Python package:
17-
18- ``` bash
19- pip install boxlite
20- ```
21-
2216## Usage
2317
2418### Remote mode (BoxRun REST API)
@@ -44,7 +38,7 @@ const { stdout } = await sandbox.exec('uname -a')
4438await provider .destroy (sandbox .id )
4539```
4640
47- ### Local mode (Python SDK)
41+ ### Local mode (Node.js SDK)
4842
4943``` typescript
5044import { createProvider } from ' @sandbank.dev/core'
@@ -53,8 +47,7 @@ import { BoxLiteAdapter } from '@sandbank.dev/boxlite'
5347const provider = createProvider (
5448 new BoxLiteAdapter ({
5549 mode: ' local' ,
56- pythonPath: ' /usr/bin/python3' , // optional, defaults to 'python3'
57- boxliteHome: ' ~/.boxlite' , // optional
50+ boxliteHome: ' ~/.boxlite' , // optional
5851 })
5952)
6053
@@ -90,15 +83,15 @@ new BoxLiteAdapter({
9083| ` terminal ` | ✅ | ✅ |
9184| ` sleep ` | ✅ | ✅ |
9285| ` port.expose ` | ✅ | ✅ |
93- | ` snapshot ` | ✅ | — |
86+ | ` snapshot ` | ✅ | ✅ |
9487
9588## Characteristics
9689
9790- ** Runtime:** Micro-VM (libkrun)
9891- ** Cold start:** ~ 3-5s
9992- ** File I/O:** tar archive upload/download
10093- ** Hypervisor:** Hypervisor.framework (macOS) / KVM (Linux)
101- - ** Local dependency:** ` boxlite ` Python package (local mode only)
94+ - ** Local dependency:** official ` @ boxlite-ai/boxlite ` Node.js SDK (local mode only)
10295
10396## Architecture
10497
@@ -108,10 +101,10 @@ new BoxLiteAdapter({
108101│ mode: 'remote' | 'local' │
109102├──────────────┬──────────────────────┤
110103│ REST Client │ Local Client │
111- │ (fetch) │ (Python subprocess) │
104+ │ (fetch) │ (Node.js SDK) │
112105├──────────────┼──────────────────────┤
113- │ BoxRun API │ boxlite Python SDK │
114- │ (HTTP/JSON) │ (JSON-line bridge) │
106+ │ BoxRun API │ @ boxlite-ai/boxlite │
107+ │ (HTTP/JSON) │ (N-API binding) │
115108└──────────────┴──────────────────────┘
116109```
117110
0 commit comments