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

Support Gemini CLI extensions (MCP prompts) in headless/non-interactive mode

Open codrienne opened this issue 1 year ago • 8 comments

What would you like to be added?

If I've configured extensions with Gemini CLI extensions. I want to be able to invoke these extension commands headlessly in automated, non-interactive contexts.

  1. Consider the Gemini CLI extensions in this blog post, /security:analyze and /deploy: https://cloud.google.com/blog/products/ai-machine-learning/automate-app-deployment-and-security-analysis-with-new-gemini-cli-extensions
  2. Assume I have configured these extensions in my gemini installations.
  3. Run `gemini -p "/security:analyze Analyze the .jar files in the artifacts/ directory"

I'm happy to implement this or expand on this (I work in Google Cloud as well, happy to chat about a practical use case).

Why is this needed?

This adds another access point for Gemini CLI extensions, allowing them to be leveraged in non-interactive, automated contexts (think CICD workflows, particularly ones that are not necessarily Github-native, or locally scripted workflows).

Additional context

No response

codrienne avatar Sep 29 '25 18:09 codrienne

This should have been addressed in https://github.com/google-gemini/gemini-cli/issues/5435 - cc @capachino

jerop avatar Sep 29 '25 18:09 jerop

Hi @codrienne

#5435 fixes this for custom slash commands and has reached preview and nightly.

However, it does not yet support MCP prompts, which will likely be a problem as many of our extensions are shipping with those.

I don't think that will be too difficult to add, but let me take a quick look.

capachino avatar Sep 29 '25 18:09 capachino

Thanks!

codrienne avatar Sep 29 '25 18:09 codrienne

Thanks @capachino 🙏🏾

jerop avatar Sep 29 '25 19:09 jerop

#10194 is ready for review

capachino avatar Sep 29 '25 22:09 capachino

What's the general timeline/SLO for PRs to get reviewed? @capachino

codrienne avatar Oct 07 '25 23:10 codrienne

Checking in again @capachino

codrienne avatar Oct 21 '25 17:10 codrienne

Hi @codrienne the fix has landed in nightly and preview. Feel free to give it a try, and let us know if you run into any issues.

capachino avatar Oct 24 '25 01:10 capachino