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

Đang mở
#241 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
28/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
gcp, go, google-cloud
Lĩnh vực
authentication, cli, cloud

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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)
Ngôn ngữ chính
Go
Star
3k
Fork
219
Merge trung bình
2 ngày 2 giờ
Pull request đã merge (30 ngày)
66

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của google-gemini/gemini-api-cli

Tất cả issue của google-gemini/gemini-api-cli

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.