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

Aperta
#241 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
28/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
gcp, go, google-cloud

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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)
Lingua principale
Go
Stelle
3k
Fork
219
Merge medio
2g 2h
PR unite (30g)
66

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di google-gemini/gemini-api-cli

Tutte le issue di google-gemini/gemini-api-cli

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.