Skip to content

Add Gemini-CLI provider #6043

@fridaystreet

Description

@fridaystreet

What specific problem does this solve?

Roo-code does not currently support using the gemini-cli as the provider. Gemini Code Assist currently provides a massive amount of free gemini pro with the first paid tier expanding this for a small fee per month. Code Assist uses the gemini cli under the hood.

By integrating the gemini-cli as a provider this will allow anyone to take advantage of the free gemini-pro access currently available

Additional context (optional)

No response

Roo Code Task Links (Optional)

No response

Request checklist

  • I've searched existing Issues and Discussions for duplicates
  • This describes a specific problem with clear impact and context

Interested in implementing this?

  • Yes, I'd like to help implement this feature

Implementation requirements

  • I understand this needs approval before implementation begins

How should this be solved? (REQUIRED if contributing, optional otherwise)

A new provider gemini-cli would be made available. The reason for a separate provider is that it does have quite a different approach than the normal genai api. It also has some extra features. While this could all be rolled into the current gemini provider, I feel like it would probably just over complicate that configuration screen.

  • Users will select the cli provider the same as any other provider.
  • Things like debug mode, ide mode and acp mode would all be advanced configuration options
  • It would use it's own internal telemetry collector to hook into the token usage from the cli in order to report this to roo-code
  • By using the cli provider, when the user sends their first message, this would invoke the oauth browser authentication flow (if they are not already authenticated). This is due to change soon and google are allowing authentication on the command line (somehow)
  • There would be an option to add the project id for users who have standard or business paid accounts

How will we know it works? (Acceptance Criteria - REQUIRED if contributing, optional otherwise)

When I go to the providers configuration, they can select gemini cli as a provider.
I can configure it accordningly
When I send my first message it will popup the google authentication in my browser
when I send a subsequent message it will just send the message
I will be able to see the token usage increasing

Technical considerations (REQUIRED if contributing, optional otherwise)

Create a new provider
Create a supplementary telemetry collector that the provider will invoke and use request id's to isolate stats
Add a new provider configuration page
Add the gemini cli provider to the list of available providers

I have already implemented this as I needed it for myself. Yes I realise you're not supposed to, but I built this for myself and my collegues first and forermost so for us it was going to happen anyway. I'm offering to provide it back to the community if the community wants it.

Trade-offs and risks (REQUIRED if contributing, optional otherwise)

The gemini-cli may change and it would need to be kept up to date, guess no more of a risk than any other provider.

Not sure what alternative approach there is, this is the only one I could come up with. Happy to hear others

It's a new provider, so it isn't really changing anything apart from the list of providers, the rest is fairly self contained. It is built as a separate provider so as not to cause any impact on the existing gemini genai provider.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue/PR - TriageNew issue. Needs quick review to confirm validity and assign labels.enhancementNew feature or requestproposal

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions