Skip to main content
This example runs the official scoped Gemini CLI package inside a disposable Node.js microVM. The project is mounted from your host, while Gemini authentication and settings live on the sandbox’s root disk.

Run Gemini CLI

1

Start Gemini CLI

Gemini CLI first asks whether you trust the workspace. Review the mounted project, then continue to authentication.
For an isolated workspace, or when using microsandbox cloud, replace --mount-dir ./my-project:/workspace:rw with --copy-dir ./my-project:/workspace.
Install the scoped package exactly as shown: @google/gemini-cli. Do not substitute similarly named unscoped packages.
2

Start another session

After leaving Gemini CLI, return to the same sandbox and workspace with:
3

Verify the installation

Exit the TUI and run:
The pinned example prints 0.52.0.
4

Review or export changes

With the default writable mount, changes are already in the host checkout. Review them inside the sandbox:
If you chose the isolated --copy-dir alternative, create a patch inside the sandbox:
Copy the patch to the host:
Check that it applies cleanly before applying it:
5

Clean up

Remove the sandbox:
Removing the sandbox also removes its Gemini authentication and settings. Changes made through the default workspace mount remain in the host checkout.

Reference