@e2b/cli 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -12
- package/dist/index.js +103 -112
- package/package.json +22 -23
package/README.md
CHANGED
|
@@ -20,6 +20,13 @@
|
|
|
20
20
|
|
|
21
21
|
[E2B](https://e2b.dev) (_english2bits_) is a cloud operating system for AI agents.
|
|
22
22
|
|
|
23
|
+
This CLI tool allows you to build and manage E2B sandbox templates from your terminal.
|
|
24
|
+
|
|
25
|
+
You define your sandbox template in a `Dockerfile` and then use the CLI to build the sandbox template. You can then
|
|
26
|
+
connect to the sandbox template via SDKs and run your AI agents.
|
|
27
|
+
|
|
28
|
+
The `Dockerfile` is the same as for Docker, but you can only use **Debian based linux distros** as the base image.
|
|
29
|
+
|
|
23
30
|
## Installation
|
|
24
31
|
|
|
25
32
|
```bash
|
|
@@ -36,37 +43,52 @@ e2b --help
|
|
|
36
43
|
|
|
37
44
|
1. Authenticate with `e2b login`
|
|
38
45
|
|
|
39
|
-
> To authenticate without the ability to open browser, you can provide `E2B_ACCESS_TOKEN` as an environment variable.
|
|
46
|
+
> To authenticate without the ability to open browser, you can provide `E2B_ACCESS_TOKEN` as an environment variable.
|
|
47
|
+
> Get your `E2B_ACCESS_TOKEN` from [e2b.dev/docs](https://e2b.dev/docs). Then use the CLI like
|
|
48
|
+
> this: `E2B_ACCESS_TOKEN=sk_e2b_... e2b build`
|
|
40
49
|
|
|
41
|
-
2. Create a `Dockerfile` where you describe how your custom E2B
|
|
50
|
+
2. Create a `Dockerfile` where you describe how your custom E2B sandbox template should look like. Majority of **Debian
|
|
51
|
+
based linux distros should work as the base image**. Here is an example of a minimal `Dockerfile` for E2B sandbox
|
|
52
|
+
template:
|
|
42
53
|
|
|
43
|
-
|
|
54
|
+
```Dockerfile
|
|
55
|
+
FROM ubuntu:22.04
|
|
56
|
+
```
|
|
44
57
|
|
|
45
|
-
|
|
58
|
+
3. Run `e2b build` inside the directory with the `Dockerfile` to create and build the sandbox template. You will get *
|
|
59
|
+
_template ID_* that you use for connecting to the sandbox via SDKs and for rebuilding the sandbox template
|
|
46
60
|
|
|
47
|
-
|
|
61
|
+
5. Use the **template ID** that you got during the `e2b build` with the Python or JS/TS SDK as the `id` to create
|
|
62
|
+
sandbox
|
|
48
63
|
|
|
64
|
+
6. Rebuild the sandbox template by running `e2b build <id-of-the-template>` in the directory with the `Dockerfile`
|
|
49
65
|
|
|
50
66
|
## Commands
|
|
51
67
|
|
|
52
|
-
All commands can be called with a `--path <path-to-dir>` flag that changes the directory where the command will be
|
|
68
|
+
All commands can be called with a `--path <path-to-dir>` flag that changes the directory where the command will be
|
|
69
|
+
called, without the need to call `cd`.
|
|
53
70
|
|
|
54
71
|
```sh
|
|
55
|
-
-V, --version Display
|
|
72
|
+
-V, --version Display E2B CLI version
|
|
56
73
|
-h, --help display help for command
|
|
57
74
|
```
|
|
58
75
|
|
|
59
76
|
```sh
|
|
60
|
-
Usage: e2b
|
|
77
|
+
Usage: e2b template [options] [command]
|
|
61
78
|
|
|
62
|
-
Manage
|
|
79
|
+
Manage E2B sandbox templates
|
|
63
80
|
|
|
64
81
|
Options:
|
|
65
82
|
-h, --help display help for command
|
|
66
83
|
|
|
67
84
|
Commands:
|
|
68
|
-
build|bd [options] [id] Build
|
|
69
|
-
|
|
70
|
-
|
|
85
|
+
build|bd [options] [id] Build sandbox template defined by ./e2b.Dockerfile or ./Dockerfile in root directory. By default the root directory is the current working directory. This command also creates e2b.toml config
|
|
86
|
+
|
|
87
|
+
list|ls List sandbox templates
|
|
88
|
+
|
|
89
|
+
shell|sh <id> Connect terminal to sandbox
|
|
90
|
+
|
|
91
|
+
init|it [options] Create basic E2B `e2b.Dockerfile` in root directory. You can then run `e2b template build` to build sandbox template from this Dockerfile
|
|
92
|
+
|
|
71
93
|
help [command] display help for command
|
|
72
94
|
```
|