TL;DR

Google が公開した、ターミナルで動くオープンソースの AI エージェント。Google 版の Claude Code といえる。

仕組み

npm で入れる。

npm install -g @google/gemini-cli

作成時点では、個人の Google アカウントでログインすれば、Gemini のモデルへのリクエストを 1 分あたり 60 回、1 日あたり 1,000 回まで無料で使えた。

When prompted, sign in with your personal Google account. This will grant you up to 60 model requests per minute and 1,000 model requests per day using Gemini.

主なコマンドは /help で確認できる。

拡張機能

$HOME/.gemini/extensions か <workspace>/.gemini/extensions の下に JSON ファイルを置くと、拡張機能として読み込まれる。JSON には次のフィールドを書ける。

  • name: 拡張機能の名前。一意にする
  • version: 拡張機能のバージョン
  • mcpServers: 使わせたい MCP サーバ。複数指定できる
  • contextFileName: 拡張機能のコンテキストを書いたファイル。指定しなくても、拡張機能のディレクトリに GEMINI.md があれば読み込まれる

If this property is not used but a GEMINI.md file is present in your extension directory, then that file will be loaded.

設定

設定も、拡張機能と同じように JSON ファイルで書く。

自分の理解

終了時に入力と出力のトークン数など、主なコストを確認できるのが良い。

関連

出典