Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions docs/api-key.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ To use the API key, you can either:

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

const sandbox = await Sandbox.create({ apiKey: 'YOUR_API_KEY' })
```
```python Python
from e2b_code_interpreter import Sandbox
from e2b import Sandbox

sbx = Sandbox.create(api_key="YOUR_API_KEY")
```
Expand Down
4 changes: 2 additions & 2 deletions docs/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ You can run terminal commands inside the sandbox using the `commands.run()` meth

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

const sandbox = await Sandbox.create()
const result = await sandbox.commands.run('ls -l')
console.log(result)
```
```python Python
from e2b_code_interpreter import Sandbox
from e2b import Sandbox

sandbox = Sandbox.create()
result = sandbox.commands.run('ls -l')
Expand Down
4 changes: 2 additions & 2 deletions docs/commands/background.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You can then later kill the command using the `commands.kill()` method.

<CodeGroup>
```js JavaScript & TypeScript highlight={7}
import { Sandbox } from '@e2b/code-interpreter'
import { Sandbox } from 'e2b'

const sandbox = await Sandbox.create()

Expand All @@ -24,7 +24,7 @@ const command = await sandbox.commands.run('echo hello; sleep 10; echo world', {
await command.kill()
```
```python Python highlight={6}
from e2b_code_interpreter import Sandbox
from e2b import Sandbox

sandbox = Sandbox.create()

Expand Down
4 changes: 2 additions & 2 deletions docs/commands/streaming.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

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

const sandbox = await Sandbox.create()

Expand All @@ -16,14 +16,14 @@
onStdout: (data) => {
console.log(data)
},
onStderr: (data) => {

Check warning on line 19 in docs/commands/streaming.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/commands/streaming.mdx#L19

Did you really mean 'onStderr'?
console.log(data)
},
})
console.log(result)
```
```python Python
from e2b_code_interpreter import Sandbox
from e2b import Sandbox

sandbox = Sandbox.create()

Expand Down
6 changes: 3 additions & 3 deletions docs/filesystem/download.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

<CodeGroup>
```js JavaScript & TypeScript
import fs from 'fs'

Check warning on line 10 in docs/filesystem/download.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/filesystem/download.mdx#L10

Did you really mean 'fs'?
import { Sandbox } from '@e2b/code-interpreter'
import { Sandbox } from 'e2b'

const sandbox = await Sandbox.create()

Expand All @@ -18,7 +18,7 @@
fs.writeFileSync('/local/path', content)
```
```python Python
from e2b_code_interpreter import Sandbox
from e2b import Sandbox

sandbox = Sandbox.create()

Expand All @@ -41,7 +41,7 @@
<CodeGroup>
```js JavaScript & TypeScript
import fs from 'fs'
import { Sandbox } from '@e2b/code-interpreter'
import { Sandbox } from 'e2b'

// Start a secured sandbox (all operations must be authorized by default)
const sandbox = await Sandbox.create(template, { secure: true })
Expand Down
8 changes: 4 additions & 4 deletions docs/filesystem/info.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You can get information about a file or directory using the `files.getInfo()` /

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

const sandbox = await Sandbox.create()

Expand All @@ -34,7 +34,7 @@ console.log(info)
// }
```
```python Python
from e2b_code_interpreter import Sandbox
from e2b import Sandbox

sandbox = Sandbox.create()

Expand Down Expand Up @@ -64,7 +64,7 @@ print(info)

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

const sandbox = await Sandbox.create()

Expand All @@ -89,7 +89,7 @@ console.log(info)
// }
```
```python Python
from e2b_code_interpreter import Sandbox
from e2b import Sandbox

sandbox = Sandbox.create()

Expand Down
12 changes: 6 additions & 6 deletions docs/filesystem/read-write.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

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

const sandbox = await Sandbox.create()
const fileContent = await sandbox.files.read('/path/to/file')

Check warning on line 15 in docs/filesystem/read-write.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/filesystem/read-write.mdx#L15

Did you really mean 'fileContent'?
```
```python Python
from e2b_code_interpreter import Sandbox
from e2b import Sandbox

sandbox = Sandbox.create()
file_content = sandbox.files.read('/path/to/file')
Expand All @@ -28,14 +28,14 @@

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

const sandbox = await Sandbox.create()

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

sandbox = Sandbox.create()

Expand All @@ -49,7 +49,7 @@

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

const sandbox = await Sandbox.create()

Expand All @@ -59,7 +59,7 @@
])
```
```python Python
from e2b_code_interpreter import Sandbox
from e2b import Sandbox

sandbox = Sandbox.create()

Expand Down
10 changes: 5 additions & 5 deletions docs/filesystem/upload.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<CodeGroup>
```js JavaScript & TypeScript
import fs from 'fs'

Check warning on line 12 in docs/filesystem/upload.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/filesystem/upload.mdx#L12

Did you really mean 'fs'?
import { Sandbox } from '@e2b/code-interpreter'
import { Sandbox } from 'e2b'

const sandbox = await Sandbox.create()

Expand All @@ -20,7 +20,7 @@
await sandbox.files.write('/path/in/sandbox', content)
```
```python Python
from e2b_code_interpreter import Sandbox
from e2b import Sandbox

sandbox = Sandbox.create()

Expand All @@ -40,7 +40,7 @@
You can optionally set an expiration time for the URL so that it will be valid only for a limited time.
<CodeGroup>
```js JavaScript & TypeScript
import { Sandbox } from '@e2b/code-interpreter'
import { Sandbox } from 'e2b'

// Start a secured sandbox (all operations must be authorized by default)
const sandbox = await Sandbox.create(template, { secure: true })
Expand Down Expand Up @@ -83,12 +83,12 @@

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

const sandbox = await Sandbox.create()

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

Check warning on line 91 in docs/filesystem/upload.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/filesystem/upload.mdx#L91

Did you really mean 'directoryPath'?
// Read all files in the local directory
const files = fs.readdirSync(directoryPath);

Expand All @@ -109,7 +109,7 @@
};
});

return filesArray;

Check warning on line 112 in docs/filesystem/upload.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/filesystem/upload.mdx#L112

Did you really mean 'filesArray'?
};

// Usage example
Expand All @@ -125,7 +125,7 @@
```
```python Python
import os
from e2b_code_interpreter import Sandbox
from e2b import Sandbox

sandbox = Sandbox.create()

Expand Down
8 changes: 4 additions & 4 deletions docs/filesystem/watch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

<CodeGroup>
```js JavaScript & TypeScript highlight={7-12}
import { Sandbox, FilesystemEventType } from '@e2b/code-interpreter'
import { Sandbox, FilesystemEventType } from 'e2b'

const sandbox = await Sandbox.create()
const dirname = '/home/user'

Check warning on line 18 in docs/filesystem/watch.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/filesystem/watch.mdx#L18

Did you really mean 'dirname'?

// Start watching directory for changes
const handle = await sandbox.files.watchDir(dirname, async (event) => {
Expand All @@ -26,10 +26,10 @@
})

// Trigger file write event
await sandbox.files.write(`${dirname}/my-file`, 'hello')

Check warning on line 29 in docs/filesystem/watch.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/filesystem/watch.mdx#L29

Did you really mean 'dirname'?
```
```python Python highlight={7,12-16}
from e2b_code_interpreter import Sandbox, FilesystemEventType
from e2b import Sandbox, FilesystemEventType

sandbox = Sandbox.create()
dirname = '/home/user'
Expand Down Expand Up @@ -59,7 +59,7 @@

<CodeGroup>
```js JavaScript & TypeScript highlight={13,17}
import { Sandbox, FilesystemEventType } from '@e2b/code-interpreter'
import { Sandbox, FilesystemEventType } from 'e2b'

