0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【チュートリアル】Gemini CLIを触ってみた

Posted at

はじめに

  • 2025年6月25日に公開されたターミナルで実行できるAIエージェントのGemini CLIを触ったメモを残します。

Gemini CLI: オープンソースのAIエージェント

料金

  • 料金は以下のようになっている。無料でも使用できるけど、知的財産の保護しないので個人利用なら試しても良さそう。

Gemini Code Assist のサービスを比較する

特徴 Standardプラン (無料) Enterpriseプラン ($19/ユーザー/月〜) CLIリクエスト上限/日 ($45/ユーザー/月〜)
CLIリクエスト上限/日 1,000件 1,500件 2,000件
知的財産(IP)保護 なし あり あり
エンタープライズ級のセキュリティ なし あり あり
プライベートコードでのカスタマイズ なし なし あり
他のGoogle Cloudサービスとの連携 なし なし あり

クイックスタート

前提条件

  • Node.jsのバージョン18以降が前提条件みたい(v20.9.0で試し)

スクリーンショット 2025-06-29 12.58.53.png

CLI を実行

npx https://github.com/google-gemini/gemini-cli

スクリーンショット 2025-06-29 13.00.50.png

スクリーンショット 2025-06-29 13.01.46.png

  • グローバルに利用したい場合は以下を実施するみたい
npm install -g @google/gemini-cli
gemini
  • undici@7.11.0パッケージが、nodeのバージョン20.18.1が必要みたいなので、バージョンアップしてインストール。
npm install -g @google/gemini-cli

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'undici@7.11.0',
npm WARN EBADENGINE   required: { node: '>=20.18.1' },
npm WARN EBADENGINE   current: { node: 'v20.9.0', npm: '10.1.0' }
npm WARN EBADENGINE }
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/@google
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@google'
npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@google'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/lib/node_modules/@google'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

  • Enter実行して、ログインを選択

スクリーンショット 2025-06-29 13.04.59.png

スクリーンショット 2025-06-29 13.05.27.png

対話モード (Interactive Mode)

  • この画面が対話モードらしい

スクリーンショット 2025-06-29 13.08.24.png

  • 以下を質問してみた。
    スクリーンショット 2025-06-29 13.19.03.png

  • Goで処理が出力。
    スクリーンショット 2025-06-29 13.19.38.png

  • 処理を終わらせるときは/exitまたは/quitで完了することができる

  • 細かい使い方は以下を参考にした方が良さそう。細かくまとめている

  • Gemini CLI の簡単チュートリアル

まとめ

話題のGemini CLIを触ってみたけど、色々AIエージェントツールあるので、1つに決めるのは難しいけど、色々触りつつ利用していこうかな。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?