feat: add Gemini CLI auth login support#305
Conversation
Add Gemini (Google AI) as a supported provider for CLI authentication. Users can now store their Gemini API key via: picoclaw auth login --provider gemini The key is stored securely in ~/.picoclaw/auth.json and loaded automatically when the provider is set to gemini with auth_method=token. Changes: - pkg/auth/token.go: add Gemini display name (aistudio.google.com/apikey) - cmd/picoclaw/main.go: wire Gemini into login/logout/help commands - pkg/providers/http_provider.go: load Gemini API key from auth store when auth_method is 'token' (both explicit provider and model-name fallback detection) Closes sipeed#267
|
@Zepan Adds Gemini CLI auth login support — allows using Google's device auth flow for Gemini access without an API key. Recommendation: Merge. +38/-8, lowers the barrier to using Gemini. Aligns with PicoClaw's goal of being accessible on minimal hardware with minimal setup. |
nikolasdehor
left a comment
There was a problem hiding this comment.
Well-structured change that follows existing patterns for OpenAI and Anthropic auth. The CLI integration is complete (login, logout, help, status) and the provider loading correctly checks both APIKey and AuthMethod.
Like PR #333, this needs a rebase against current main because http_provider.go's CreateProvider() has been refactored into factory.go. The auth credential loading logic needs to be ported to the new factory pattern.
The providerDisplayName returning "aistudio.google.com/apikey" is a nice touch for guiding users. Once rebased, LGTM.
Summary
Adds Gemini (Google AI) as a supported provider for CLI authentication, enabling users to securely store and use their Gemini API key.
Usage
The API key is stored securely in
~/.picoclaw/auth.jsonand loaded automatically when the provider is configured withauth_method: "token".Changes
pkg/auth/token.goaistudio.google.com/apikey)cmd/picoclaw/main.gopkg/providers/http_provider.goauth_methodistoken(both explicit provider and model-name fallback)How it works
picoclaw auth login --provider gemini~/.picoclaw/auth.jsonauth_method: "token"Backward Compatible
api_keyin config continues to work (takes priority)Closes #267