Quickstart
First Sandbox
Explore what you can do inside a Vibengine sandbox
Your First Sandbox
Once you've installed the SDK, you can start exploring what sandboxes can do. Each sandbox is a full Linux environment running in the cloud.
Create a Sandbox
import { Sandbox } from 'vibengine'
// Create a sandbox with default settings (60s timeout)
const sandbox = await Sandbox.create()
// Create with custom timeout (5 minutes)
const sandbox2 = await Sandbox.create({ timeoutMs: 300_000 })from vibengine import Sandbox
# Create a sandbox with default settings (60s timeout)
sandbox = Sandbox()
# Create with custom timeout (5 minutes)
sandbox2 = Sandbox(timeout=300)Run Commands
Execute any shell command inside the sandbox:
// Simple command
const result = await sandbox.commands.run('ls -la /')
console.log(result.stdout)
// Install a package
await sandbox.commands.run('pip install requests')
// Run a script
await sandbox.commands.run('python3 -c "print(2 + 2)"')# Simple command
result = sandbox.commands.run('ls -la /')
print(result.stdout)
# Install a package
sandbox.commands.run('pip install requests')
# Run a script
sandbox.commands.run('python3 -c "print(2 + 2)"')Work with Files
Read and write files in the sandbox filesystem:
// Write a file
await sandbox.files.write('/home/user/hello.txt', 'Hello, Vibengine!')
// Read a file
const content = await sandbox.files.read('/home/user/hello.txt')
console.log(content) // "Hello, Vibengine!"
// List directory contents
const files = await sandbox.files.list('/home/user')
console.log(files)# Write a file
sandbox.files.write('/home/user/hello.txt', 'Hello, Vibengine!')
# Read a file
content = sandbox.files.read('/home/user/hello.txt')
print(content) # "Hello, Vibengine!"
# List directory contents
files = sandbox.files.list('/home/user')
print(files)Clean Up
Always close your sandbox when done to free resources:
await sandbox.kill()sandbox.kill()Sandboxes also automatically shut down after the timeout period expires (default: 60 seconds). You can extend this with the timeoutMs / timeout option.