@e2b/code-interpreter

JavaScript/TypeScript SDK for running AI-generated code in stateful, isolated E2B cloud sandboxes

SDK
npm
v2.7.2
2,398stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
83/100Excellent
Development Activity92
Maintenance100
Community52
Maturity48
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
82/100Excellent
Architecture82
Code Quality84
Innovation85
Learning Curve78

@e2b/code-interpreter is the JS/TS client for E2B’s Code Interpreter, a purpose-built sandbox template for executing untrusted or AI-generated code safely. It wraps the base E2B Sandbox SDK with a Jupyter-kernel-backed execution layer, so calling sandbox.runCode() runs Python, JavaScript, TypeScript, R, Java, or Bash inside an isolated cloud VM and streams back stdout, stderr, rich results (charts, images, dataframes), and structured errors.

Because each sandbox keeps a persistent kernel context, variables and imports declared in one runCode call are still available in the next - letting an LLM agent iteratively build up state (load a dataset, then transform it, then plot it) the same way a human would in a notebook, without re-executing setup code on every turn.

What You Get

  • A Sandbox.create() / sandbox.runCode() API built on top of E2B’s isolated cloud VMs, extending the base e2b Sandbox class
  • Stateful Jupyter-kernel execution contexts - variables and imports persist across multiple runCode calls in the same sandbox
  • Multi-language support out of the box: Python, JavaScript, TypeScript, R, Java, and Bash
  • Structured onStdout/onStderr/onResult/onError callbacks plus rich Result objects for charts, images, and other Jupyter display data
  • Runtime coverage across Node, Bun, and Deno, verified by dedicated per-runtime test suites

Common Use Cases

  • Letting an LLM agent execute Python data-analysis code it generated, then read back computed results, tables, or matplotlib charts
  • Building AI code-assistant products that need to actually run and verify generated code rather than just display it
  • Iterative, notebook-style agent workflows where state (loaded data, defined functions) must persist across several tool calls
  • Safely executing user-submitted or untrusted code in a fully isolated VM instead of the host process

Under The Hood

Architecture - The package is a thin, purpose-built layer over the base e2b Sandbox SDK: sandbox.ts extends BaseSandbox and adds runCode/createCodeContext, messaging.ts defines the Result/Execution/OutputMessage wire types and parses Jupyter-style output messages into them, and charts.ts normalizes matplotlib/plotly-style chart output into a consistent JS representation. Execution requests are proxied to a Jupyter kernel running inside the sandboxed VM over the JUPYTER_PORT defined in consts.ts, with utils.ts handling connection-closed detection and line-based streaming reads. Tech Stack - TypeScript compiled with tsup to dual ESM/CJS output, built on the e2b npm package (^2.28.0) as its only runtime dependency, tested with Vitest plus dedicated Bun and Deno test runs to guarantee cross-runtime compatibility, linted with ESLint and formatted with Prettier. Code Quality - The js/tests/ directory has 33+ test files covering execution semantics (statefulness, execution count, interrupts, reconnects), specific data/display types (charts, images, env vars), and runtime-specific behavior (tests/runtimes/bun, tests/runtimes/deno), indicating deliberate attention to correctness across execution edge cases and multiple JS runtimes. API Design - The public surface mirrors familiar async patterns (await Sandbox.create(), await sbx.runCode(...)) with optional streaming callbacks for stdout/stderr/results, keeping the common case to two or three lines of code while still exposing execution contexts and rich result objects for more advanced multi-step agent workflows.

Used by 12 apps in this directory

Python
67%
Other

AutoGPT

Automation · Productivity · AI Assistants

187,177

Build, deploy, and run autonomous AI agents that automate complex multi-step workflows using a visual block-based graph editor.

View details
93
Repo Health
78
Technical
66
Dependency
Built with
Python67%
TypeScript32%
Updated today
Go
32%
Apache 2.0

CubeSandbox

Developer Tools · Security · AI Agents

11,816

Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.

View details
83
Repo Health
88
Technical
63
Dependency
Built with
Go32%
Rust28%
C23%
Updated yesterday
Go
75%
MIT

Digger

Devops · Automation · Developer Tools

5,040

Run Terraform and OpenTofu natively inside your existing CI pipeline — no separate runners, no third-party secrets, no extra compute costs.

View details
68
Repo Health
73
Technical
67
Dependency
Built with
Go75%
TypeScript15%
Updated 3 weeks ago
TypeScript
89%
Other

FastGPT

AI Agents · AI Development

29,591

Build, debug, and deploy knowledge-based AI agents with a visual workflow editor, RAG retrieval, and support for any OpenAI-compatible LLM.

View details
93
Repo Health
84
Technical
69
Dependency
Built with
TypeScript89%
Updated yesterday
TypeScript
72%
AGPL 3.0

Firecrawl

AI Development · Developer Tools

177,290

Turn any website into clean, LLM-ready data with a single API call — no proxy headaches, no scraping complexity.

View details
89
Repo Health
83
Technical
65
Dependency
Built with
TypeScript72%
Python14%
Updated yesterday
TypeScript
62%
Other

Flowise

Developer Tools · Automation · No Code Platforms

55,427

Drag-and-drop visual builder for AI agents, RAG pipelines, and multi-agent systems—deploy anywhere in minutes.

View details
86
Repo Health
77
Technical
63
Dependency
Built with
TypeScript62%
JavaScript27%
Updated 3 weeks ago
Python
51%
AGPL 3.0

Khoj

AI Assistants · Knowledge Management · Productivity

37,160

A self-hostable AI second brain that chats with your documents, searches the web, builds custom agents, and runs entirely on your own LLM.

View details
75
Repo Health
82
Technical
69
Dependency
Built with
Python51%
TypeScript36%
Updated 1 months ago
TypeScript
64%
Other

NocoDB

No Code Platforms · Databases · Low Code Platforms

64,861

Turn any SQL database into a collaborative no-code spreadsheet with automatic REST APIs and real-time views.

View details
90
Repo Health
77
Technical
62
Dependency
Built with
TypeScript64%
Vue31%
Updated 2 days ago
TypeScript
95%
MIT

Open Lovable

AI Development

28,377

An open-source AI app builder that scrapes a live website and recreates it as a modern React app through chat — built by Firecrawl as a self-hostable example of the Lovable.dev workflow.

View details
35
Repo Health
66
Technical
71
Dependency
Built with
TypeScript95%
Updated 9 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search