gemini-cli - ✅(Solved) Fix Sandboxing completely broken in v0.42.0: "Unknown argument: c" [1 pull requests, 8 comments, 6 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#26964Fetched 2026-05-14 03:46:20
View on GitHub
Comments
8
Participants
6
Timeline
37
Reactions
4
Timeline (top)
labeled ×11commented ×8unlabeled ×6subscribed ×4

Fix Action

Fixed

PR fix notes

PR #26995: Fix sandboxing

Description (problem / solution / changelog)

Summary

Fixes the docker commandline when launching gemini in sandboxed mode. Addresses #26964.

Details

The default docker image used for sandboxing has an entrypoint set (gemini) but gemini-cli tries to then use bash -c as the command for the docker container. Since gemini bash -c isn't a valid command, the container fails to start.

Related Issues

Fixes #26964

How to Validate

GEMINI_SANDBOX=docker npm run start -- --sandbox

Pre-Merge Checklist

<!-- Check all that apply before requesting review or merging. -->
  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

Changed files

  • packages/cli/src/utils/sandbox.ts (modified, +12/-1)

Code Example

Unknown argument: c
Usage: gemini [options] [command]
[... prints command line reference ...]

---

> /about                                                                                                                                                                                             │ 
CLI Version                                                        0.42.0Git Commit                                                         68e2196d5                                                                                                                   │ 
Model                                                              Auto (Gemini 3)Sandbox                                                            no sandbox                                                                                                                  │ 
OS                                                                 linux                                                                                                                       │ 
Auth Method                                                        gemini-api-key

---

{
  "security": {
    "auth": {
      "selectedType": "gemini-api-key"
    }
  },
  "general": {
    "previewFeatures": true,
    "sessionRetention": {
      "warningAcknowledged": true
    },
    "defaultApprovalMode": "auto_edit",
    "plan": {},
    "enableNotifications": true
  },
  "ui": {
    "useAlternateBuffer": true,
    "theme": "Default Light",
    "showModelInfoInChat": true,
    "loadingPhrases": "witty",
    "footer": {
      "showLabels": true,
      "items": [
        "workspace",
        "git-branch",
        "sandbox",
        "model-name",
        "quota"
      ]
    }
  },
  "experimental": {
    "skills": true
  },
  "agents": {
    "overrides": {}
  }
}
RAW_BUFFERClick to expand / collapse

What happened?

This is a new regression in 0.42.0. It was working in 0.41.0.

Running gemini --sandbox fails right away with

Unknown argument: c
Usage: gemini [options] [command]
[... prints command line reference ...]

What did you expect to happen?

I expected Gemini CLI to still work with --sandbox.

Client information

<details> <summary>Client Information</summary>

Run gemini to enter the interactive CLI, then run the /about command.

> /about                                                                                                                                                                                             │ 
│ CLI Version                                                        0.42.0                                                                                                                      │ 
│ Git Commit                                                         68e2196d5                                                                                                                   │ 
│ Model                                                              Auto (Gemini 3)                                                                                                             │ 
│ Sandbox                                                            no sandbox                                                                                                                  │ 
│ OS                                                                 linux                                                                                                                       │ 
│ Auth Method                                                        gemini-api-key
</details>

I'm on Ubuntu 24.04. This is my ~/.gemini/settings.json:

{
  "security": {
    "auth": {
      "selectedType": "gemini-api-key"
    }
  },
  "general": {
    "previewFeatures": true,
    "sessionRetention": {
      "warningAcknowledged": true
    },
    "defaultApprovalMode": "auto_edit",
    "plan": {},
    "enableNotifications": true
  },
  "ui": {
    "useAlternateBuffer": true,
    "theme": "Default Light",
    "showModelInfoInChat": true,
    "loadingPhrases": "witty",
    "footer": {
      "showLabels": true,
      "items": [
        "workspace",
        "git-branch",
        "sandbox",
        "model-name",
        "quota"
      ]
    }
  },
  "experimental": {
    "skills": true
  },
  "agents": {
    "overrides": {}
  }
}

Login information

API key (AI Studio)

Anything else we need to know?

This seems to completely break sandboxing!

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING