eca icon indicating copy to clipboard operation
eca copied to clipboard

Support Gemini oauth

Open daehyeok opened this issue 10 months ago • 11 comments

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?

daehyeok avatar Jan 26 '26 19:01 daehyeok

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

ericdallo avatar Jan 26 '26 19:01 ericdallo

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 avatar Jan 26 '26 19:01 daehyeok

@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

ericdallo avatar Jan 26 '26 20:01 ericdallo

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

zikajk avatar Jan 27 '26 07:01 zikajk

I like that idea @zikajk make things easier to maintain I guess, would love to support something like that in ECA

ericdallo avatar Jan 27 '26 12:01 ericdallo

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 avatar Jan 27 '26 16:01 lukaszkorecki

@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 avatar Jan 27 '26 17:01 ericdallo

@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

lukaszkorecki avatar Jan 27 '26 19:01 lukaszkorecki

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?

ericdallo avatar Jan 29 '26 15:01 ericdallo

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

lukaszkorecki avatar Jan 29 '26 15:01 lukaszkorecki

Got it, that should help not need to integrate with any new API, just solve the auth issue

ericdallo avatar Jan 29 '26 16:01 ericdallo