Support Gemini oauth
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
Gemini CLI supports ACP with the --experimental-acp flag. Can we support 'Gemini-cli' as a backend?
ECA doesn't support ACP, would be pretty hard to follow a different protocol than ECA's one.
But we could try to support gemini backend like we did for anthropic and openai, but I'd like to know what you gain from gemini-cli that we cannot achieve via current supported openai-chat. @zikajk may know more about it
Hi @ericdallo. Thanks for the quick response. It might be a special case for me. I can only use login-based auth with Gemini-cli at my company. I can't use Gemini with API key or other model.
@daehyeok I see, maybe we can use the sub (not sure if that works in other tools), or maybe manage via gemini-cli if that's really possible. I know @lukaszkorecki did something like that in ECA in the past but I bet this is updated now
Yeah, I think it is better to use some existing proxy solution to be honest. It is hard to maintain things like this. I was surprised that OpenCode plugin system support stuff like this https://github.com/NoeFabris/opencode-antigravity-auth/tree/main/src.
@daehyeok Would this work for you? https://github.com/router-for-me/CLIProxyAPI
I like that idea @zikajk make things easier to maintain I guess, would love to support something like that in ECA
It's all a bit hazy, but I was able to make ECA work with Gemini + Vertex by delegating access token creation to gcloud CLI. It worked out of the box and supported browser auth too.
@lukaszkorecki yeah that's great, it's exactly what we do for anthropic and openai and github-copilot, but reyling on their apis, I believe it's pretty ok to rely on a CLI if it'd be only for the login, the rest is part of ECA, WDYAllT?
@ericdallo yes exactly, looks like I kept my fork around - you can see how Vertex auth + gcloud CLI was implemented here: https://github.com/editor-code-assistant/eca/compare/master...lukaszkorecki:eca:gemini-support
Yeah that looks like a really good start, one thing I wonder though is what we lose when using google models via openai-chat like today vs this oauth integration, is it just the auth/sub?
as far as I remember this doesn't force you to use any particular API (openai-style or Gemini's own) - it's just that Vertex' endpoints need to be constructed dynamically because they're scoped to the Google Cloud project you're authenticating against using ADC (application default credentials) and gcloud CLI - that's why project ID is one of required parameters
Got it, that should help not need to integrate with any new API, just solve the auth issue