opencode-gemini-auth  by jenslys

CLI authentication for Google Gemini AI

Created 2 months ago
463 stars

Top 65.4% on SourcePulse

GitHubView on GitHub
Project Summary

A plugin for the Opencode CLI that enables authentication with Google Gemini accounts. It allows users to leverage their existing Gemini plans and quotas, including the free tier, directly within Opencode, avoiding separate API billing and streamlining AI-powered development workflows.

How It Works

This plugin integrates with the Opencode CLI by adding a new authentication provider. It utilizes Google OAuth for user authentication, initiating a browser-based flow. A temporary local server is spun up to capture the OAuth callback, simplifying the authentication process. Users can optionally configure specific Google Cloud projects and fine-tune Gemini model parameters like thinkingLevel, thinkingBudget, and includeThoughts via the Opencode configuration file.

Quick Start & Requirements

  • Installation: Add "opencode-gemini-auth@latest" to your Opencode configuration file (~/.config/opencode/config.json).
  • Prerequisites: Opencode CLI installed, a Google account with access to Gemini.
  • Usage: Run opencode auth login, select Google, and follow the OAuth prompts. A browser window will open for approval.
  • Configuration: Optional projectId and thinkingConfig settings can be added to config.json.
  • Docs: Development setup instructions are available in the repository.

Highlighted Details

  • Leverages existing Google Gemini plans and quotas, including the free tier, for Opencode CLI usage.
  • Supports detailed configuration of Gemini models, including thinkingLevel, thinkingBudget, and includeThoughts.
  • Includes troubleshooting steps for manual Google Cloud project setup and a debug logging mechanism (OPENCODE_GEMINI_DEBUG=1).

Maintenance & Community

The repository is hosted on GitHub (jenslys/opencode-gemini-auth). No specific details regarding maintainers, community channels (like Discord/Slack), or roadmaps are provided in the README.

Licensing & Compatibility

  • License: MIT.
  • Compatibility: The MIT license is permissive, allowing for commercial use and integration into closed-source projects without significant restrictions.

Limitations & Caveats

The temporary local server used for OAuth callbacks may fail in headless environments or if the port is in use, requiring manual copy-pasting of the callback URL. Automatic Google Cloud project provisioning can also fail, necessitating manual setup via the Google Cloud Console. Updating the plugin requires manually clearing its cache.

Health Check
Last Commit

5 days ago

Responsiveness

Inactive

Pull Requests (30d)
3
Issues (30d)
14
Star History
300 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.