rait-09_obsidian-agent-client/docs/agent-setup/gemini-cli.md
Tykis b68b5339d1 docs: update path configuration guidance for bare command names
Reflect that path configuration is now optional in most cases.
Add Auto-detect as a recommended first step when agents are not found.
Add multi-device vault sync section to troubleshooting.
2026-03-18 01:34:04 +09:00

2.3 KiB

Gemini CLI Setup

Gemini CLI is Google's AI assistant. You can authenticate using your Google account, an API key, or Vertex AI.

Install and Configure

Open a terminal (Terminal on macOS/Linux, PowerShell on Windows) and run the following commands.

  1. Install Gemini CLI:
npm install -g @google/gemini-cli
  1. Find the installation path:

::: code-group

which gemini
# Example output: /usr/local/bin/gemini
where.exe gemini
# Example output: C:\Users\Username\AppData\Roaming\npm\gemini.cmd

:::

  1. Open Settings → Agent Client. The default command (gemini) works in many cases. If the agent is not found automatically, set the Gemini CLI path to the path found above, or click Auto-detect.

  2. Ensure Arguments contains --experimental-acp (this is set by default).

Authentication

Choose one of the following methods:

Option A: Google Account Login (OAuth)

If you have a Google account and prefer not to use an API key, you can log in directly.

  1. Run Gemini CLI in your terminal and choose "Login with Google":
gemini
  1. Follow the browser authentication flow.

  2. In Settings → Agent Client, leave the API key field empty.

::: tip If you have a Gemini Code Assist License from your organization, add GOOGLE_CLOUD_PROJECT=YOUR_PROJECT_ID in the Environment variables field. :::

Option B: Gemini API Key

If you prefer to use an API key for authentication:

  1. Get your API key from Google AI Studio
  2. Enter the API key in Settings → Agent Client → Gemini CLI → API key

Option C: Vertex AI

If you are using Vertex AI for enterprise workloads:

  1. In Settings → Agent Client → Gemini CLI → Environment variables, add:
GOOGLE_API_KEY=YOUR_API_KEY
GOOGLE_GENAI_USE_VERTEXAI=true
  1. Leave the API key field empty (use Environment variables instead).

::: tip Gemini CLI natively supports ACP, so no additional adapter is required. :::

Verify Setup

  1. Click the robot icon in the ribbon or use the command palette: "Open agent chat"
  2. Switch to Gemini CLI from the agent dropdown in the chat header
  3. Try sending a message to verify the connection

Having issues? See Troubleshooting.