Skip to content

fix(cli): print only the sandbox ID in detached sandbox create - #1762

Open
devin-ai-integration[bot] wants to merge 3 commits into
mainfrom
devin/1787401692-cli-detach-print-id
Open

fix(cli): print only the sandbox ID in detached sandbox create#1762
devin-ai-integration[bot] wants to merge 3 commits into
mainfrom
devin/1787401692-cli-detach-print-id

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

e2b sandbox create -d/--detach is the non-interactive path, but stdout also carried the dashboard inspect link and a prose line (Sandbox created with ID ... using template ...), so callers had to grep it. In detached mode stdout is now exactly the sandbox ID: the dashboard link is skipped entirely and the "Found sandbox template" line goes to stderr.

- printDashboardSandboxInspectUrl(sandbox.sandboxId)
  if (!opts.detach) {
+   printDashboardSandboxInspectUrl(sandbox.sandboxId)
    await connectSandbox({ ... })
  } else {
-   console.log(`Sandbox created with ID ${sandbox.sandboxId} using template ${templateID}`)
+   console.log(sandbox.sandboxId)
  }

Attached mode and sandbox connect are unchanged.

Usage:

SBX=$(e2b sandbox create base -d)   # SBX == "iw2f8kzn3xz2v4q6m6h1z"
e2b sandbox kill "$SBX"

Link to Devin session: https://app.devin.ai/sessions/ac66b81916bf4c2496af9f662a781509
Requested by: @mishushakov

Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@cla-bot cla-bot Bot added the cla-signed label Aug 22, 2026
@changeset-bot

changeset-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 80b608b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@e2b/cli Patch

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

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Package Artifacts

Built from 6006d12. Download artifacts from this workflow run.

JS SDK (e2b@2.45.1-devin-1787401692-cli-detach-print-id.0):

npm install ./e2b-2.45.1-devin-1787401692-cli-detach-print-id.0.tgz

CLI (@e2b/cli@2.17.2-devin-1787401692-cli-detach-print-id.0):

npm install ./e2b-cli-2.17.2-devin-1787401692-cli-detach-print-id.0.tgz

Python SDK (e2b==2.45.1+devin.1787401692.cli.detach.print.id):

pip install ./e2b-2.45.1+devin.1787401692.cli.detach.print.id-py3-none-any.whl

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against TASTE.md (sdk-harness). Checked the changed surface — the new --detach output contract, the printDashboardSandboxInspectUrl option, and the test — against the API-shape rules (T-3, T-12, T-14, T-15, T-22, T-23) and naming/casing rules.

1 violation found (inline comment below). The rest complies: the new optional parameter correctly lands in a trailing options object rather than an optional positional (T-3), and stream: 'stdout' | 'stderr' is a string-literal union instead of a toStderr: boolean flag, leaving room for future variants (T-14).

Note: TASTE.md scopes itself to the js-sdk/python-sdk public surface; the flagged rule is applied here because the CLI util is an exported function growing an options parameter, where the same reasoning (named, reusable, Pick<>-able option type) holds.

Comment thread packages/cli/src/utils/urls.ts Outdated
Comment on lines +15 to +18
export const printDashboardSandboxInspectUrl = (
sandboxId: string,
opts?: { stream?: 'stdout' | 'stderr' }
) => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T-23 — option types are always named and exported, never an inline anonymous shape in the signature (and per T-22 they carry the Opts suffix). opts?: { stream?: 'stdout' | 'stderr' } is neither discoverable nor reusable by callers.

Suggested change
export const printDashboardSandboxInspectUrl = (
sandboxId: string,
opts?: { stream?: 'stdout' | 'stderr' }
) => {
export interface PrintDashboardSandboxInspectUrlOpts {
stream?: 'stdout' | 'stderr'
}
export const printDashboardSandboxInspectUrl = (
sandboxId: string,
opts?: PrintDashboardSandboxInspectUrlOpts
) => {

@mishushakov
mishushakov marked this pull request as ready for review August 22, 2026 12:31
@mishushakov
mishushakov self-requested a review as a code owner August 22, 2026 12:31

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Comment thread packages/cli/src/commands/sandbox/create.ts Outdated
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
Comment thread packages/cli/src/commands/sandbox/create.ts
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant