Skip to content

Commit a240f99

Browse files
authored
Default to base e2b SDK in READMEs (#1232)
## Summary - Updated root README, js-sdk README, and python-sdk README to show base `e2b` SDK install and usage as the default - Code-interpreter is now shown as an optional step for when `runCode()`/`run_code()` is actually needed - SDK links in descriptions now point to base `e2b` packages on npm/PyPI ## Why The base `e2b` package covers commands, files, git, networking, and sandbox lifecycle. Users who don't need code execution shouldn't be directed to install `@e2b/code-interpreter` / `e2b-code-interpreter` as their first step. ## Test plan - [ ] Verify README renders correctly on GitHub - [ ] Confirm base SDK examples use correct import syntax - [ ] Confirm code-interpreter section still shows correct usage for `runCode()`
1 parent 9710e56 commit a240f99

File tree

3 files changed

+77
-37
lines changed

3 files changed

+77
-37
lines changed

README.md

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,20 @@
1919
<img width="100%" src="/readme-assets/preview.png" alt="Cover image">
2020
--->
2121
## What is E2B?
22-
[E2B](https://www.e2b.dev/) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/@e2b/code-interpreter) or [Python SDK](https://pypi.org/project/e2b_code_interpreter).
23-
24-
> [!NOTE]
25-
> This repository contains the core E2B SDK that's used in our main [E2B Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter).
22+
[E2B](https://www.e2b.dev/) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/e2b) or [Python SDK](https://pypi.org/project/e2b).
2623

2724
## Run your first Sandbox
2825

2926
### 1. Install SDK
3027

3128
JavaScript / TypeScript
3229
```
33-
npm i @e2b/code-interpreter
30+
npm i e2b
3431
```
3532

3633
Python
3734
```
38-
pip install e2b-code-interpreter
35+
pip install e2b
3936
```
4037

4138
### 2. Get your E2B API key
@@ -44,35 +41,49 @@ pip install e2b-code-interpreter
4441
3. Set environment variable with your API key
4542
```
4643
E2B_API_KEY=e2b_***
47-
```
44+
```
4845

49-
### 3. Execute code with code interpreter inside Sandbox
46+
### 3. Start a sandbox and run commands
5047

5148
JavaScript / TypeScript
5249
```ts
53-
import { Sandbox } from '@e2b/code-interpreter'
50+
import Sandbox from 'e2b'
5451

5552
const sandbox = await Sandbox.create()
56-
await sandbox.runCode('x = 1')
57-
58-
const execution = await sandbox.runCode('x+=1; x')
59-
console.log(execution.text) // outputs 2
53+
const result = await sandbox.commands.run('echo "Hello from E2B!"')
54+
console.log(result.stdout) // Hello from E2B!
6055
```
6156

6257
Python
6358
```py
64-
from e2b_code_interpreter import Sandbox
59+
from e2b import Sandbox
6560

6661
with Sandbox.create() as sandbox:
67-
sandbox.run_code("x = 1")
68-
execution = sandbox.run_code("x+=1; x")
69-
print(execution.text) # outputs 2
62+
result = sandbox.commands.run('echo "Hello from E2B!"')
63+
print(result.stdout) # Hello from E2B!
64+
```
65+
66+
### 4. Code execution with Code Interpreter
67+
68+
If you need to execute code with `runCode()`/`run_code()`, install the [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter):
69+
70+
```
71+
npm i @e2b/code-interpreter # JavaScript/TypeScript
72+
pip install e2b-code-interpreter # Python
73+
```
74+
75+
```ts
76+
import { Sandbox } from '@e2b/code-interpreter'
77+
78+
const sandbox = await Sandbox.create()
79+
const execution = await sandbox.runCode('x = 1; x += 1; x')
80+
console.log(execution.text) // outputs 2
7081
```
7182

72-
### 4. Check docs
83+
### 5. Check docs
7384
Visit [E2B documentation](https://e2b.dev/docs).
7485

75-
### 5. E2B cookbook
86+
### 6. E2B cookbook
7687
Visit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.
7788

7889
## Self-hosting

packages/js-sdk/README.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
<img width="100%" src="/readme-assets/preview.png" alt="Cover image">
1414
--->
1515
## What is E2B?
16-
[E2B](https://www.e2b.dev/) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/@e2b/code-interpreter) or [Python SDK](https://pypi.org/project/e2b_code_interpreter).
16+
[E2B](https://www.e2b.dev/) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/e2b) or [Python SDK](https://pypi.org/project/e2b).
1717

1818
## Run your first Sandbox
1919

2020
### 1. Install SDK
2121

2222
```bash
23-
npm i @e2b/code-interpreter
23+
npm i e2b
2424
```
2525

2626
### 2. Get your E2B API key
@@ -29,22 +29,36 @@ npm i @e2b/code-interpreter
2929
3. Set environment variable with your API key
3030
```
3131
E2B_API_KEY=e2b_***
32-
```
32+
```
3333

34-
### 3. Execute code with code interpreter inside Sandbox
34+
### 3. Start a sandbox and run commands
3535

3636
```ts
37-
import { Sandbox } from '@e2b/code-interpreter'
37+
import Sandbox from 'e2b'
38+
39+
const sandbox = await Sandbox.create()
40+
const result = await sandbox.commands.run('echo "Hello from E2B!"')
41+
console.log(result.stdout) // Hello from E2B!
42+
```
43+
44+
### 4. Code execution with Code Interpreter
45+
46+
If you need `runCode()`, install the [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter):
3847

39-
const sbx = await Sandbox.create()
40-
await sbx.runCode('x = 1')
48+
```bash
49+
npm i @e2b/code-interpreter
50+
```
51+
52+
```ts
53+
import { Sandbox } from '@e2b/code-interpreter'
4154

42-
const execution = await sbx.runCode('x+=1; x')
55+
const sandbox = await Sandbox.create()
56+
const execution = await sandbox.runCode('x = 1; x += 1; x')
4357
console.log(execution.text) // outputs 2
4458
```
4559

46-
### 4. Check docs
60+
### 5. Check docs
4761
Visit [E2B documentation](https://e2b.dev/docs).
4862

49-
### 5. E2B cookbook
63+
### 6. E2B cookbook
5064
Visit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.

packages/python-sdk/README.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111

1212
## What is E2B?
13-
[E2B](https://www.e2b.dev/) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/@e2b/code-interpreter) or [Python SDK](https://pypi.org/project/e2b_code_interpreter).
13+
[E2B](https://www.e2b.dev/) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/e2b) or [Python SDK](https://pypi.org/project/e2b).
1414

1515
## Run your first Sandbox
1616

1717
### 1. Install SDK
1818

1919
```
20-
pip install e2b-code-interpreter
20+
pip install e2b
2121
```
2222

2323
### 2. Get your E2B API key
@@ -26,21 +26,36 @@ pip install e2b-code-interpreter
2626
3. Set environment variable with your API key
2727
```
2828
E2B_API_KEY=e2b_***
29-
```
29+
```
3030

31-
### 3. Execute code with code interpreter inside Sandbox
31+
### 3. Start a sandbox and run commands
32+
33+
```py
34+
from e2b import Sandbox
35+
36+
with Sandbox.create() as sandbox:
37+
result = sandbox.commands.run('echo "Hello from E2B!"')
38+
print(result.stdout) # Hello from E2B!
39+
```
40+
41+
### 4. Code execution with Code Interpreter
42+
43+
If you need `run_code()`, install the [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter):
44+
45+
```
46+
pip install e2b-code-interpreter
47+
```
3248

3349
```py
3450
from e2b_code_interpreter import Sandbox
3551

3652
with Sandbox.create() as sandbox:
37-
sandbox.run_code("x = 1")
38-
execution = sandbox.run_code("x+=1; x")
53+
execution = sandbox.run_code("x = 1; x += 1; x")
3954
print(execution.text) # outputs 2
4055
```
4156

42-
### 4. Check docs
57+
### 5. Check docs
4358
Visit [E2B documentation](https://e2b.dev/docs).
4459

45-
### 5. E2B cookbook
60+
### 6. E2B cookbook
4661
Visit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.

0 commit comments

Comments
 (0)