npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-gemini-auth

v1.3.8

Published

![License](https://img.shields.io/npm/l/opencode-gemini-auth) ![Version](https://img.shields.io/npm/v/opencode-gemini-auth)

Readme

Gemini OAuth Plugin for Opencode

License Version

Authenticate the Opencode CLI with your Google account. This plugin enables you to use your existing Gemini plan and quotas (including the free tier) directly within Opencode, bypassing separate API billing.

Prerequisites

  • Opencode CLI installed.
  • A Google account with access to Gemini.

Installation

Add the plugin to your Opencode configuration file (~/.config/opencode/opencode.json or similar):

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-gemini-auth@latest"]
}

Usage

  1. Login: Run the authentication command in your terminal:

    opencode auth login
  2. Select Provider: Choose Google from the list.

  3. Authenticate: Select OAuth with Google (Gemini CLI).

    • A browser window will open for you to approve the access.
    • The plugin spins up a temporary local server to capture the callback.
    • If the local server fails (e.g., port in use or headless environment), you can manually paste the callback URL or just the authorization code.

Once authenticated, Opencode will use your Google account for Gemini requests.

Configuration

Google Cloud Project

By default, the plugin attempts to provision or find a suitable Google Cloud project. To force a specific project, set the projectId in your configuration:

{
  "provider": {
    "google": {
      "options": {
        "projectId": "your-specific-project-id"
      }
    }
  }
}

Model list

Below are example model entries you can add under provider.google.models in your Opencode config. Each model can include an options.thinkingConfig block to enable "thinking" features.

{
  "provider": {
    "google": {
      "models": {
        "gemini-2.5-flash": {
          "options": {
            "thinkingConfig": {
              "thinkingBudget": 8192,
              "includeThoughts": true
            }
          }
        },
        "gemini-2.5-pro": {
          "options": {
            "thinkingConfig": {
              "thinkingBudget": 8192,
              "includeThoughts": true
            }
          }
        },
        "gemini-3-flash-preview": {
          "options": {
            "thinkingConfig": {
              "thinkingLevel": "high",
              "includeThoughts": true
            }
          }
        },
        "gemini-3-pro-preview": {
          "options": {
            "thinkingConfig": {
              "thinkingLevel": "high",
              "includeThoughts": true
            }
          }
        }
      }
    }
  }
}

Note: Available model names and previews may change—check Google's documentation or the Gemini product page for the current model identifiers.

Thinking Models

The plugin supports configuring Gemini "thinking" features per-model via thinkingConfig. The available fields depend on the model family:

  • For Gemini 3 models: use thinkingLevel with values "low" or "high".
  • For Gemini 2.5 models: use thinkingBudget (token count).
  • includeThoughts (boolean) controls whether the model emits internal thoughts.

A combined example showing both model types:

{
  "provider": {
    "google": {
      "models": {
        "gemini-3-pro-preview": {
          "options": {
            "thinkingConfig": {
              "thinkingLevel": "high",
              "includeThoughts": true
            }
          }
        },
        "gemini-2.5-flash": {
          "options": {
            "thinkingConfig": {
              "thinkingBudget": 8192,
              "includeThoughts": true
            }
          }
        }
      }
    }
  }
}

If you don't set a thinkingConfig for a model, the plugin will use default behavior for that model.

Troubleshooting

Manual Google Cloud Setup

If automatic provisioning fails, you may need to set up the project manually:

  1. Go to the Google Cloud Console.
  2. Create or select a project.
  3. Enable the Gemini for Google Cloud API (cloudaicompanion.googleapis.com).
  4. Configure the projectId in your Opencode config as shown above.

Debugging

To view detailed logs of Gemini requests and responses, set the OPENCODE_GEMINI_DEBUG environment variable:

OPENCODE_GEMINI_DEBUG=1 opencode

This will generate gemini-debug-<timestamp>.log files in your working directory containing sanitized request/response details.

Updating

Opencode does not automatically update plugins. To update to the latest version, you must clear the cached plugin:

# Clear the specific plugin cache
rm -rf ~/.cache/opencode/node_modules/opencode-gemini-auth

# Run Opencode to trigger a fresh install
opencode

Development

To develop on this plugin locally:

  1. Clone:

    git clone https://github.com/jenslys/opencode-gemini-auth.git
    cd opencode-gemini-auth
    bun install
  2. Link: Update your Opencode config to point to your local directory using a file:// URL:

    {
      "plugin": ["file:///absolute/path/to/opencode-gemini-auth"]
    }

License

MIT