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
```
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>
# Description
We can simplify typing and return only SandboxInfo in SDKs as the types
are very similar (there are some extra fields in detail, which we don't
want to expose but we need them e.g. for connect)
Several improvements and refactors to the Python SDK's sandbox
connection and configuration logic.
The main focus is on making header management more flexible, improving
API parameter handling, and simplifying class structures for better
maintainability and usability.
Also unifies doc strings
Increase the default request timeout to 60 seconds. This is the value in
the current beta, and with the merge, we want to keep it that way, to
minimize possible negative migration impact.
- Allow protobuf `4.21.0`+ (we previously allowed this, and some users
in beta require this)
- Allow protobuf `6.0.0`+ (some other users need to use the SDK with the
latest versions)
The SDK should work with both of these, but we may want to smoke test it
somehow.
---------
Co-authored-by: Jakub Novak <jakub@e2b.dev>
Some users report that JS/Python types lack a `useSignature` attribute,
which only works when `secure=true` is set for the sandbox. This change
removes the `useSignatrue` parameter and makes all upload/download URL
requests signed if `secure` was provided, making sure the function will
work for all possible cases.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ben Fornefeld <50748440+ben-fornefeld@users.noreply.github.com>
**Changelog**
- Adds `files.getInfo`, `files.get_info` methods to the SDKs.
- Adds tests for the new methods
- Adds documentation for the above.
**Examples**
JavaScript
```js
import { Sandbox } from '@e2b/code-interpreter'
const sandbox = await Sandbox.create()
// Create a new file
await sandbox.files.write('test_file.txt', 'Hello, world!')
// Get information about the file
const info = await sandbox.files.getInfo('test_file.txt')
console.log(info)
// {
// name: 'test_file.txt',
// type: 'file',
// path: '/home/user/test_file.txt'
// }
```
Python
```py
from e2b_code_interpreter import Sandbox
sandbox = Sandbox()
# Create a new file
sandbox.files.write('test_file', 'Hello, world!')
# Get information about the file
info = sandbox.files.get_info('test_file')
print(info)
# EntryInfo(name='test_file.txt', type=<FileType.FILE: 'file'>, path='/home/user/test_file.txt')
```
---------
Co-authored-by: Jakub Novak <jakub@e2b.dev>
# Description
The bug where extra fields in envd response caused an exception was
fixed in #738. As we're also ignoring new fields in envd (implemented in
https://github.com/e2b-dev/infra/pull/847). We now have to update the
`user-agent` header.