google-slides について
Google Workspace アカウントで利用する、Google Slides の読み取りと編集を行うコマンドラインスキルです。独立した OAuth 認証を使い、MCP サーバーは必要ありません。
主な機能
- 01プレゼンテーションの検索
- 02スライドのテキストと表データの抽出
- 03プレゼンテーションとスライドの作成
- 04プレゼンテーションのメタデータ取得
- 05OAuth 認証の管理
活用シーン
- 01検索語でプレゼンテーションを探す
- 02レビュー用にテキストを抽出する
- 03プレゼンテーションの作成やスライドの追加
- 04スライド数やレイアウト情報の確認
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ sanjay3290/ ai-skills --skill google-slidesインストール後、Claude Code で/google-slidesを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
README.mdrequirements.txtscripts/auth.pyrequirements.txtslides.py詳細
Google Slides
スタンドアロンの OAuth 認証を使用する、軽量な Google Slides 連携機能です。MCP サーバーは不要です。読み取りと書き込みの両方に完全に対応しています。
Google Workspace アカウントが必要です。 個人用 Gmail アカウントには対応していません。
初回セットアップ
Google で認証します(ブラウザーが開きます):
python scripts/auth.py login
認証状態を確認します:
python scripts/auth.py status
必要に応じてログアウトします:
python scripts/auth.py logout
読み取りコマンド
すべての操作には scripts/slides.py を使用します。ログインしていない場合、初回使用時に自動認証されます。
# Get all text content from a presentation
python scripts/slides.py get-text "1abc123xyz789"
python scripts/slides.py get-text "https://docs.google.com/presentation/d/1abc123xyz789/edit"
# Find presentations by search query
python scripts/slides.py find "quarterly report"
python scripts/slides.py find "project proposal" --limit 5
# Get presentation metadata (title, slide count, slide object IDs)
python scripts/slides.py get-metadata "1abc123xyz789"
書き込みコマンド
# Create a new empty presentation
python scripts/slides.py create "Q4 Sales Report"
# Add a blank slide to the end
python scripts/slides.py add-slide "1abc123xyz789"
# Add a slide with a specific layout
python scripts/slides.py add-slide "1abc123xyz789" --layout TITLE_AND_BODY
# Add a slide at a specific position (0-based index)
python scripts/slides.py add-slide "1abc123xyz789" --layout TITLE --at 0
# Find and replace text across all slides
python scripts/slides.py replace-text "1abc123xyz789" "old text" "new text"
python scripts/slides.py replace-text "1abc123xyz789" "Draft" "Final" --match-case
# Delete a slide by object ID (use get-metadata to find IDs)
python scripts/slides.py delete-slide "1abc123xyz789" "g123abc456"
# Batch update (advanced - for formatting, inserting shapes, images, etc.)
python scripts/slides.py batch-update "1abc123xyz789" '[{"replaceAllText":{"containsText":{"text":"foo"},"replaceText":"bar"}}]'
スライドレイアウト
add-slide --layout で使用できるレイアウト:
BLANK- 空のスライド(デフォルト)TITLE- タイトルスライドTITLE_AND_BODY- タイトルと本文TITLE_AND_TWO_COLUMNS- タイトルと2列のテキストTITLE_ONLY- タイトルバーのみSECTION_HEADER- セクション区切りONE_COLUMN_TEXT- 1列のテキストMAIN_POINT- 要点の強調BIG_NUMBER- 大きな数字の表示
プレゼンテーション ID の形式
以下のいずれかを使用できます:
- 直接のプレゼンテーション ID:
1abc123xyz789 - Google Slides の完全な URL:
https://docs.google.com/presentation/d/1abc123xyz789/edit
スクリプトは URL から ID を自動的に抽出します。
出力形式
get-text
すべてのスライドから抽出したテキストを返します。内容は以下のとおりです:
- プレゼンテーションのタイトル
- 各スライドの図形やテキストボックス内のテキスト
- セルの内容を含む表データ
find
一致するプレゼンテーションのリストを返します:
{
"presentations": [
{"id": "1abc...", "name": "Q4 Report", "modifiedTime": "2024-01-15T..."}
],
"nextPageToken": "..."
}
get-metadata
プレゼンテーションの詳細を返します:
{
"presentationId": "1abc...",
"title": "My Presentation",
"slideCount": 15,
"pageSize": {"width": {...}, "height": {...}},
"hasMasters": true,
"hasLayouts": true
}
トークン管理
トークンはシステムのキーリングを使用して安全に保存されます:
- macOS:Keychain
- Windows:Windows Credential Locker
- Linux:Secret Service API(GNOME Keyring、KDE Wallet など)
サービス名:google-slides-skill-oauth
Google のクラウド関数を使用して、期限切れのトークンを自動的に更新します。
コメント
Markdown 対応