Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Add pricing; add comments to basic examples

Vasek Mlejnsky0d55348b6b2d
diff --git a/apps/docs/src/app/getting-started/basics/page.mdx b/apps/docs/src/app/getting-started/basics/page.mdx
index 11d5c02b9..d4246d087 100644
--- a/apps/docs/src/app/getting-started/basics/page.mdx
+++ b/apps/docs/src/app/getting-started/basics/page.mdx
@@ -3,6 +3,7 @@ export const metadata = {
description: 'SDK Usage',
}
+{/* I think this stopped working work after adding Nextjs rewrites */}
export const sections = [
{ title: 'Create Playground', id: 'create-playground' },
{ title: 'Use Filesystem', id: 'filesystem' },
@@ -12,10 +13,14 @@ export const sections = [
# Basic Usage
-Following code snippets should get you going fast with our SDK.
-For more real-life scenarios head to the [Examples section](./examples/overview).
+Following code snippets should get you going fast with primitives in our SDK.
+For more real-life scenarios head to the [Examples section](./examples/overview). {{ clasName: 'lead' }}
-## Create Playground
+There are two main primitives in our SDK that you use to interact with the cloud playground:
+- [Filesystem](/getting-started/basics#filesystem)
+- [Process](/getting-started/basics#process)
+
+## Create Cloud Playground
<CodeGroup>
```python {{ language: 'python', snippet: 'python/basics/init.py' }}
```
@@ -23,31 +28,49 @@ For more real-life scenarios head to the [Examples section](./examples/overview)
## Filesystem
-### List directory
+Here are the basic operations you can do with the filesystem inside a cloud playground:
+- [List directory](/getting-started/basics#list-directory-content)
+- [Create directory](/getting-started/basics#create-directory)
+- [Write to file](/getting-started/basics#write-to-file)
+- [Read file](/getting-started/basics#read-file)
+- [Watch directory for changes](/getting-started/basics#watch-directory-for-changes)
+
+
+## List directory content
<CodeGroup>
```python {{ language: 'python', snippet: 'python/basics/fs_ls.py' }}
```
</CodeGroup>
-### Create directory
+## Create directory
+
+A creation of a directory will fail if any directory on the path doesn't exist yet.
+For example, if you want to create a directory `/home/user/new_dir` and `/home/user` doesn't exist yet, you will get an error.
+
<CodeGroup>
```python {{ language: 'python', snippet: 'python/basics/fs_mkdir.py' }}
```
</CodeGroup>
-### Write to file
+## Write to file
+When writing to a file that doesn't exist, it will get created.
+
+When writing to a file that already exists, it will get overwritten.
+
+When writing to a file that's in a directory that doesn't exist, you'll get an error.
+
<CodeGroup>
```python {{ language: 'python', snippet: 'python/basics/fs_write.py' }}
```
</CodeGroup>
-### Read file
+## Read file
<CodeGroup>
-```python {{ language: 'python', snippet: 'python/basics/fs_write.py' }}
+```python {{ language: 'python', snippet: 'python/basics/fs_read.py' }}
```
</CodeGroup>
-### Watch directory for changes
+## Watch directory for changes
<CodeGroup>
```python {{ language: 'python', snippet: 'python/basics/fs_watch.py' }}
```
@@ -55,31 +78,38 @@ For more real-life scenarios head to the [Examples section](./examples/overview)
## Process
-### Start process
+Here are the basic operations you can do with the process inside a cloud playground:
+- [Start process](/getting-started/basics#start-process)
+- [Stop process](/getting-started/basics#stop-process)
+- [Stream stdout](/getting-started/basics#stream-stdout)
+- [Send stdin](/getting-started/basics#send-stdin)
+- [Stream stderr](/getting-started/basics#stream-stderr)
+
+## Start process
<CodeGroup>
```python {{ language: 'python', snippet: 'python/basics/process_start.py' }}
```
</CodeGroup>
-### Stop process
+## Stop process
<CodeGroup>
```python {{ language: 'python', snippet: 'python/basics/process_stop.py' }}
```
</CodeGroup>
-### Stream stdout
+## Stream stdout
<CodeGroup>
```python {{ language: 'python', snippet: 'python/basics/process_stream_stdout.py' }}
```
</CodeGroup>
-### Send stdin
+## Send stdin
<CodeGroup>
```python {{ language: 'python', snippet: 'python/basics/process_stream_stdin.py' }}
```
</CodeGroup>
-### Stream stderr
+## Stream stderr
<CodeGroup>
```python {{ language: 'python', snippet: 'python/basics/process_stream_stderr.py' }}
```
diff --git a/apps/docs/src/app/pricing/page.mdx b/apps/docs/src/app/pricing/page.mdx
new file mode 100644
index 000000000..d75a7a55b
--- /dev/null
+++ b/apps/docs/src/app/pricing/page.mdx
@@ -0,0 +1,13 @@
+export const metadata = {
+ title: 'E2B Pricing & Fees',
+ description: '',
+}
+
+# Pricing
+
+
+E2B is currently in beta and free to use. {{ clasName: 'lead' }}
+
+We're going to offer both free and premium tiers in the future. Pricing will be based on usage of our [cloud playgrounds](/playgrounds/overview) through the SDK.
+
+Our goal is to offer a free tier for hobbyists and personal projects and a premium tier for companies or projects with high usage. Similarly to for example [Supabase](https://supabase.com/pricing) or [Vercel](https://vercel.com/pricing).
\ No newline at end of file
diff --git a/apps/docs/src/code/python/basics/fs_read.py b/apps/docs/src/code/python/basics/fs_read.py
index 60e25190e..3f59a5037 100644
--- a/apps/docs/src/code/python/basics/fs_read.py
+++ b/apps/docs/src/code/python/basics/fs_read.py
@@ -9,12 +9,6 @@ async def main():
# Prints something like:
# 127.0.0.1 localhost
- # ::1 localhost ip6-localhost ip6-loopback
- # fe00::0 ip6-localnet
- # ff00::0 ip6-mcastprefix
- # ff02::1 ip6-allnodes
- # ff02::2 ip6-allrouters
- # 172.17.0.17 77c7a543226b
print(file_content)
await session.close()
diff --git a/apps/docs/src/code/python/basics/process_stop.py b/apps/docs/src/code/python/basics/process_stop.py
index 15881958c..e6ee1330b 100644
--- a/apps/docs/src/code/python/basics/process_stop.py
+++ b/apps/docs/src/code/python/basics/process_stop.py
@@ -7,7 +7,7 @@ async def main():
npm_init = await session.process.start("npm init -y")
await npm_init.kill()
- # There will be no output because we immediatelly kill the `npm_init`` process
+ # There will be no output because we immediatelly kill the `npm_init` process
print(npm_init.stdout)
await session.close()
diff --git a/apps/docs/src/code/python/basics/process_stream_stderr.py b/apps/docs/src/code/python/basics/process_stream_stderr.py
index 864c88c2e..598ffe9ad 100644
--- a/apps/docs/src/code/python/basics/process_stream_stderr.py
+++ b/apps/docs/src/code/python/basics/process_stream_stderr.py
@@ -7,7 +7,7 @@ def print_stderr(output):
async def main():
session = await Session.create(id="Nodejs")
- # This will fail because Golang isn't installed
+ # This command will fail and output to stderr because Golang isn't installed in the cloud playground
golang_version = await session.process.start(
"go version",
on_stderr=print_stderr,
diff --git a/apps/docs/src/components/Navigation.jsx b/apps/docs/src/components/Navigation.jsx
index b11cc9b47..752ef7436 100644
--- a/apps/docs/src/components/Navigation.jsx
+++ b/apps/docs/src/components/Navigation.jsx
@@ -191,6 +191,7 @@ export const navigation = [
title: 'Introduction',
links: [
{ title: 'What is E2B?', href: '/' },
+ { title: 'Pricing', href: '/pricing' },
// { title: 'How It Works', href: '/how-it-works' },
],
},
@@ -202,6 +203,14 @@ export const navigation = [
// { title: 'Use with AI Agents & Copilots', href: '/getting-started/how-to' },
],
},
+ {
+ title: 'Cloud Playgrounds',
+ links: [
+ { title: 'Overview', href: '/playgrounds/overview' },
+ { title: 'Limitations', href: '/playgrounds/limitations' },
+ // { title: 'Use with AI Agents & Copilots', href: '/getting-started/how-to' },
+ ],
+ },
// {
// title: 'AI Environments',
// links: [