Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
223 commits
Select commit Hold shift + click to select a range
b2e80e1
Added multi-file write support
0div Oct 4, 2024
9e6bc17
address PR comments
0div Oct 4, 2024
966f0c7
[WIP] Cleanup
ValentaTomas Oct 5, 2024
eda88d0
address PR comments
0div Oct 7, 2024
a2d4ad7
boyscouting: fix some docstrings
0div Oct 7, 2024
a379a58
Add multi-file write support for python-sdk sync
0div Oct 7, 2024
608ef45
Use `@overload`
0div Oct 8, 2024
68ac038
merge beta
0div Oct 8, 2024
f010211
adapt multi file write tests for nested dirs
0div Oct 8, 2024
fbc4af4
allow passing empty array of files in python-sdk
0div Oct 8, 2024
2afb6d1
allow passing empty array of files in js-sdk
0div Oct 8, 2024
68e5efa
address PR comments
0div Oct 9, 2024
365af43
add extra tests to sandbox_sync write
0div Oct 9, 2024
7767d8f
updated js-sdk tests to check empty path behavior
0div Oct 9, 2024
f5cd1c0
add multifile upload to sanbox_async
0div Oct 9, 2024
834f84c
merge beta
0div Oct 10, 2024
2956a6e
better error messages in python-sdk
0div Oct 10, 2024
c277f9f
better error messages in js-sdk
0div Oct 10, 2024
86262f1
docstring for dataclass
0div Oct 10, 2024
97d0cc1
merge main
0div Dec 12, 2024
cf262ae
fix errors.ts comment
0div Dec 12, 2024
4ca2414
fixed typing syntax and watch tests
0div Dec 12, 2024
93dc1f9
update docs
0div Dec 12, 2024
741b329
add minor changeset
0div Dec 12, 2024
bbeeb04
upadte upload docs and improve read-write-docs
0div Dec 12, 2024
0e2a684
fix indentation in upload docs
0div Dec 13, 2024
b867fe4
Update apps/web/src/app/(docs)/docs/filesystem/read-write/page.mdx
0div Dec 13, 2024
e730810
Update apps/web/src/app/(docs)/docs/filesystem/read-write/page.mdx
0div Dec 13, 2024
d3b99fe
Update apps/web/src/app/(docs)/docs/filesystem/upload/page.mdx
0div Dec 13, 2024
424baec
Update apps/web/src/app/(docs)/docs/filesystem/upload/page.mdx
0div Dec 13, 2024
e73ad23
Update apps/web/src/app/(docs)/docs/filesystem/upload/page.mdx
0div Dec 13, 2024
d0fc09a
Update apps/web/src/app/(docs)/docs/filesystem/upload/page.mdx
0div Dec 13, 2024
1708cc0
Update apps/web/src/app/(docs)/docs/filesystem/upload/page.mdx
0div Dec 13, 2024
502c414
remove WriteData type in js-sdk
0div Dec 13, 2024
724fbc6
remove WriteData type in python-sdk
0div Dec 13, 2024
5b3f58b
Update e2b.toml
jakubno Jan 24, 2025
4520df8
Update e2b.toml
jakubno Jan 24, 2025
fd45f0e
Handle exception when iterating over process output
jakubno Jan 24, 2025
1829790
Merge branch 'main' into process-time-out-returns-incorrect-exception…
jakubno Jan 24, 2025
ae61d83
Add test
jakubno Jan 24, 2025
54c8315
add: skeletons + usage limits components
ben-fornefeld Jan 10, 2025
6d9a278
improve: billing limit components
ben-fornefeld Jan 10, 2025
93a6b9b
add: billing limits states + api layer
ben-fornefeld Jan 10, 2025
673272e
fix account selector billing url retrieval
ben-fornefeld Jan 17, 2025
e644a98
add billing api logic + improve billing alerts components
ben-fornefeld Jan 17, 2025
a742e8e
Update text for usage limits
mlejva Jan 18, 2025
eada5d4
Fix build error
mlejva Jan 19, 2025
1e45455
prevent form submission with empty values
ben-fornefeld Jan 20, 2025
379cc26
update fetch headers for billing alerts
ben-fornefeld Jan 24, 2025
062c6ca
add metrics docs page
0div Jan 24, 2025
c4a54fc
add metrics to routes
0div Jan 24, 2025
4450680
update docs based on feedback
0div Jan 24, 2025
295f4e2
fix code snippet and remove note
0div Jan 24, 2025
1337573
update teams retrieval for is_blocked & blocked_reason
ben-fornefeld Jan 24, 2025
830af85
add team blocked banner on page layout
ben-fornefeld Jan 24, 2025
04f223f
improve team blocked banner
ben-fornefeld Jan 24, 2025
fb0dcb7
Implement budget alerts & limit (#551)
ben-fornefeld Jan 24, 2025
3fcfd2b
Update wording for usage limits and alerts
mlejva Jan 25, 2025
525d053
Change button's text
mlejva Jan 25, 2025
8b5af4e
Update wording for usage limits and alerts (#553)
mlejva Jan 25, 2025
974d92e
update limitations section
0div Jan 25, 2025
61c7bfa
fix beta version typo and add private beta note
0div Jan 25, 2025
35c1837
use latest beta tag for npm installs
0div Jan 25, 2025
d3f0e37
Add sandbox metrics docs page (#552)
0div Jan 25, 2025
02b032a
fix thing
handlebauer Jan 25, 2025
43291b5
Fix typo in docs (#554)
mlejva Jan 26, 2025
5b3ef97
hide metrics in sidebar until it's shipped
mlejva Jan 27, 2025
90788ee
Hide metrics in sidebar (#555)
mlejva Jan 27, 2025
0524739
Add groq to docs
tizkovatereza Jan 27, 2025
aea3d3e
Add groq to docs (#557)
tizkovatereza Jan 27, 2025
90fb02c
uncomment metrics route
0div Jan 27, 2025
1e1d398
Show metrics in sidebar (#558)
0div Jan 27, 2025
25c4539
Add watch dir recursive option (missing python client regeneration)
dobrac Dec 2, 2024
d92a166
Update watch test file formatting
dobrac Dec 2, 2024
4adcfd8
Add python generated stubs
dobrac Dec 2, 2024
d35880c
Improve watchDir jsSDK default value
dobrac Dec 2, 2024
ca85407
Add recursive directory watching to the web documentation
dobrac Dec 2, 2024
225c156
Update documentation highlights
dobrac Dec 2, 2024
c8914c2
Improve recursive watch tests and folders naming
dobrac Dec 2, 2024
76b4ac0
Regenerated python stubs with version 5.28.3
dobrac Dec 2, 2024
6596eda
Test for recursive folder creation, add newline after code to docs
dobrac Dec 3, 2024
ea8f4ff
Run js tests cleanup using onTestFinished
dobrac Dec 3, 2024
f893f28
Add note to the recursive watch with rapid folder creation
dobrac Dec 19, 2024
29dc1a9
Add recursive watch envd version check
dobrac Dec 19, 2024
ec9288a
Add recursive watch envd version check python SDK, js SDK check
dobrac Dec 19, 2024
51e8f18
Cleanup tests only in debug
dobrac Dec 19, 2024
359d17d
Fix versions to match updated envd version
jakubno Jan 13, 2025
8c52e73
Lint
jakubno Jan 28, 2025
13f0c78
Add changeset
jakubno Jan 28, 2025
4fb4470
Add recursive directory watch (#488)
jakubno Jan 28, 2025
fe7ed15
Process time out returns incorrect exception in pythonsdk e2b 1476 (#…
jakubno Jan 28, 2025
dde83b7
[skip ci] Release new versions
github-actions[bot] Jan 28, 2025
e9480d5
Add X-Frame-Options header
jakubno Jan 29, 2025
b31dd7b
Fix type
jakubno Jan 29, 2025
e8e4cab
Fix X-Frame-Option to prevent clickjacking (#559)
jakubno Jan 29, 2025
9c6597b
Bump the pip group across 2 directories with 6 updates
dependabot[bot] Jan 29, 2025
892ae4f
Bump the npm_and_yarn group across 1 directory with 2 updates
dependabot[bot] Jan 29, 2025
7cd8781
Add page about start command
mlejva Jan 30, 2025
0e6610e
Remove legacy docs page
mlejva Jan 30, 2025
e3e9d38
Add page about start command (#566)
mlejva Jan 30, 2025
391f070
Fix socker closed build error
jakubno Jan 30, 2025
bf1e1b1
Add changeset
jakubno Jan 30, 2025
672622a
Fix Socket closed build error (#567)
jakubno Jan 30, 2025
d17bdaa
[skip ci] Release new versions
github-actions[bot] Jan 31, 2025
6728061
add assetPrefix to next config
ben-fornefeld Feb 2, 2025
8903a8b
limit asset prefixing to production
ben-fornefeld Feb 2, 2025
5e2a23f
Add assetPrefix to next config (#569)
jakubno Feb 2, 2025
6ebdb17
replace VERCEL_URL env variable with custom set NEXT_PUBLIC_DOMAIN in…
ben-fornefeld Feb 2, 2025
28748ee
update assetPrefix to new environment variable to not break vercel pr…
ben-fornefeld Feb 2, 2025
c47fdbd
Fix: assetPrefix refers to correct domains for production & preview e…
jakubno Feb 2, 2025
ffb6cef
redirect `/blog` to the new blog website
mlejva Feb 3, 2025
1fb2975
Redirect `/blog` to the new blog website (#572)
mlejva Feb 3, 2025
464db3f
Fix pnpm lock
jakubno Feb 4, 2025
5531185
Bump the npm_and_yarn group across 1 directory with 2 updates (#562)
jakubno Feb 4, 2025
7c38aa1
Bump the pip group across 2 directories with 6 updates (#561)
jakubno Feb 4, 2025
c68fa44
If in browser don't use process
jakubno Feb 5, 2025
5749120
Add changeset
jakubno Feb 5, 2025
0cc2b2f
Fix usage in browser (#574)
jakubno Feb 5, 2025
cff68d2
Fix check order
jakubno Feb 5, 2025
cd45aa4
[skip ci] Release new versions
github-actions[bot] Feb 5, 2025
c7b9fc2
Update vitest
jakubno Feb 5, 2025
8e3ead8
Update cross-spawn
jakubno Feb 5, 2025
0d09045
Update cross-spawn
jakubno Feb 5, 2025
66141ef
Update changeset to update cross-spawn
jakubno Feb 5, 2025
6e477ca
Update fast xml parser
jakubno Feb 5, 2025
67787e5
Bump packages
jakubno Feb 5, 2025
b91dbc1
Bump tsup
jakubno Feb 5, 2025
c84c76f
Bump braces
jakubno Feb 5, 2025
c9fa872
Update ip
jakubno Feb 5, 2025
3bbc0b9
Update packages
jakubno Feb 5, 2025
ee35b08
Bump postcss
jakubno Feb 5, 2025
cc8447b
Bump knip
jakubno Feb 5, 2025
6aee7bc
Bump knip
jakubno Feb 5, 2025
bbab1ff
Bump webpack
jakubno Feb 5, 2025
96a4557
Bump micromatch
jakubno Feb 5, 2025
7e88e33
Bump tar
jakubno Feb 5, 2025
71f6d36
Bump jose
jakubno Feb 5, 2025
3cffe51
Bump update notifier
jakubno Feb 5, 2025
5ccdc76
Bump es5-ext
jakubno Feb 5, 2025
eed7384
Drop support for Python 3.8
jakubno Feb 6, 2025
28fd11e
Drop support for Python 3.8 (#575)
jakubno Feb 6, 2025
e92aa08
add: gtm to apps/web
ben-fornefeld Feb 9, 2025
637f680
chore: remove chatlio-widget namespace declaration
ben-fornefeld Feb 9, 2025
db68947
E2B-1546: add google tag manager capibilites for /docs (#576)
ben-fornefeld Feb 9, 2025
c108afb
Update package manager to the latest 9.x version (9.15.5)
dobrac Feb 10, 2025
6d85cf5
Update package manager to the latest 9.x version (9.15.5) (#577)
jakubno Feb 11, 2025
26b2fe5
Fix browser test
jakubno Feb 11, 2025
429ec03
Load update notifier dynamically
jakubno Feb 11, 2025
3ef2046
update: middleware to rewrite /category
ben-fornefeld Feb 11, 2025
46aa4ec
fix incorrect code snippet
mlejva Feb 18, 2025
87b0110
Fix incorrect code snippets
mlejva Feb 18, 2025
f8d988e
Fix incorrect links
mlejva Feb 18, 2025
357be70
Fix code snippets
mlejva Feb 18, 2025
ff818fb
Fix incorrect code snippets and docs links (#583)
mlejva Feb 18, 2025
2a7efcd
feat: rewrite /blog/category/:path* to landing page categories
ben-fornefeld Feb 19, 2025
842f46c
improve: sitemap creation & category rewrite modifications
ben-fornefeld Feb 19, 2025
6a87672
test: fix sitemap runtime fs error by making sitemap cache on build time
ben-fornefeld Feb 19, 2025
b85d676
Merge branch 'main' into rewrite-category-in-middleware-e2b-1578
ben-fornefeld Feb 19, 2025
8aa8ef9
Rewrite /category in middleware (#579)
ben-fornefeld Feb 19, 2025
1653893
Update docs for persistence
mlejva Feb 21, 2025
e04c67d
Merge branch 'main' into update-persistence-docs
mlejva Feb 21, 2025
32e0b03
Update persistence docs (#585)
mlejva Feb 21, 2025
9ef3dcb
Explicitly mention docker commands when building template
mlejva Feb 21, 2025
d3945ac
Add changeset
mlejva Feb 21, 2025
fd6a80e
Merge branch 'main' into cli-better-messaging
mlejva Feb 21, 2025
cb6f762
Fix message
mlejva Feb 21, 2025
cd4880e
Explicitly mention Docker commands when building template (#586)
mlejva Feb 21, 2025
ec36840
update the update-notifier import to esm, remove it from the excluded…
dobrac Feb 21, 2025
aa7a2bf
add changeset
dobrac Feb 21, 2025
4bc7129
Fix CLI build issue (#578)
ValentaTomas Feb 21, 2025
f706f82
Bump package json version for the e2b/cli
dobrac Feb 21, 2025
6b71953
Bump package json version for the e2b/cli (#587)
ValentaTomas Feb 21, 2025
9f23f54
[skip ci] Release new versions
github-actions[bot] Feb 22, 2025
bc79f15
Fix broken link
mlejva Feb 22, 2025
2dc0580
Fix broken link in docs (#589)
mlejva Feb 22, 2025
4919993
Improve legacy banner visibility in /docs (#590)
ben-fornefeld Feb 22, 2025
fba2ce3
fix: filter shiki line highlight syntax when copying code blocks in docs
ben-fornefeld Feb 25, 2025
74de6eb
Filter Shiki HighlightLine syntax when copying code blocks in docs (#…
ben-fornefeld Feb 25, 2025
e419a61
Change twitter links to the new handle
jakubno Feb 26, 2025
e083bad
Change twitter links to the new handle (#595)
jakubno Feb 26, 2025
0619540
Display correct key name for api key (#594)
r33drichards Mar 1, 2025
ee90cd2
[skip ci] Release new versions
github-actions[bot] Mar 1, 2025
56ca5e0
Show resolvable url in error message (#596)
r33drichards Mar 4, 2025
ac87d9d
[skip ci] Release new versions
github-actions[bot] Mar 4, 2025
82fe7b3
Update CODEOWNERS (#601)
mlejva Mar 13, 2025
dad913e
pin typdoc and typedoc-markdown to non-breaking versions in js-sdk
0div Mar 13, 2025
cecb61d
Fix SDK reference generation in js-sdk (#602)
0div Mar 13, 2025
c04be45
update pnpm loockfile
0div Mar 13, 2025
81a8e8b
Update pnpm lockfile (#603)
0div Mar 13, 2025
2e637cb
Send releases notification to dedicated channel (#604)
jakubno Mar 14, 2025
e905d9b
Test sandbox closed port error (#597)
0div Mar 14, 2025
5c1a5a8
Update README.md (#606)
mlejva Mar 16, 2025
b357a40
Fix example code for the latest version of CrewAI
jamesmurdza Mar 18, 2025
cee8f00
Clean unused HTMLs (#610)
jakubno Mar 18, 2025
6a73f8d
fix: docs quick start issues
ben-fornefeld Mar 18, 2025
e5866ce
Fix docs quick start issues (#611)
ben-fornefeld Mar 18, 2025
71415ed
Fix flaky tests - Increase the timeout for pinging the server (#612)
jakubno Mar 18, 2025
e045df9
Fix comments in tests (#613)
jakubno Mar 18, 2025
43f3c12
Update apps/web/src/app/(docs)/docs/filesystem/read-write/page.mdx
0div Mar 18, 2025
a8e88de
fix merge conflict with main
0div Mar 18, 2025
ce8d130
Fix CrewAI example in the docs (#609)
jamesmurdza Mar 19, 2025
b3fe5e6
Add multi-file write support to the js and python sdks (#451)
0div Mar 19, 2025
ad73fab
Include build ID output for debugging purposes (#616)
r33drichards Mar 19, 2025
d26ff43
Fix release test for multi-file write support (#615)
0div Mar 19, 2025
82f1ba8
Add changeset (#618)
r33drichards Mar 19, 2025
60ece87
Run tests on prs to avoid broken builds (#619)
r33drichards Mar 19, 2025
dbcf014
doc: fix typo of file `apps/web/src/app/(docs)/docs/sandbox/internet-…
samuel871211 Mar 20, 2025
a45df0d
doc: fix type of file `apps/web/src/app/(docs)/docs/code-interpreting…
samuel871211 Mar 20, 2025
d56c19f
doc: fix typo (#620)
mlejva Mar 20, 2025
2904f3e
Fix failing write test (#621)
jakubno Mar 20, 2025
b402327
[skip ci] Release new versions
github-actions[bot] Mar 20, 2025
62eb819
add: docs redirects
ben-fornefeld Mar 21, 2025
51519ee
Merge branch 'main' into fix-docs-quickstart-e2b-1868
ben-fornefeld Mar 21, 2025
d939c04
Add temporary docs redirects (#623)
ben-fornefeld Mar 21, 2025
5c4d075
Add filtering option for listing sandboxes (#532)
jakubno Mar 21, 2025
b6b0ac6
[skip ci] Release new versions
github-actions[bot] Mar 21, 2025
e5a3f24
Fix code interpreting documentation snippets (#624)
ben-fornefeld Mar 21, 2025
dc0d161
make metrics test less flaky
0div Mar 21, 2025
d2f9415
Merge branch 'main' of https://github.com/e2b-dev/E2B into add-multif…
0div Mar 22, 2025
78180e6
fix typos and update lock and gens
0div Mar 22, 2025
303ceff
stop killing sandbox in snapshot test to avoid unwanted 502
0div Mar 31, 2025
1f43738
add missing api error handler to python sdk sanbox api
0div Mar 31, 2025
fbf8c0b
add autoPause default to false in resumeSandbox to respect spec
0div Apr 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/cli_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Test CLI

on:
workflow_call:
pull_request:
branches:
- main

permissions:
contents: read
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/js_sdk_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
secrets:
E2B_API_KEY:
required: true
pull_request:
branches:
- main

permissions:
contents: read
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/python_sdk_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
secrets:
E2B_API_KEY:
required: true
pull_request:
branches:
- main

permissions:
contents: read
Expand Down
14 changes: 14 additions & 0 deletions apps/web/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,20 @@ const nextConfig = {
],
}
},
async redirects() {
return [
{
source: '/docs/sandbox-templates/overview',
destination: '/docs/sandbox-template',
permanent: true,
},
{
source: '/docs/sandbox-templates',
destination: '/docs/sandbox-template',
permanent: true,
},
]
},
}

export default withSearch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import imgChart from '@/images/analyze-data-chart.png'
You can use E2B Sandbox to run AI-generated code to analyze data. Here's how the AI data analysis workflow usually looks like:
1. Your user has a dataset in CSV format or other formats.
2. You prompt the LLM to generate code (usually Python) based on the user's data.
3. The sandbox runs the AU-generated code and returns the results.
3. The sandbox runs the AI-generated code and returns the results.
4. You display the results to the user.

---
Expand Down Expand Up @@ -462,7 +462,7 @@ with open("../dataset.csv", "rb") as f:

def run_ai_generated_code(ai_generated_code: str):
print('Running the code in the sandbox....')
execution = sbx.notebook.exec_cell(ai_generated_code)
execution = sbx.run_code(ai_generated_code)
print('Code execution finished!')

# First let's check if the code ran successfully.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ if (firstResult.png) {
import base64
from e2b_code_interpreter import Sandbox

sbx = Sandbox()

code_to_run = """
import matplotlib.pyplot as plt

Expand Down
34 changes: 31 additions & 3 deletions apps/web/src/app/(docs)/docs/filesystem/read-write/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Reading files

You can read files from the sandbox filesystem using the `files.reado()` method.
You can read files from the sandbox filesystem using the `files.read()` method.

<CodeGroup>
```js
Expand All @@ -18,20 +18,48 @@ file_content = sandbox.files.read('/path/to/file')
```
</CodeGroup>

## Writing files
## Writing single files

You can write files to the sandbox filesystem using the `files.write()` method.
You can write single files to the sandbox filesystem using the `files.write()` method.

<CodeGroup>
```js
import { Sandbox } from '@e2b/code-interpreter'
const sandbox = await Sandbox.create()

await sandbox.files.write('/path/to/file', 'file content')
```
```python
from e2b_code_interpreter import Sandbox

sandbox = Sandbox()

await sandbox.files.write('/path/to/file', 'file content')
```
</CodeGroup>

## Writing multiple files

You can also write multiple files to the sandbox filesystem using the `files.write()` method.

<CodeGroup>
```js
import { Sandbox } from '@e2b/code-interpreter'
const sandbox = await Sandbox.create()

await sandbox.files.write([
{ path: '/path/to/a', data: 'file content' },
{ path: '/another/path/to/b', data: 'file content' }
])
```
```python
from e2b_code_interpreter import Sandbox

sandbox = Sandbox()

await sandbox.files.write([
{ "path": "/path/to/a", "data": "file content" },
{ "path": "another/path/to/b", "data": "file content" }
])
```
</CodeGroup>
87 changes: 86 additions & 1 deletion apps/web/src/app/(docs)/docs/filesystem/upload/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

You can upload data to the sandbox using the `files.write()` method.

## Upload single file

<CodeGroup>
```js
import fs from 'fs'
Expand All @@ -22,6 +24,89 @@ sandbox = Sandbox()
# Read file from local filesystem
with open("path/to/local/file", "rb") as file:
# Upload file to sandbox
sandbox.files.write("/path/in/sandbox", file)
sandbox.files.write("/path/in/sandbox", file)
```
</CodeGroup>

## Upload directory / multiple files

<CodeGroup>
```js
const fs = require('fs');
const path = require('path');

import { Sandbox } from '@e2b/code-interpreter'

const sandbox = await Sandbox.create()

// Read all files in the directory and store their paths and contents in an array
const readDirectoryFiles = (directoryPath) => {
// Read all files in the local directory
const files = fs.readdirSync(directoryPath);

// Map files to objects with path and data
const filesArray = files
.filter(file => {
const fullPath = path.join(directoryPath, file);
// Skip if it's a directory
return fs.statSync(fullPath).isFile();
})
.map(file => {
const filePath = path.join(directoryPath, file);

// Read the content of each file
return {
path: filePath,
data: fs.readFileSync(filePath, 'utf8')
};
});

return filesArray;
};

// Usage example
const files = readDirectoryContents('/local/dir');
console.log(files);
// [
// { path: '/local/dir/file1.txt', data: 'File 1 contents...' },
// { path: '/local/dir/file2.txt', data: 'File 2 contents...' },
// ...
// ]

await sandbox.files.write(files)
```
```python
import os
from e2b_code_interpreter import Sandbox

sandbox = Sandbox()

def read_directory_files(directory_path):
files = []

# Iterate through all files in the directory
for filename in os.listdir(directory_path):
file_path = os.path.join(directory_path, filename)

# Skip if it's a directory
if os.path.isfile(file_path):
# Read file contents in binary mode
with open(file_path, "rb") as file:
files.append({
'path': file_path,
'data': file.read()
})

return files

files = read_directory_files("/local/dir")
print(files)
# [
# {"'path": "/local/dir/file1.txt", "data": "File 1 contents..." },
# { "path": "/local/dir/file2.txt", "data": "File 2 contents..." },
# ...
# ]

sandbox.files.write(files)
```
</CodeGroup>
8 changes: 4 additions & 4 deletions apps/web/src/app/(docs)/docs/sandbox/internet-access/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Every sandbox has a public URL that can be used to access running services insid

<CodeGroup>
```js
import { Sandbox } from '@e2b/code-interpeter'
import { Sandbox } from '@e2b/code-interpreter'

const sandbox = await Sandbox.create()

Expand All @@ -31,10 +31,10 @@ The code above will print something like this:

<CodeGroup>
```bash {{ language: 'js' }}
http://3000-i62mff4ahtrdfdkyn2esc-b0b684e9.e2b.dev
https://3000-i62mff4ahtrdfdkyn2esc-b0b684e9.e2b.dev
```
```bash {{ language: 'python' }}
http://3000-i62mff4ahtrdfdkyn2esc-b0b684e9.e2b.dev
https://3000-i62mff4ahtrdfdkyn2esc-b0b684e9.e2b.dev
```
</CodeGroup>

Expand All @@ -47,7 +47,7 @@ In this example we will start a simple HTTP server that listens on port 3000 and

<CodeGroup>
```js
import { Sandbox } from '@e2b/code-interpeter'
import { Sandbox } from '@e2b/code-interpreter'

const sandbox = await Sandbox.create()

Expand Down
24 changes: 14 additions & 10 deletions apps/web/src/app/(docs)/docs/sandbox/list/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ Running sandbox template id: 3e4rngfa34txe0gxc1zf


## Filtering sandboxes
<Note>
This feature is in a private beta.
</Note>

You can filter sandboxes by specifying <Link href="/docs/sandbox/metadata">Metadata</Link> key value pairs.
Specifying multiple key value pairs will return sandboxes that match all of them.
Expand All @@ -87,7 +84,9 @@ const sandbox = await Sandbox.create({

// List running sandboxes that has `userId` key with value `123` and `env` key with value `dev`.
const runningSandboxes = await Sandbox.list({
filters: { userId: '123', env: 'dev' } // $HighlightLine
query: {
metadata: { userId: '123', env: 'dev' }, // $HighlightLine
},
})
```
```python
Expand All @@ -96,15 +95,20 @@ from e2b_code_interpreter import Sandbox
# Create sandbox with metadata.
sandbox = Sandbox(
metadata={
"env": "dev", # $HighlightLine
"app": "my-app", # $HighlightLine
"user_id": "123", # $HighlightLine
"env": "dev", # $HighlightLine
"app": "my-app", # $HighlightLine
"user_id": "123", # $HighlightLine
},
)

# List running sandboxes that has `userId` key with value `123` and `env` key with value `dev`.
running_sandboxes = Sandbox.list(filters={
"userId": "123", "env": "dev" # $HighlightLine
})
running_sandboxes = Sandbox.list(
query=SandboxQuery(
metadata={
"userId": "123", # $HighlightLine
"env": "dev", # $HighlightLine
}
),
)
```
</CodeGroup>
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## e2b auth


authentication commands

### Usage

```bash
e2b auth [options] [command]
```
## e2b auth login


log in to CLI

### Usage

```bash
e2b auth login [options]
```


## e2b auth logout


log out of CLI

### Usage

```bash
e2b auth logout [options]
```


## e2b auth info


get information about the current user

### Usage

```bash
e2b auth info [options]
```


## e2b auth configure


configure user

### Usage

```bash
e2b auth configure [options]
```


Loading