Skip to content

feat(cli): add --vcpus flag to create and run commands#65

Merged
QuiiBz merged 1 commit intomainfrom
feat/cli-vcpus-flag
Feb 24, 2026
Merged

feat(cli): add --vcpus flag to create and run commands#65
QuiiBz merged 1 commit intomainfrom
feat/cli-vcpus-flag

Conversation

@anthonyshew
Copy link
Contributor

Summary

  • The JS SDK supports resources: { vcpus } when creating sandboxes, but the CLI had no way to set this. Adds a --vcpus flag to create (and run by inheritance) so users can allocate more compute from the CLI.

Usage

sandbox create --vcpus 2    # 2 vCPUs, 4096 MB memory
sandbox run --vcpus 4 -- node server.js

Each vCPU includes 2048 MB of memory. Omitting the flag preserves existing default behavior.

Changes

  • packages/sandbox/src/args/vcpus.ts — New reusable arg definition with positive integer validation
  • packages/sandbox/src/commands/create.ts — Wire the arg through to sandboxClient.create() as resources: { vcpus }
  • run inherits from create's args, no changes needed

Testing

Verify with sandbox create --vcpus 2 then sandbox ls — the VCPUS and MEMORY columns should reflect the requested resources.

@vercel
Copy link

vercel bot commented Feb 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sandbox-cli Ready Ready Preview, Comment Feb 24, 2026 1:46pm
sandbox-sdk Ready Ready Preview, Comment Feb 24, 2026 1:46pm
sandbox-sdk-ai-example Ready Ready Preview, Comment Feb 24, 2026 1:46pm

Request Review

@QuiiBz QuiiBz merged commit d230f84 into main Feb 24, 2026
10 checks passed
@QuiiBz QuiiBz deleted the feat/cli-vcpus-flag branch February 24, 2026 13:49
@github-actions github-actions bot mentioned this pull request Feb 24, 2026
QuiiBz added a commit that referenced this pull request Feb 24, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## sandbox@2.5.3

### Patch Changes

- Add `--vcpus` flag to `create` and `run` commands for configuring
sandbox resources. ([#65](#65))

- Fix copying files to local path when not already present
([#64](#64))

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tom Lienard <tom.lienrd@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants