Skip to content

Conversation

@RatArt
Copy link
Contributor

@RatArt RatArt commented Nov 28, 2025

Additions:

  • quickstart.mdx
    Added link to Apikeys on /quickstart
  • code-interpreting/analyze-data-with-ai.mdx
    Changed model of claude used in example to claude-haiku-4-5-20251001, the old one doesnt exist anymore
    Added import to part codes examples
    changed the prompt, the new model wanted to only print and not return anything
  • code-interpreting/pre-installed-libraries.mdx
    added dynamic loading/formatting from https://raw.githubusercontent.com/e2b-dev/code-interpreter/refs/heads/main/template/requirements.txt via /snippets/SandboxPackages.jsx

Fixes:

  • filesystem/upload.mdx: Fix variable name (sbx→sandbox), function name (readDirectoryContents→readDirectoryFiles), and syntax error in comment, Changed sandbox.files.write(files) → sandbox.files.write_files(files)
  • sandbox/persistence.mdx: Fix undefined variable (sandbox_id→sbx.sandbox_id) and missing code fence
  • sandbox/connect.mdx: Remove unused variable and update to new paginator API
  • sandbox/metadata.mdx: Update to new paginator API
  • filesystem/watch.mdx: Add missing FilesystemEventType import
  • sandbox/environment-variables.mdx: Add missing Sandbox imports
  • filesystem/read-write.mdx: Removed incorrect await from Python code blocks

Added import dotenv JS/TS:

  • commands.mdx
  • commands/background.mdx
  • commands/streaming.mdx
  • filesystem/download.mdx
  • filesystem/info.mdx
  • filesystem/read-write.mdx
  • filesystem/upload.mdx
  • filesystem/watch.mdx
  • sandbox/connect.mdx
  • sandbox/environment-variables.mdx
  • sandbox/lifecycle-events-api.mdx
  • sandbox/list.mdx
  • sandbox/metadata.mdx
  • sandbox/metrics.mdx
  • sandbox/persistence.mdx

Added import dotenv to Python code examples:

  • commands.mdx
  • commands/background.mdx
  • commands/streaming.mdx
  • filesystem/download.mdx
  • filesystem/info.mdx
  • filesystem/read-write.mdx
  • filesystem/upload.mdx
  • filesystem/watch.mdx
  • sandbox/connect.mdx
  • sandbox/environment-variables.mdx
  • sandbox/lifecycle-events-api.mdx
  • sandbox/list.mdx
  • sandbox/metadata.mdx
  • sandbox/metrics.mdx
  • sandbox/persistence.mdx

@RatArt
Copy link
Contributor Author

RatArt commented Nov 28, 2025

moved text from packages component
unified imports to using '

Only files where I kept the dotenv import

  • docs/template/quickstart.mdx
  • docs/template/quickstart.mdx
  • docs/template/quickstart.mdx
  • docs/legacy/hello-world/js.mdx
  • docs/code-interpreting/analyze-data-with-ai.mdx
  • docs/quickstart.mdx

```
```python Python highlight={4-6}
```python Python highlight={6-8}
from dotenv import load_dotenv
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dotenv here can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove it from the entire page /docs/sandbox/environment-variables, including the sandbox imports. It is inconsistent, and it doesn't appear in any example on that page in the live version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, it is in 1 example on the live page, but that doesn't really make sense to me, and I would rather have it consistent, either all have it, or all don't. What is your opinion about this pls?

@mishushakov
Copy link
Member

can we remove line highlight here also, doesn't make much sense
Screenshot 2025-12-03 at 15 14 45

@RatArt
Copy link
Contributor Author

RatArt commented Dec 3, 2025

All comments should be fixed 👍


<CodeGroup>
```js JavaScript & TypeScript highlight={7}
```js JavaScript & TypeScript highlight={6}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep it 7

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we change the code in the example so it's

step 1

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

const sbx = await Sandbox.create()

// Get all running sandboxes
const paginator = await Sandbox.list({
  query: { state: ['running'] },
})

const runningSandboxes = await paginator.nextItems()
if (runningSandboxes.length === 0) {
  throw new Error('No running sandboxes found')
}

// Get the ID of the sandbox you want to connect to
const sandboxId = runningSandboxes[0].sandboxId

step 2

const sandbox = await Sandbox.connect(sandboxId)

// Now you can use the sandbox as usual
// ...
const result = await sandbox.commands.run("whoami")
console.log(`Running in sandbox ${sandbox.sandboxId} as "${result.stdout.trim()}"`)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants