Feature request: Support Vertex AI backend with Application Default Credentials (ADC)

未关闭
#241 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
28/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
gcp, go, google-cloud

调研方向

The request describes a behavior, not a location: start by reading how this Go CLI configures its endpoint base URL and credentials for generativelanguage.googleapis.com, and where the --access-token, --user-project flags and config.yaml are parsed. Then check how a request is dispatched to see where a Vertex aiplatform.googleapis.com base URL and an ADC-backed token source would slot in. Done means a documented env/flag switch that selects Vertex AI with ADC (gcloud, GOOGLE_APPLICATION_CREDENTIALS, metadata server), covered by a test; scope parity with Vertex, which the issue itself flags as uncertain.

由索引模型根据 Issue 内容生成。

描述

Description of the feature request:

Add support for using gemini-api against the Vertex AI backend (aiplatform.googleapis.com) authenticated via Google Cloud Application Default Credentials (ADC), in addition to the current Google AI Studio API key (generativelanguage.googleapis.com) flow.

Aligning with the existing google-genai SDK conventions would provide a familiar developer and CI/CD experience, for example:

  • Opting into the Vertex AI backend via environment variables or flags (e.g., GOOGLE_GENAI_USE_VERTEXAI=true, GOOGLE_CLOUD_PROJECT, GOOGLE_CLOUD_LOCATION, or equivalent gemini-api flags / config.yaml settings).
  • Automatically resolving and refreshing credentials via standard ADC (gcloud auth application-default login, GOOGLE_APPLICATION_CREDENTIALS, or GCE/Cloud Run/GKE metadata servers / Workload Identity), without manually piping gcloud auth application-default print-access-token into --access-token.
What problem are you trying to solve with this feature?

In enterprise and regulated environments, Cloud Audit Logs (and related GCP governance controls such as IAM and VPC Service Controls) provided by Vertex AI are required for auditing and security governance.

Because of this requirement:

  • Issuing and distributing Google AI Studio API keys (GEMINI_API_KEY) is not permitted.
  • Even passing an OAuth token with --access-token and --user-project against generativelanguage.googleapis.com does not satisfy environments that strictly require Vertex AI endpoints and Vertex AI audit logging.

As a result, organizations that depend on Vertex AI audit logging currently cannot adopt gemini-api-cli for coding agents or automation workflows.

Any other information you'd like to share?

I understand that gemini-api-cli is currently generated against the generativelanguage.googleapis.com OpenAPI surface (including the Interactions API, Files API, Environments, etc.), and that Vertex AI has different URL structures and API surface parity.

Even if full feature parity on Vertex AI is not immediately feasible, it would be very helpful to know:

  1. Whether Vertex AI + ADC support is on the roadmap (even incrementally, e.g., starting with core generation/analysis commands).
  2. If not planned in the near term, whether there is a recommended alternative for CLI/agent workflows that require Vertex AI audit logging.
  • CLI version: v0.5.0 (main)
主要语言
Go
星标
3k
派生
219
平均合并
2 天 2 小时
30 天内合并 PR
66

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

google-gemini/gemini-api-cli 的其他 Issue

查看 google-gemini/gemini-api-cli 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。