Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Improve CLI command docs

Jakub Novakc36a86449672
diff --git a/apps/docs/src/app/cli/commands/page.mdx b/apps/docs/src/app/cli/commands/page.mdx
index bcf272861..1d137c9c4 100644
--- a/apps/docs/src/app/cli/commands/page.mdx
+++ b/apps/docs/src/app/cli/commands/page.mdx
@@ -2,69 +2,59 @@
Build your own sandbox with our CLI. {{ className: 'lead' }}
-## init
+## `build`
-Create basic E2B Dockerfile (`./e2b.Dockerfile`) in current directory. You can then run `e2b build` to build sandbox template from this Dockerfile
+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.
```bash
-e2b template init
+e2b build
```
### Options:
<Properties>
+ <Property name="name" type="-n --name">
+ Specify name of sandbox template. You can use the name to start the sandbox in the SDK. The name must be lowercase and contain only letters, numbers, dashes and underscores.
+ </Property>
<Property name="path" type="-p --path">
Change root directory where command is executed to `path` directory
</Property>
+ <Property name="dockerfile" type="-d --dockerfile">
+ Specify path to Dockerfile. By default E2B tries to find `e2b.Dockerfile` or `Dockerfile` in root directory
+ </Property>
</Properties>
---
-## login
-
-Log in to CLI. It will save your access token in `~/.e2b` file.
-
-```bash
-e2b login
-```
-
----
-
-## logout
+## `help`
-Log out from CLI. It will remove your accesstoken from `~/.e2b` file.
+Show help
```bash
-e2b logout
+e2b help
```
---
-## build
+## `init`
-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.
+Create basic E2B Dockerfile (`./e2b.Dockerfile`) in current directory. You can then run `e2b build` to build sandbox template from this Dockerfile
```bash
-e2b build
+e2b template init
```
### Options:
<Properties>
- <Property name="name" type="-n --name">
- Specify name of sandbox template. You can use the name to start the sandbox in the SDK. The name must be lowercase and contain only letters, numbers, dashes and underscores.
- </Property>
<Property name="path" type="-p --path">
Change root directory where command is executed to `path` directory
</Property>
- <Property name="dockerfile" type="-d --dockerfile">
- Specify path to Dockerfile. By default E2B tries to find `e2b.Dockerfile` or `Dockerfile` in root directory
- </Property>
</Properties>
---
-## list
+## `list`
List your sandbox templates
@@ -74,43 +64,43 @@ e2b list
---
-## shell
+## `login`
-Connect terminal to sandbox. This command can be used to debug your sandbox template. It works as `docker run -it <image> bash` command.
+Log in to CLI. It will save your access token in `~/.e2b` file.
```bash
-e2b shell
+e2b login
```
-### Options:
-
-<Properties>
- <Property name="path" type="-p --path">
- Change root directory where command is executed to `path` directory
- </Property>
-</Properties>
-
---
-## help
+## `logout`
-Show help
+Log out from CLI. It will remove your accesstoken from `~/.e2b` file.
```bash
-e2b help
+e2b logout
```
---
-## version
+## `shell`
-Show version of the CLI
+Connect terminal to sandbox. This command can be used to debug your sandbox template. It works as `docker run -it <image> bash` command.
```bash
-e2b version
+e2b shell
```
-## Next steps
+### Options:
+
+<Properties>
+ <Property name="path" type="-p --path">
+ Change root directory where command is executed to `path` directory
+ </Property>
+</Properties>
+
+### Next steps
1. [Create your first sandbox template](/sandbox/templates/overview)
1. [Check out the official guides](/guides/custom-sandbox)
diff --git a/apps/docs/src/app/cli/installation/page.mdx b/apps/docs/src/app/cli/installation/page.mdx
index 52f25f130..8f4be84b4 100644
--- a/apps/docs/src/app/cli/installation/page.mdx
+++ b/apps/docs/src/app/cli/installation/page.mdx
@@ -9,7 +9,7 @@ The CLI is distributed as an [NPM package](https://www.npmjs.com/package/@e2b/sd
You can install them using the following commands:
```bash
-npm i -g @e2b/cli
+npm install -g @e2b/cli@latest
```
@@ -22,7 +22,7 @@ e2b login
```
-## Next steps
+### Next steps
1. [Create your first sandbox template](/sandbox/templates/overview)
1. [Explore the CLI API](/CLI/commnads)
diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts
index 4a0dfb444..d222dee09 100644
--- a/packages/cli/src/index.ts
+++ b/packages/cli/src/index.ts
@@ -17,7 +17,7 @@ updateNotifier.default({
program
.version(packageJSON.version, undefined, 'Display E2B CLI version')
.addOption(new Option('-cmd2json').hideHelp()).on('option:-cmd2json', () => {
- process.stdout.write(JSON.stringify((program.commands.map((x: any) => ({
+ process.stdout.write(JSON.stringify((program.commands.sort((row1: any, row2: any) => row1.name().localeCompare(row2.name())).map((x: any) => ({
command: x.name(),
description: stripAnsi.default(x.description()),
options: x.options.map((y: any) => ({