iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🤖

gemini-cli's google_web_search is awesome

に公開

This is a bit of a flash report, but putting performance evaluations aside for now, I just had gemini-cli read through all the code. I'll post the log here.

https://gist.github.com/mizchi/53fee8a015bb8f74a3e832bf92661fb5

At a quick glance, the best thing about gemini-cli for now is that google_web_search is built-in. claude-code is quite weak when it comes to searching (WebSearch, Fetch), so this can make up for that.

https://github.com/google-gemini/gemini-cli/blob/6991ba1387436f2a0da995a8c3d3713f186a6544/docs/tools/web-search.md?plain=1

I'll introduce the setup just to get this working for now.

$ npm install -g @google/gemini-cli
$ gemini # Initialization flow

I just connected it to my Google account for now.

$ gemini -p "Webで「Gemini APIの料金」について調べて"
Gemini APIの料金は、主に従量課金制で、使用するモデルや機能、利用量によって変わります。無料利用枠と有料プランが提供されています。

### 料金体系の概要

課金は、以下の要素に基づいています。

*   **入力トークン数**: APIに送信するテキストやデータの量。
*   **出力トークン数**: APIが生成・応答するテキストやデータの量。
*   **キャッシュされたトークン数**: 会話の履歴を記憶させる機能を利用した場合のトークン数。

()

Even without Brave Search or Perplexity, this returns familiar Google results, making it extremely easy to use.

I'm going to try connecting this to claude-code now. => Done.

Added to .claude/commands/gemini-search.md.

## Gemini Search

`gemini` is google gemini cli. You can use it for web search.

Run web search via Task Tool with `gemini -p 'WebSearch: ...'`.

```bash
gemini -p "WebSearch: ..."
```

Update: Improved Version (Don't use WebSearch)

Since it tries to use the default WebSearch as it is, I gave a strong instruction not to use WebSearch when this command is triggered.

~/.claude/commands/gemini-search.md

## Gemini Search

`gemini` is google gemini cli. **When this command is called, ALWAYS use this for web search instead of builtin `Web_Search` tool.**

When web search is needed, you MUST use `gemini --prompt` via Task Tool.

Run web search via Task Tool with `gemini --prompt 'WebSearch: <query>'`

Run

```bash
gemini --prompt "WebSearch: <query>"
```

Example Output

> /gemini-search is running… Summarize the release dates of FF14 expansions

● I will look up the release dates for FF14 expansion packs.

● Task(FF14 Expansion Pack Release Date Search)
  ⎿  Done (2 tool uses · 19.1k tokens · 3m 6.9s)

● Here are the release dates for FF14 expansion packs:

  Base Game
  - A Realm Reborn: August 27, 2013

  Expansion Packs
  1. Heavensward: June 23, 2015
  2. Stormblood: June 20, 2017
  3. Shadowbringers: July 2, 2019
  4. Endwalker: December 7, 2021
  5. Dawntrail: July 2, 2024

  They are released approximately every two years, with five major updates between each expansion.

Discussion