Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Update vercel proxy setup; Merge latest docs changes
Tomas Valentac23a5f67945b
diff --git a/apps/docs/src/app/getting-started/basic-usage/page.mdx b/apps/docs/src/app/getting-started/basics/page.mdxsimilarity index 99%rename from apps/docs/src/app/getting-started/basic-usage/page.mdxrename to apps/docs/src/app/getting-started/basics/page.mdxindex 11a5b1f79..768b83e18 100644--- a/apps/docs/src/app/getting-started/basic-usage/page.mdx+++ b/apps/docs/src/app/getting-started/basics/page.mdx@@ -3,6 +3,7 @@ export const metadata = {description: 'SDK Usage',}+# Basic UsageFollowing code snippets should get you going fast with our SDK.diff --git a/apps/docs/src/app/getting-started/installation/page.mdx b/apps/docs/src/app/getting-started/installation/page.mdxindex fbd75c346..b340bda6d 100644--- a/apps/docs/src/app/getting-started/installation/page.mdx+++ b/apps/docs/src/app/getting-started/installation/page.mdx@@ -9,7 +9,7 @@ We offer SDKs for **JavaScript**, **TypeScript**, and **Python**. The SDKs are rYou can install them using the following commands:<CodeGroup>-```bash {{ language: 'js', title: 'JavaScript & TypeScript' }}+```bash {{ language: 'js', title: 'JavaScript/TypeScript' }}npm install @e2b/sdk```@@ -18,4 +18,4 @@ pip install e2b```</CodeGroup>-Once installed head over to the [Basic Usage](/getting-started/basic-usage) section.+Once installed head over to the [Basics](/getting-started/basics) or [Examples](/examples/overview) section. {{ className: 'lead' }}diff --git a/apps/docs/src/app/page.mdx b/apps/docs/src/app/page.mdxindex 2fd9dfad0..9a3341dc5 100644--- a/apps/docs/src/app/page.mdx+++ b/apps/docs/src/app/page.mdx@@ -1,8 +1,6 @@import { Guides } from '@/components/Guides'import { UseCases } from '@/components/UseCases'import { HeroPattern } from '@/components/HeroPattern'-import { Code } from '@/components/Code'-export const metadata = {title: 'E2B Documentation',@@ -21,9 +19,8 @@ export const sections = [**E2B is a cloud operating system for AI agents.**{{ className: 'lead' }}-With a single line of our SDK, you can give your AI agent a sandboxed cloud environment where your agent can do any of the following:-- Run any code-- Run any terminal command+With a single line of our SDK, you can give your AI agent a sandboxed cloud environment where your agent can do any of the following (and more):+- Run any code and terminal command in a sandboxed environment- Install dependencies and programs- Use filesystem- Upload and download files@@ -34,7 +31,7 @@ With a single line of our SDK, you can give your AI agent a sandboxed cloud enviThis just a few examples of what can be done with our agent cloud environments.-Our SDK works with any AI agent (no matter what framework, you're using), and without the need to manage any infrastructure.+Our SDK works with any AI agent (no matter what framework you're using), and without the need to manage any infrastructure.<div className="not-prose mb-16 mt-6 flex gap-3"><Button href="/getting-started/installation" arrow="right" children="Getting Started" />diff --git a/apps/docs/src/code/python/fs_ls.py b/apps/docs/src/code/python/fs_ls.pynew file mode 100644index 000000000..06e5a7d0b--- /dev/null+++ b/apps/docs/src/code/python/fs_ls.py@@ -0,0 +1,14 @@+import asyncio+from e2b import Session++async def main():+ session = await Session.create(id="Nodejs")++ # List directory+ dir_content = await session.filesystem.list('/')+ for item in dir_content:+ print(item)++ await session.close()++asyncio.new_event_loop().run_until_complete(main())\ No newline at end of filediff --git a/apps/docs/src/code/python/fs_read.py b/apps/docs/src/code/python/fs_read.pynew file mode 100644index 000000000..a07e3bdff--- /dev/null+++ b/apps/docs/src/code/python/fs_read.py@@ -0,0 +1,13 @@+import asyncio+from e2b import Session++async def main():+ session = await Session.create(id="Nodejs")++ # Read file+ file_content = await session.filesystem.read('/etc/hosts')+ print(file_content)++ await session.close()++asyncio.new_event_loop().run_until_complete(main())\ No newline at end of filediff --git a/apps/docs/src/code/python/init.py b/apps/docs/src/code/python/init.pynew file mode 100644index 000000000..84d05b8f3--- /dev/null+++ b/apps/docs/src/code/python/init.py@@ -0,0 +1,15 @@+import asyncio+from e2b import Session++# You can use some of the predefined environments by using specific id:+# 'Nodejs', 'Bash', 'Python3', 'Java', 'Go', 'Rust', 'PHP', 'Perl', 'DotNET'+# We'll support custom environments soon.+session_id = "Nodejs"++async def main():+ session = await Session.create(id=session_id)++ # Close the session once you're done.+ await session.close()++asyncio.new_event_loop().run_until_complete(main())\ No newline at end of filediff --git a/apps/docs/src/code/python/main.py b/apps/docs/src/code/python/main.pynew file mode 100644index 000000000..02bf710ac--- /dev/null+++ b/apps/docs/src/code/python/main.py@@ -0,0 +1,12 @@+from e2b import Session+# You can use some of the predefined environments by using specific id:+# 'Nodejs', 'Bash', 'Python3', 'Java', 'Go', 'Rust', 'PHP', 'Perl', 'DotNET'+session = Session(id="Nodejs", on_scan_ports=lambda ports: print("Open ports", ports))++# Start a session and create a connection to it+await session.open()++...++# Close the session after you are done+await session.close()\ No newline at end of filediff --git a/apps/docs/src/code/python/pyproject.toml b/apps/docs/src/code/python/pyproject.tomlnew file mode 100644index 000000000..f61e8dd22--- /dev/null+++ b/apps/docs/src/code/python/pyproject.toml@@ -0,0 +1,16 @@+[tool.poetry]+name = "e2b-docs-python-code"+version = "0.1.0"+description = ""+authors = ["Your Name <[email protected]>"]+readme = "README.md"+packages = [{include = "e2b_docs_python_code"}]++[tool.poetry.dependencies]+python = "^3.10"+e2b = "^0.1.10"+++[build-system]+requires = ["poetry-core"]+build-backend = "poetry.core.masonry.api"diff --git a/apps/docs/src/components/Navigation.jsx b/apps/docs/src/components/Navigation.jsxindex 23958c0d5..e5c5ae861 100644--- a/apps/docs/src/components/Navigation.jsx+++ b/apps/docs/src/components/Navigation.jsx@@ -198,7 +198,8 @@ export const navigation = [title: 'Getting Started',links: [{ title: 'Installation', href: '/getting-started/installation' },- { title: 'Basic Usage', href: '/getting-started/basic-usage' },+ { title: 'Basics', href: '/getting-started/basics' },+ { title: 'Use with AI Agents & Copilots', href: '/getting-started/how-to' },],},// {diff --git a/apps/reverse-proxy/README.md b/apps/reverse-proxy/README.mdnew file mode 100644index 000000000..84a51fa45--- /dev/null+++ b/apps/reverse-proxy/README.md@@ -0,0 +1,3 @@+# Reverse Proxy++Reverse proxying via Vercel that handles redirects and rewrites for E2B websites.diff --git a/apps/reverse-proxy/vercel.json b/apps/reverse-proxy/vercel.jsonindex 01a483329..c830ef9ff 100644--- a/apps/reverse-proxy/vercel.json+++ b/apps/reverse-proxy/vercel.json@@ -44,8 +44,18 @@]},{- "source": "/blog(/.*)?",- "destination": "https://e2b-blog.framer.website$1",+ "source": "/blog",+ "destination": "https://e2b-blog.framer.website",+ "has": [+ {+ "type": "host",+ "value": "e2b.dev"+ }+ ]+ },+ {+ "source": "/blog/:path*",+ "destination": "https://e2b-blog.framer.website/:path*","has": [{"type": "host",@@ -56,36 +66,74 @@],"redirects": [{- "source": "/(.*)?",+ "source": "/log/:path*",+ "destination": "https://e2b.dev/blog/log/:path*",+ "permanent": true+ },+ {+ "source": "/:path*","has": [{"type": "host","value": "blog.e2b.dev"}],- "destination": "https://e2b.dev/blog/$1",+ "destination": "https://e2b.dev/blog/:path*","permanent": true},{- "source": "/(.*)?",+ "source": "/:path*","has": [{"type": "host","value": "changelog.e2b.dev"}],- "destination": "https://e2b.dev/changelog/$1",+ "destination": "https://e2b.dev/changelog/:path*","permanent": true},{- "source": "/(.*)?",+ "source": "/:path*",+ "has": [+ {+ "type": "host",+ "value": "docs.e2b.dev"+ }+ ],+ "destination": "https://e2b.dev/docs/:path*",+ "permanent": true+ },+ {+ "source": "/",+ "has": [+ {+ "type": "host",+ "value": "blog.e2b.dev"+ }+ ],+ "destination": "https://e2b.dev/blog",+ "permanent": true+ },+ {+ "source": "/",+ "has": [+ {+ "type": "host",+ "value": "changelog.e2b.dev"+ }+ ],+ "destination": "https://e2b.dev/changelog",+ "permanent": true+ },+ {+ "source": "/","has": [{"type": "host","value": "docs.e2b.dev"}],- "destination": "https://e2b.dev/docs/$1",+ "destination": "https://e2b.dev/docs","permanent": true}]