Go to file
Taylor Mullen 1a84d8f674 Test: Add comprehensive tests for useToolScheduler hook
- Introduces a suite of tests for the  hook, covering various scenarios including:
  - Successful tool execution
  - Tool not found errors
  - Errors during
  - Errors during tool execution
  - Tool confirmation (approved and cancelled) - (currently skipped)
  - Live output updates - (currently skipped)
  - Cancellation of tool calls (before execution and during approval) - (currently skipped)
  - Execution of multiple tool calls
  - Preventing scheduling while other calls are running - (currently skipped)
- Includes tests for the  utility function to ensure correct mapping of tool call states to display objects.
- Mocks dependencies like , , and individual  instances.
- Uses fake timers to control asynchronous operations.

Note: Some tests involving complex asynchronous interactions (confirmations, live output, cancellations) are currently skipped due to challenges in reliably testing these scenarios with the current setup. These will be addressed in future work.
2025-05-31 02:55:36 -07:00
.gcp fix(sandbox): add SHORT_SHA to image tag (#604) 2025-05-29 23:43:20 +00:00
.github Fix: Update code coverage reporting for core rename 2025-05-31 01:50:41 -07:00
.vscode Refactor: Generalize VSCode launch configuration for debugging tests 2025-05-31 01:28:21 -07:00
docs Rename server->core (#638) 2025-05-30 18:25:47 -07:00
eslint-rules feat: add custom eslint rule for cross-package imports (#77) 2025-04-21 08:02:11 -07:00
packages Test: Add comprehensive tests for useToolScheduler hook 2025-05-31 02:55:36 -07:00
scripts Fix: Update sandbox build to use new core package name 2025-05-30 22:41:54 -07:00
.gitignore Display git commit info in the /about section. (#567) 2025-05-28 00:04:26 -07:00
.npmrc drop the comment to fix npmrc warning about "always-auth" in most recent version of npm (#276) 2025-05-07 10:33:17 -07:00
.prettierrc.json Run `npm run format` 2025-04-17 15:29:34 -07:00
CONTRIBUTING.md Rename server->core (#638) 2025-05-30 18:25:47 -07:00
Dockerfile Fix: Update sandbox build to use new core package name 2025-05-30 22:41:54 -07:00
GEMINI.md Rename server->core (#638) 2025-05-30 18:25:47 -07:00
LICENSE add LICENSE (#25) 2025-04-18 10:30:07 -07:00
README.md docs: Update README, CONTRIBUTING, and CLI configuration docs (#591) 2025-05-30 12:20:12 -07:00
eslint.config.js Rename server->core (#638) 2025-05-30 18:25:47 -07:00
package-lock.json Rename server->core (#638) 2025-05-30 18:25:47 -07:00
package.json Refactor: Align build scripts with core package rename (#641) 2025-05-30 20:16:35 -07:00
tsconfig.json Fix: Prevent hang in large directories by using BFS for getFolderStru… (#470) 2025-05-22 10:47:21 -07:00

README.md

Gemini CLI

Gemini CLI CI

This repository contains the Gemini CLI tool.

Quickstart

  1. Install Node 18+
  2. Set your API key: export GEMINI_API_KEY="YOUR_API_KEY" (Get an API key)
  • For future sessions you can add this to your shell's configuration file, or use a .env file in your project's hierarchy
  1. Run with: npx https://github.com/google-gemini/gemini-cli#early-access
  2. Enjoy

Examples

Once the CLI is running, you can start interacting with Gemini. Try a simple query:

> How can I build a web app?

Or ask it to perform a task using its tools:

> List files in the current directory.

API Key Setup

The Gemini CLI requires a Gemini API Key. It 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
    • Set the GEMINI_API_KEY environment variable. You can do this temporarily in your current shell session:
      export GEMINI_API_KEY="YOUR_GEMINI_API_KEY"
      
      Or add it to your .env file (in project directory or user home) or shell's configuration file (like ~/.bashrc, ~/.zshrc, or ~/.profile) for persistence:
      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:
      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:
      gcloud auth application-default login
      
    • Set the GOOGLE_CLOUD_PROJECT, GOOGLE_CLOUD_LOCATION, and GOOGLE_GENAI_USE_VERTEXAI environment variables:
      export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
      export GOOGLE_CLOUD_LOCATION="YOUR_PROJECT_LOCATION" # e.g., us-central1
      export GOOGLE_GENAI_USE_VERTEXAI=true
      

Next Steps

Congratulations! You've successfully set up and run the Gemini CLI.