common

Locate and load GEMINI_API_KEY from environment variables and .env files.

Updated Nov 9, 2025
One-click install
npx skills add https://github.com/wollfoo/setup-opencode --skill common
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: common
Source: https://github.com/wollfoo/setup-opencode/tree/main/skills/common
Command: npx skills add https://github.com/wollfoo/setup-opencode --skill common

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill centralizes and streamlines the discovery and loading of GEMINI_API_KEY from multiple sources—environment variables and layered .env files—reducing setup friction and avoiding credential misconfigurations.

Core Features & Use Cases

  • Flexible key discovery: automatically searches environment, project root, .claude, and skill-specific .env locations for GEMINI_API_KEY.
  • Vertex AI and AI Studio readiness: easily switches between Gemini endpoints with a single configuration check.
  • Guided setup and validation: provides actionable error messages and fallback instructions for missing keys.

Quick Start

Import from api_key_helper and retrieve the API key or client: from api_key_helper import get_api_key_or_exit, get_client api_key = get_api_key_or_exit() client = get_client()

Frequently Asked Questions about common

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I load the GEMINI_API_KEY from multiple .env files for local development?

You can switch between Vertex AI and AI Studio endpoints using a single configuration check within the skill. It retrieves the appropriate client via get_client, ensuring proper endpoint routing for Gemini integrations.

What is the best way to securely configure a Gemini API key in a team environment?

The best way to securely configure a Gemini API key in a team environment is using layered .env files. This skill centralizes key discovery across these locations, reducing setup friction and avoiding credential misconfigurations.

Why does my Gemini integration fail with a missing API key error during setup?

Your Gemini integration fails with a missing API key error when GEMINI_API_KEY is absent from all searched locations. The skill provides actionable error messages and guidance for setting up the key via environment variables or .env files.

Can I use environment variables instead of .env files for Gemini authentication?

Yes, you can use environment variables instead of .env files for Gemini authentication. The skill's flexible key discovery automatically searches the environment first before checking project root and skill-specific .env locations.

Do I need a specific configuration to use Vertex AI instead of AI Studio with the Gemini API?

You need a single configuration check to switch between Vertex AI and AI Studio endpoints. The skill handles the endpoint selection automatically when you retrieve the client using the get_client function.