diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 53 |
1 files changed, 40 insertions, 13 deletions
@@ -8,19 +8,46 @@ For more comprehensive documentation, please see the [full documentation here](. ## Setup -1. **Get a Gemini API Key:** Obtain your API key from Google AI Studio: [https://aistudio.google.com/app/apikey](https://aistudio.google.com/app/apikey) -2. **Set Environment Variable:** Set the `GEMINI_API_KEY` environment variable to your obtained key. You can do this temporarily in your current shell session: - ```bash - export GEMINI_API_KEY="YOUR_API_KEY" - ``` - Or add it to your shell's configuration file (like `~/.bashrc`, `~/.zshrc`, or `~/.profile`) for persistence: - ```bash - echo 'export GEMINI_API_KEY="YOUR_API_KEY"' >> ~/.bashrc # Or your preferred shell config file - source ~/.bashrc # Reload the config - ``` - Replace `"YOUR_API_KEY"` with your actual key. -3. **Install the Gemini CLI:** - _(Instructions for installing the CLI will be added here once packaging is finalized. For now, if you have access to the source code, you can run it directly after building the project as described below.)_ +The Gemini CLI supports several ways to authenticate with Google's AI services. You'll need to configure **one** of the following methods: + +1. **Gemini API Key:** + + - Obtain your API key from Google AI Studio: [https://aistudio.google.com/app/apikey](https://aistudio.google.com/app/apikey) + - Set the `GEMINI_API_KEY` environment variable. You can do this temporarily in your current shell session: + ```bash + export GEMINI_API_KEY="YOUR_GEMINI_API_KEY" + ``` + Or add it to your shell's configuration file (like `~/.bashrc`, `~/.zshrc`, or `~/.profile`) for persistence: + ```bash + echo 'export GEMINI_API_KEY="YOUR_GEMINI_API_KEY"' >> ~/.bashrc # Or your preferred shell config file + source ~/.bashrc # Reload the config + ``` + Replace `"YOUR_GEMINI_API_KEY"` with your actual key. + +2. **Google API Key (Vertex AI Express Mode):** + + - This key can be a general Google Cloud API key enabled for the Gemini API or Vertex AI. + - Set the `GOOGLE_API_KEY` and `GOOGLE_GENAI_USE_VERTEXAI` environment variables: + ```bash + export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY" + export GOOGLE_GENAI_USE_VERTEXAI=true + ``` + +3. **Vertex AI (Project and Location):** + - Ensure you have a Google Cloud Project and have enabled the Vertex AI API. + - Set up Application Default Credentials (ADC). For more details, refer to the [official Google Cloud ADC documentation](https://cloud.google.com/docs/authentication/provide-credentials-adc): + ```bash + gcloud auth application-default login + ``` + - Set the `GOOGLE_CLOUD_PROJECT`, `GOOGLE_CLOUD_LOCATION`, and `GOOGLE_GENAI_USE_VERTEXAI` environment variables: + ```bash + export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID" + export GOOGLE_CLOUD_LOCATION="YOUR_PROJECT_LOCATION" # e.g., us-central1 + export GOOGLE_GENAI_USE_VERTEXAI=true + ``` + +**Install the Gemini CLI:** +_(Instructions for installing the CLI will be added here once packaging is finalized. For now, if you have access to the source code, you can run it directly after building the project as described elsewhere.)_ ## Building (for contributors) |
