gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

Ability to inject a command prior to docker sandbox entrypoint

Open jonhoo opened this issue 1 year ago • 7 comments

What would you like to be added?

The ability to execute commands just prior to the Docker sandbox entrypoint.

Why is this needed?

Would allow easily installing requisite tools (nix and direnv come to mind) without having to move to a full-blown sandbox.Dockerfile (especially since that doesn't work with npx @google/gemini-cli) by having the pre-entry command be something like apt-get install -y nix direnv.

Additional context

This could probably be added quite trivially right around here:

https://github.com/google-gemini/gemini-cli/blob/2865a527787a741e478f542c57b4c4b0049a5adf/packages/cli/src/utils/sandbox.ts#L179

jonhoo avatar Aug 11 '25 10:08 jonhoo

Is this about the dockerie-zasation of the CLI? I guess that would be awesome but we need to be careful because it is like a cage... Think about everything twice, please

Rand0MGem-Ini avatar Aug 11 '25 10:08 Rand0MGem-Ini

Not quite — it's just that I want the ability to run a shell command inside the docker container prior to it running gemini. Which is otherwise quite inconvenient to achieve.

jonhoo avatar Aug 11 '25 10:08 jonhoo

We allow you to specify your own docker image to use so you can just create one that runs the appropriate script as a workaround.

scidomino avatar Aug 18 '25 18:08 scidomino

You mean via sandbox.Dockerfile? That doesn't work with npx @google/gemini-cli as far as I can tell, and also doesn't support user-wide configuration — it can only be set per project as per #5976.

jonhoo avatar Aug 18 '25 19:08 jonhoo

Ah. Good point. Yeah.

I triaged https://github.com/google-gemini/gemini-cli/issues/5976 so hopefully we'll get a chance to look into it. Alternatively, consider sending us a PR to fix it.

scidomino avatar Aug 18 '25 22:08 scidomino

Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.

It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.

Thank you for your contribution!

gemini-cli[bot] avatar Dec 03 '25 22:12 gemini-cli[bot]

This is still relevant and should be re-opened.

jonhoo avatar Dec 06 '25 14:12 jonhoo