Commit Graph

355 Commits

Author SHA1 Message Date
Jakub Novák d90c201cf3 Update docstring in toml after CLI template build (#868)
Forgotten text with old way how to create sandbox in sync Python
2025-09-26 12:06:27 +00:00
github-actions[bot] 0726589667 [skip ci] Release new versions 2025-09-25 09:12:18 +00:00
Jakub Dobry b43793ceb9 Fix CLI template migrate copy target (#915) 2025-09-25 02:09:04 -07:00
github-actions[bot] 2eeca3f807 [skip ci] Release new versions 2025-09-19 15:44:52 +00:00
Jakub Dobry b9c4b16baa feat: add template migration to CLI (#880)
## 🔄 Add Template Migration to CLI

### Summary

This PR introduces a new `migrate` command to the E2B CLI that helps
users transition from the legacy Dockerfile + TOML configuration format
to the new Template SDK format. The migration tool automatically
converts existing `e2b.Dockerfile` and `e2b.toml` configurations into
SDK-compatible template files using Handlebars templates.

### What's Changed

####  New Features

- **Template Migration Command**: Added `e2b template migrate` command
for converting legacy configurations to SDK format
- **Multi-Language Support**: Supports migration to TypeScript, Python
(sync), and Python (async) formats
- **Interactive Language Selection**: CLI prompts for target language
when not specified
- **Multi-stage Dockerfile Support**: Added fallback handling for
complex multi-stage Dockerfiles

#### 🔧 Technical Improvements

- **Enhanced ENV Handling**: Improved parsing of multiple environment
variables from single ENV instructions
- **File Name Conflict Resolution**: Automatic unique filename
generation to prevent overwriting existing files
- **Comprehensive Template Generation**: Creates both development and
production build files

#### 📁 New Template Files

- `typescript-template.hbs` - TypeScript template generation
- `typescript-build.hbs` - TypeScript build script template
- `python-template.hbs` - Python template generation (supports both
sync/async)
- `python-build-async.hbs` - Python async build script template
- `python-build-sync.hbs` - Python sync build script template

### Usage

```bash
# Migrate with interactive language selection
e2b template migrate

# Migrate to specific language
e2b template migrate --language typescript
e2b template migrate --language python-sync
e2b template migrate --language python-async

# Custom paths
e2b template migrate --dockerfile custom.dockerfile --config custom.toml
```

### Generated Output

The migration command generates three files per target:
- `template.{ts|py}` - Template definition using SDK
- `build{.|_}dev.{ts|py}` - Development build script
- `build{.|_}prod.{ts|py}` - Production build script

### Migration Process

1. **Parse Configuration**: Reads `e2b.toml` for template settings
2. **Dockerfile Analysis**: Uses E2B SDK to parse Dockerfile
instructions
3. **Transformation**: Converts Docker instructions to SDK method calls
4. **Code Generation**: Uses Handlebars templates to generate target
language files
5. **File Creation**: Writes template and build files with conflict
resolution

### Error Handling

- **Graceful Dockerfile Parsing**: Falls back to custom image reference
for unparseable Dockerfiles
- **Clear User Guidance**: Provides manual build instructions when
automatic conversion fails
- **Validation**: Ensures required configuration files exist before
migration
2025-09-19 17:41:28 +02:00
github-actions[bot] fba88a7aea [skip ci] Release new versions 2025-09-15 05:30:29 +00:00
Mish Ushakov c6efe1f26c CLI: format table > pretty to match rest of DX, added docs (#905)
Follow up my last PR, improves DX consistency and added docs.

Changelog

- format "table" > "pretty" to match other commands (metrics, logs)
- added doc section
2025-09-14 22:27:29 -07:00
github-actions[bot] 742ed67a80 [skip ci] Release new versions 2025-09-12 19:51:16 +00:00
Mish Ushakov 2a346bfcd2 Added format option to CLI sandbox + templates list (#903)
This PR is based on https://github.com/e2b-dev/E2B/pull/902, please
proceed with that first

**Changelog**

- Added `--format` option to "e2b sandbox list" and "e2b template list".
Can either be "table" or "json"

Sandboxes list in JSON format

<img width="471" height="341" alt="Screenshot 2025-09-12 at 11 17 45"
src="https://github.com/user-attachments/assets/13455b62-5efb-4b11-8fe3-a39b3fb6dffc"
/>

Templates list in JSON format

<img width="449" height="377" alt="Screenshot 2025-09-12 at 11 18 55"
src="https://github.com/user-attachments/assets/47fa3c2b-2e4c-4854-a87f-65c325261521"
/>
2025-09-12 21:47:07 +02:00
Mish Ushakov a116679b87 CLI: Refactored sandbox kill command (#904)
**Changelog**

- Added ability to pass multiple sandbox ids to "sbx kill id1 id2 id3"
- Added ability to filter sandboxes to be killed by metadata and by
state using --state, --metadata (requires --all)
- Fixed metadata parser and moved to utils
2025-09-12 21:45:25 +02:00
github-actions[bot] 2162c6191f [skip ci] Release new versions 2025-09-03 12:49:17 +00:00
Mish Ushakov 67070bb9ea Synced spec + generated API client (#889)
Changelog

- Synced latest spec from e2b-dev/infra
- Regenerated API clients
2025-09-03 05:43:47 -07:00
github-actions[bot] 0070938d01 [skip ci] Release new versions 2025-09-01 07:47:17 +00:00
Jakub Novák 99b9ed768d Deprecate spawn instead of remove (#885)
Adds a deprecated `spawn` command to the CLI, ensuring backward
compatibility and guiding users toward the preferred `create` command.


```
$ e2b sandbox
Usage: index sandbox|sbx [options] [command]

work with sandboxes

Options:
  -h, --help                        display help for command

Commands:
  connect|cn <sandboxID>            connect terminal to already running sandbox
  list|ls [options]                 list all sandboxes, by default it list only running ones
  kill|kl [options] [sandboxID]     kill sandbox
  create|cr [options] [template]    create sandbox and connect terminal to it
  logs|lg [options] <sandboxID>     show logs for sandbox
  metrics|mt [options] <sandboxID>  show metrics for sandbox
  help [command]                    display help for command
  ```
  
  ```
$ sbx sp base
Warning: The 'spawn' command is deprecated and will be removed in future releases. Please use 'e2b sandbox create' instead.
Terminal connecting to template base with sandbox ID in897x2dqs7aws8h1x0in
```
2025-09-01 07:44:10 +00:00
Jakub Novák b42ab2a86b Add pipeline for linting and formatting (#883)
Setup linting and formatting in all packages
2025-08-31 12:06:00 -07:00
github-actions[bot] 663d832ddc [skip ci] Release new versions 2025-08-22 09:45:46 +00:00
Jakub Novák c2195d832f Fix API key check in JS SDK & remove deprecated fields (#869)
Fix the check and remove deprecated fields
2025-08-22 09:42:49 +00:00
github-actions[bot] 774dfd7667 [skip ci] Release new versions 2025-08-21 15:51:16 +00:00
Jakub Novák 74457ff1dd SDK v2 - Changeset and docs (#862)
SDK v2 release
2025-08-21 08:45:25 -07:00
Jakub Novák d117ba09e8 SDK v2 - Add beta pause and update Sandbox list (#854)
Introduce beta submodule with beta features - pause and resume
Update Sandbox list to also return paused sandboxes

---------

Co-authored-by: Tomas Valenta <valenta.and.thomas@gmail.com>
2025-08-19 00:37:07 -07:00
Jakub Dobry 41d909a4bb Update access token location readme (#852) 2025-08-07 04:23:22 -07:00
github-actions[bot] 64a5d52dd5 [skip ci] Release new versions 2025-07-31 10:43:16 +00:00
Jakub Novák ec1b831018 Fix byte shift in sandbox metrics (#837)
This pull request addresses a bug in the CLI related to incorrect byte
shifting for memory and disk metrics when dealing with sizes greater
than 4 GB.
2025-07-31 03:40:27 -07:00
github-actions[bot] 0c6cfed137 [skip ci] Release new versions 2025-07-31 09:57:39 +00:00
Jakub Novák 8c4710cc60 Fix metrics cli missing api key (#836)
# Description
Fixing a missing API key issue for sandbox metrics in the CLI
2025-07-31 09:54:44 +00:00
github-actions[bot] 76d62ed070 [skip ci] Release new versions 2025-07-30 19:25:33 +00:00
Jakub Novák e34d69525f Expose sandbox metrics in SDKs and CLI (#828)
# Description

Expose sandbox metrics in SDKs and CLI


```
e2b sbx mt il98ycmohc6enybi79uf8

Metrics for sandbox il98ycmohc6enybi79uf8:

[2025-07-25 14:05:55Z]  CPU:  8.27% /  2 Cores | Memory:    31 / 484   MiB | Disk:  1445 / 2453  MiB
[2025-07-25 14:06:00Z]  CPU:   0.5% /  2 Cores | Memory:    32 / 484   MiB | Disk:  1445 / 2453  MiB
[2025-07-25 14:06:05Z]  CPU:   0.1% /  2 Cores | Memory:    32 / 484   MiB | Disk:  1445 / 2453  MiB
[2025-07-25 14:06:10Z]  CPU:   0.3% /  2 Cores | Memory:    32 / 484   MiB | Disk:  1445 / 2453  MiB

```

---------

Co-authored-by: Tomas Valenta <valenta.and.thomas@gmail.com>
2025-07-30 12:17:30 -07:00
github-actions[bot] 37ec33654d [skip ci] Release new versions 2025-07-18 15:23:52 +00:00
Jiri Sveceny 56dfb423ad Add image URI mask option for template build to allow custom image repository (#819)
This will allow customers who are not using our Docker repository to
fall back to their own during template build.
2025-07-18 17:20:46 +02:00
github-actions[bot] e7538fb5cc [skip ci] Release new versions 2025-07-18 11:20:02 +00:00
github-actions[bot] 5f207ffa95 [skip ci] Release new versions 2025-07-17 13:16:31 +00:00
Jiri Sveceny 9f8c40e49e Client ID part removal from SDKs (#820)
- CLI spawn, connect, and logs work with and without the client part
provided
- JavaScript and Python SDKs are no longer returning IDs with client
part
2025-07-17 13:11:50 +00:00
github-actions[bot] 8b8cf0084f [skip ci] Release new versions 2025-07-09 14:49:53 +00:00
Jakub Dobry 2817a85101 Print all logs also on build success (#814)
Print all logs also on build success
2025-07-09 07:46:13 -07:00
github-actions[bot] 93134e2faa [skip ci] Release new versions 2025-06-18 12:16:44 +00:00
Mish Ushakov 4730e13656 Changed help link in the CLI on failed build (#782)
current link leads to 404
2025-06-18 14:14:03 +02:00
github-actions[bot] 23a9298252 [skip ci] Release new versions 2025-06-13 00:45:36 +00:00
Jakub Dobry e244ba72c0 Add option for a template ready check (#750)
## Description
Add option for a template ready check. You can specify `ready_cmd` which
will be run until it exits with code 0. Max timeout is 5 minutes. After
exit code 0, the template will be marked as ready.

If no ready command is defined, `sleep 20` is assumed when the start
command is present, and `sleep 0` when none is defined. It is also
possible to define ready command without any start command. This might
be helpful if the filesystem contains self-booted services (e.g. using
systemd).

```
ready_cmd = "echo 'Starting ready check'; sleep 40; echo 'Template is ready'"
```

This adds possibility to configure the default 20 seconds wait time for
a start command.

New documentation can be found at `/docs/sandbox-template/ready-cmd`.

## Checklist
- [x] Make sure the https://github.com/e2b-dev/infra/pull/719 is
deployed

---------

Co-authored-by: Vasek Mlejnsky <vasek@e2b.dev>
Co-authored-by: Jakub Novák <jakub@e2b.dev>
2025-06-12 17:42:37 -07:00
github-actions[bot] 27e292eedc [skip ci] Release new versions 2025-06-05 15:39:44 +00:00
Jakub Novák ca905b0639 Fix CLI regression (#762)
# Description 

Introduced in
[here](https://github.com/e2b-dev/E2B/pull/747/files#diff-69710e23d3c0765f64152a2be96bd62daf49732e11d1e46b607686ec0cf15e75)
2025-06-05 17:36:41 +02:00
github-actions[bot] 6c0927e358 [skip ci] Release new versions 2025-06-05 14:15:25 +00:00
Mish Ushakov fc182d63ef Added license sources to SDKs (#761)
- Added licenses source text to the SDKs, CLI
2025-06-05 07:10:07 -07:00
Jakub Dobry 4ffb211155 Fix CLI compilation (#747)
Fix CLI compilation. Fixes nullable res.data & non-existent /teams
endpoint in the OpenAPI generated client.
2025-05-28 05:42:23 -07:00
github-actions[bot] 41ef82cbd2 [skip ci] Release new versions 2025-05-15 17:22:06 +00:00
Mish Ushakov 698959dddb Added --no-cache option for building templates without cache (#735)
- Adds `--no-cache` parameter to CLI `template build` command for
building templates without cache.
2025-05-15 19:19:04 +02:00
Ben Fornefeld 10db4e95e6 CLI: Improve auth login typing + browser sign in response usage (#733)
This pr improves the auth login code, to be more declarative and
realistic to the actual response that is sent by the dashboard sign in
flow.
2025-05-15 19:18:24 +02:00
github-actions[bot] 231e19694d [skip ci] Release new versions 2025-05-15 16:46:57 +00:00
Ben Fornefeld a1c2466841 Fix authErrorBox switch breaking (#734)
To show the correct error message in our cli, we need to break the
switch cases. Currently always the last case will be applied, no matter
the input.
2025-05-15 18:44:00 +02:00
Jiri Sveceny 2def1305f3 Flag for securing envd access with auth token (#688)
Waiting until secure flag will be available in production cluster.

---------

Co-authored-by: Jakub Novák <jakub@e2b.dev>
2025-05-14 15:15:18 +00:00
Mish Ushakov fd0a097ca9 Added homebrew installation instructions to the docs (#721) 2025-05-13 11:40:12 +00:00