Run code once
Use kumoba run when you want an answer, not a machine: it creates a sandbox, runs one command, prints its output and deletes the sandbox. Nothing is left behind.
Before you begin, install kumoba and start kumobad.
-
Run a command:
kumoba run -- python3 -c 'print("hello from a fresh VM")'Everything after
--is the program and its arguments. A bare name such aspython3is looked up on the guest'sPATH. -
Check the exit status.
kumoba runexits with the command's own status, so scripts and agents can branch on it:kumoba run -- sh -c 'exit 7'; echo $? # 7
Run without network access
By default a sandbox can reach the public internet. To run untrusted code with no network at all:
kumoba run --network.mode blocked -- python3 untrusted.pyTo allow only some hosts, list them. *.example.com matches subdomains, 10.20.0.0/16 an address range, and host:7999 that port instead of 80 and 443:
kumoba run --network.mode allowlist --network.hosts example.com -- curl -sS https://example.comLimit time and resources
kumoba run --timeout-ms 30000 --cpu 1 --memory-mib 1024 -- python3 job.pyA command that runs past its timeout is killed and kumoba run exits with status 124.
Stopping kumoba run with Ctrl-C deletes the sandbox too, even while it is still booting. If kumobad stops during a run, it deletes that sandbox the next time it starts.
From code
import { Kumoba } from "kumoba";
const result = await new Kumoba().run("python3 --version");
console.log(result.exitCode, result.stdout);Next steps
- To keep a sandbox between commands, see Work in a sandbox.
- For every option, run
kumoba run --helpor see the CLI reference.
Last updated on
kumoba vs E2B, Docker, Firecracker and other sandboxes
How kumoba compares with E2B, Daytona, microsandbox, Docker, Firecracker and Lume on isolation, hosting, macOS, desktop, network and secrets.
Work in a sandbox
Keep a VM sandbox between commands: create and start it, run commands, copy files in and out, stop or delete it, and export it to another host.