Slide 1

Slide 1 text

お前も Gemini CLI extensions を作らないか? クラウドネイティブ × Gemini CLI 株式会社スリーシェイク 佐藤慧太 Copyright © 3-shake, Inc. All Rights Reserved.

Slide 2

Slide 2 text

自己紹介 佐藤 慧太@SatohJohn ● 2023/1 株式会社スリーシェイク入社 ● Google Cloud Partner Top Engineer ’24、’25 選出 ● お客様の労苦 を減らす ● 娘のお世話を精一杯やっています

Slide 3

Slide 3 text

目次 1. Gemini CLI の Extensions の機能のまとめ 2. Extensions の作り方 3. こういうことに使えるかもの紹介

Slide 4

Slide 4 text

Gemini CLI の Extensions 01 Copyright © 3-shake, Inc. All Rights Reserved.

Slide 5

Slide 5 text

extensions https://geminicli.com/docs/extensions/

Slide 6

Slide 6 text

extensions https://geminicli.com/extensions/ https://github.com/gemini-cli-extensions

Slide 7

Slide 7 text

作りかた 02 Copyright © 3-shake, Inc. All Rights Reserved.

Slide 8

Slide 8 text

gemini extensions new {extension名} {template} https://geminicli.com/docs/extensions/getting-started-extensions/ ※バージョン 0.9で試しています

Slide 9

Slide 9 text

gemini extensions link . ※バージョン 0.9で試しています

Slide 10

Slide 10 text

# My First Extension Instructions You are an expert developer assistant. When the user asks you to fetch posts, use the `fetch_posts` tool. Be concise in your responses. ※バージョン 0.9で試しています

Slide 11

Slide 11 text

gemini extensions uninstall {gemini-extension.jsonのname} ※バージョン 0.9で試しています

Slide 12

Slide 12 text

Template の種類 https://github.com/google-gemini/gemini-cli/tree/main/packages/cli/src/commands/extensions/examples

Slide 13

Slide 13 text

mcp-server

Slide 14

Slide 14 text

mcp-server { "name": "mcp-server-example", "version": "1.0.0", "mcpServers": { "nodeServer": { "command": "node", "args": ["${extensionPath}${/}dist${/}example.js"], "cwd": "${extensionPath}" } } } インストールされる extension の名前 インストールされる tool 類 複数登録可能

Slide 15

Slide 15 text

npm run build gemini extensions link . ※バージョン 0.9で試しています

Slide 16

Slide 16 text

Github へ push しているやつ gemini extensions link https://github.com/{レポジト リ} ※バージョン 0.9で試しています バージョン の更新の検知までしてくれる

Slide 17

Slide 17 text

使い方 03 Copyright © 3-shake, Inc. All Rights Reserved.

Slide 18

Slide 18 text

利用用途 特定の Kubernetes への作業を実施する(縛る) ● gcloud mcp tool と組み合わせる ● namespace の固定 ● 既存 MCP にある使わない設定 ○ exclude tool でも同じようなことはできる 特定のAPI に対してラップして利用、検証する ● MCP 対応したくない、できない系のパターン ● 認証周りとかのコード自体を埋め込む形 https://github.com/gemini-cli-extensions/gcloud

Slide 19

Slide 19 text

利用用途 server.registerTool( 'weather-fetcher', { description: 'Fetches weather information from a public API.' }, async () => { const appId = "client-id" const apiResponse = await fetch( `https://map.yahooapis.jp/weather/V1/place?appid=${appId}&coordinates=139.6500,35.6764&output=json`,{ method: "GET", } ); const data = await apiResponse.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; }, );

Slide 20

Slide 20 text

まとめ 04 Copyright © 3-shake, Inc. All Rights Reserved.

Slide 21

Slide 21 text

まとめ