const sandbox = await Sandbox.create()
const dirname = '/home/user'
Expand All @@ -78,7 +78,7 @@
await sandbox.files.write(`${dirname}/my-folder/my-file`, 'hello')
```
```python Python highlight={7,9}
from e2b_code_interpreter import Sandbox, FilesystemEventType
from e2b import Sandbox, FilesystemEventType

sandbox = Sandbox.create()
dirname = '/home/user'
Expand Down
16 changes: 8 additions & 8 deletions docs/quickstart/upload-download-files.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
## Upload file
<CodeGroup>
```ts JavaScript & TypeScript
import { Sandbox } from '@e2b/code-interpreter'
import { Sandbox } from 'e2b'

// Read local file relative to the current working directory
const content = fs.readFileSync('local/file')

const sbx = await Sandbox.create()

Check warning on line 18 in docs/quickstart/upload-download-files.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/quickstart/upload-download-files.mdx#L18

Did you really mean 'sbx'?
// Upload file to the sandbox to absolute path '/home/user/my-file'
await sbx.files.write('/home/user/my-file', content)
```

```python Python
from e2b_code_interpreter import Sandbox
from e2b import Sandbox

sbx = Sandbox.create()

Expand All @@ -39,13 +39,13 @@

<CodeGroup>
```ts JavaScript & TypeScript
import { Sandbox } from '@e2b/code-interpreter'
import { Sandbox } from 'e2b'

// Read local file relative to the current working directory
const fileA = fs.readFileSync('local/file/a')
const fileB = fs.readFileSync('local/file/b')

const sbx = await Sandbox.create()

Check warning on line 48 in docs/quickstart/upload-download-files.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/quickstart/upload-download-files.mdx#L48

Did you really mean 'sbx'?
// Upload file A to the sandbox to absolute path '/home/user/my-file-a'
await sbx.files.write('/home/user/my-file-a', fileA)
// Upload file B to the sandbox to absolute path '/home/user/my-file-b'
Expand All @@ -53,7 +53,7 @@
```

```python Python
from e2b_code_interpreter import Sandbox
from e2b import Sandbox

sbx = Sandbox.create()

Expand Down Expand Up @@ -82,9 +82,9 @@

<CodeGroup>
```ts JavaScript & TypeScript
import { Sandbox } from '@e2b/code-interpreter'
import { Sandbox } from 'e2b'

const sbx = await Sandbox.create()

Check warning on line 87 in docs/quickstart/upload-download-files.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/quickstart/upload-download-files.mdx#L87

Did you really mean 'sbx'?
// Download file from the sandbox to absolute path '/home/user/my-file'
const content = await sbx.files.read('/home/user/my-file')
// Write file to local path relative to the current working directory
Expand All @@ -92,7 +92,7 @@
```

```python Python
from e2b_code_interpreter import Sandbox
from e2b import Sandbox

sbx = Sandbox.create()
# Download file from the sandbox to absolute path '/home/user/my-file'
Expand All @@ -111,9 +111,9 @@

<CodeGroup>
```ts JavaScript & TypeScript
import { Sandbox } from '@e2b/code-interpreter'
import { Sandbox } from 'e2b'

const sbx = await Sandbox.create()

Check warning on line 116 in docs/quickstart/upload-download-files.mdx

View check run for this annotation

Mintlify / Mintlify Validation (e2b) - vale-spellcheck

docs/quickstart/upload-download-files.mdx#L116

Did you really mean 'sbx'?
// Download file A from the sandbox by absolute path '/home/user/my-file-a'
const contentA = await sbx.files.read('/home/user/my-file-a')
// Write file A to local path relative to the current working directory
Expand All @@ -126,7 +126,7 @@
```

```python Python
from e2b_code_interpreter import Sandbox
from e2b import Sandbox

sbx = Sandbox.create()
# Download file A from the sandbox by absolute path '/home/user/my-file-a'
Expand Down
Loading
Loading