Rexec - AI-Native Sandbox as a Service
Rexec is an open-source, AI-native platform that gives you instantly-available, network-isolated Linux sandboxes in the cloud, or lets you connect your own machines to a unified dashboard. Built for the "vibe coding" era, Rexec provides the perfect headless execution environment for AI agents and coding tools.
Features
- 🤖 AI-Native & Headless: Designed for integration with AI agents (Claude Code, Cursor, Windsurf). Execute commands in secure, remote environments via API.
- Instant Cloud Sandboxes: Create, start, and destroy disposable Linux sandboxes in seconds (powered by Docker).
- Connect Any Machine (BYOS): Install the lightweight Rexec Agent on your laptop, server, or Raspberry Pi to access it securely from the browser without VPNs or SSH port exposure.
-
First-Class Terminal UX: Real-time WebSocket streaming with
xterm.js, JetBrains Mono fonts, and a native-feeling UI. - Secure by Default: JWT authentication, MFA support, audit logging, and isolated container networking.
- Collaboration: Share sandbox sessions for pair programming or debugging with humans and AI agents.
- Session Recording: Record and replay sandbox sessions for documentation or audit trails.
Quick Start
Self-Hosting with Docker Compose
The easiest way to run Rexec is with Docker Compose.
-
Clone the repository:
git clone https://github.com/rexec/rexec.git cd rexec/docker -
Start the stack:
docker compose up --build
-
Access the UI: Open your browser to
http://localhost:8080.-
Username:
admin -
Password:
admin(Change this immediately in production!)
-
Username:
Manual Installation (Development)
Prerequisites: Go 1.22+, Docker Engine, Node.js (for frontend)
-
Clone and Setup:
git clone https://github.com/rexec/rexec.git cd rexec make setup -
Run the API:
make run
-
Run the Frontend:
cd frontend npm install npm run dev
Connecting Your Machines (Agent)
Rexec allows you to connect your own infrastructure (laptops, VMs, bare metal) to the dashboard using the Rexec Agent.
- Log in to your Rexec instance.
- Go to Settings > Agents.
- Click Add Agent to generate an installation command.
- Run the command on your target machine:
# Example command (get your specific token from the dashboard)
curl -fsSL http://localhost:8080/install-agent.sh | sudo bash -s -- --token YOUR_TOKENThe agent establishes a secure outbound WebSocket connection to your Rexec server. No firewall changes or inbound ports required.
Configuration
Rexec is configured via environment variables. Create a .env file in the root directory or pass them to Docker.
| Variable | Description | Default |
|---|---|---|
PORT |
API listen port | 8080 |
DATABASE_URL |
PostgreSQL connection string | postgres://... |
JWT_SECRET |
Required. Secret for signing auth tokens | (Random if unset) |
GIN_MODE |
Web framework mode (debug or release) |
debug |
S3_BUCKET |
S3 bucket for storing session recordings | (Optional) |
S3_REGION |
S3 region | us-east-1 |
S3_ENDPOINT |
Custom S3 endpoint (e.g., MinIO) | (Optional) |
See .env.example for a full list of options.
Architecture
[Browser UI] ←(WebSocket)→ [Rexec API] ←→ [PostgreSQL]
│
├── [Container Manager] ──→ [Docker Engine]
│
└── [Agent Handler] ←(WebSocket)→ [Remote Agents]
- Frontend: Svelte, xterm.js, Tailwind CSS
- Backend: Go (Gin), Gorilla WebSocket
- Database: PostgreSQL
- Runtime: Docker (for cloud sandboxes)
SDKs
Integrate Rexec into your applications with our official SDKs:
Go SDK
go get github.com/PipeOpsHQ/rexec-go@v1.0.1client := rexec.NewClient("https://your-instance.com", "your-token")
container, _ := client.Containers.Create(ctx, &rexec.CreateContainerRequest{
Image: "ubuntu",
})
term, _ := client.Terminal.Connect(ctx, container.ID)
term.Write([]byte("echo hello\n"))JavaScript/TypeScript SDK
npm install pipeops-rexecconst client = new RexecClient({
baseURL: 'https://your-instance.com',
token: 'your-token'
});
const container = await client.containers.create({ image: 'ubuntu' });
const terminal = await client.terminal.connect(container.id);
terminal.write('echo hello\n');Python SDK
pip install pipeops-rexecasync with RexecClient("https://your-instance.com", "your-token") as client:
container = await client.containers.create(image="ubuntu")
async with client.terminal.connect(container.id) as term:
await term.write(b"echo hello\n")Rust SDK
cargo add pipeops-rexec tokiolet client = RexecClient::new("https://your-instance.com", "your-token");
let container = client.containers()
.create(CreateContainerRequest::new("ubuntu")).await?;
let mut term = client.terminal().connect(&container.id).await?;
term.write(b"echo hello\n").await?;Roadmap
- Command Palette:
Cmd+Knavigation for power users. - Metrics Overlays: Real-time CPU/RAM usage charts per container.
- Multi-Region: Support for container pools in different geographic locations.
- Snapshots: One-click environment cloning.
- SSO: SAML/OIDC support for enterprise teams.
License
MIT License. See LICENSE for details.
Community & Support
- GitHub: github.com/PipeOpsHQ/rexec
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with ❤️ for the 10x engineer in everyone.