Repository navigation
feat(sdk): add shell option to commands.run - #2138
Conversation
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
🦋 Changeset detectedLatest commit: 7cca0d3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Package ArtifactsBuilt from 6acf02a. Download artifacts from this workflow run. JS SDK ( npm install ./e2b-dockerfile-utils-0.1.2-devin-1794582514-commands-shell.0.tgz ./e2b-2.63.1-devin-1794582514-commands-shell.0.tgzCLI ( npm install ./e2b-cli-2.23.1-devin-1794582514-commands-shell.0.tgzCode Interpreter JS SDK ( npm install ./e2b-code-interpreter-2.9.2-devin-1794582514-commands-shell.0.tgzDesktop JS SDK ( npm install ./e2b-desktop-2.5.1-devin-1794582514-commands-shell.0.tgzPython SDK ( pip install ./e2b_dockerfile_utils-0.1.1+devin.1794582514.commands.shell-py3-none-any.whl ./e2b-2.63.0+devin.1794582514.commands.shell-py3-none-any.whlCode Interpreter Python SDK ( pip install ./e2b_code_interpreter-2.11.9+devin.1794582514.commands.shell-py3-none-any.whlDesktop Python SDK ( pip install ./e2b_desktop-2.7.2+devin.1794582514.commands.shell-py3-none-any.whl |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
I reviewed this PR and found no new bugs. It adds a new option to the public commands.run API in all three SDKs, so a maintainer should still look at the API design.
What was reviewed:
- The JS
Commands.runpath. Theshelloption is split intocmdandargs, the default is still/bin/bash -l -c, and an empty or missing executable throwsInvalidArgumentErrorbefore the RPC is sent. - The Python helper
shell_commandand how the sync and asyncrunand_startmethods passshellthrough. Both build the sameProcessConfig, andshellis keyword-only in every overload. - The changeset is a
minorbump for both packages. The new tests cover a custom shell, a shell with no arguments and an empty shell list in all three SDKs.
Extended reasoning...
The change adds an optional shell list to commands.run in the JS SDK and in the sync and async Python SDKs. It replaces the hardcoded /bin/bash -l -c with shell[0] plus the remaining arguments and the command. The default behavior is unchanged. Validation and error types match across the SDKs, and integration tests cover the new paths. The change is small but adds to the public API of both published packages.
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
Summary
Adds a
shelloption tocommands.run(JS, Python sync + async) to run the command with a custom executable and arguments. The command is appended as the last argument; the default is unchanged (/bin/bash -l -c <cmd>).An empty
shell(or empty executable) throwsInvalidArgumentError/InvalidArgumentException. In Python,shellis keyword-only (next toretain_output); the split lives ine2b.sandbox.commands.main.shell_command, shared by sync and async.Docs: https://github.com/e2b-dev/docs/pull/652
Link to Devin session: https://app.devin.ai/sessions/7373b9ecd386440480159765d3afda22
Open in Devin Desktop: https://app.devin.ai/desktop/session/7373b9ecd386440480159765d3afda22?variant=devin
Requested by: @mishushakov