google-slides

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Google Slides

Google Slides

Lightweight Google Slides integration with standalone OAuth authentication. No MCP server required. Full read/write access.
Requires Google Workspace account. Personal Gmail accounts are not supported.
轻量级Google Slides集成,支持独立OAuth认证,无需MCP服务器,具备完整的读写权限。
需要Google Workspace账户。个人Gmail账户不支持。

First-Time Setup

首次设置

Authenticate with Google (opens browser):
bash
python scripts/auth.py login
Check authentication status:
bash
python scripts/auth.py status
Logout when needed:
bash
python scripts/auth.py logout
通过Google完成认证(将打开浏览器):
bash
python scripts/auth.py login
检查认证状态:
bash
python scripts/auth.py status
需要时退出登录:
bash
python scripts/auth.py logout

Read Commands

读取命令

All operations via
scripts/slides.py
. Auto-authenticates on first use if not logged in.
bash
undefined
所有操作通过
scripts/slides.py
执行。如果未登录,首次使用时会自动完成认证。
bash
undefined

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"
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
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)

获取演示文稿元数据(标题、幻灯片数量、幻灯片对象ID)

python scripts/slides.py get-metadata "1abc123xyz789"
undefined
python scripts/slides.py get-metadata "1abc123xyz789"
undefined

Write Commands

写入命令

bash
undefined
bash
undefined

Create a new empty presentation

创建新的空白演示文稿

python scripts/slides.py create "Q4 Sales Report"
python scripts/slides.py create "Q4 Sales Report"

Add a blank slide to the end

在末尾添加一张空白幻灯片

python scripts/slides.py add-slide "1abc123xyz789"
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
python scripts/slides.py add-slide "1abc123xyz789" --layout TITLE_AND_BODY

Add a slide at a specific position (0-based index)

在指定位置添加幻灯片(从0开始的索引)

python scripts/slides.py add-slide "1abc123xyz789" --layout TITLE --at 0
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
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)

通过对象ID删除幻灯片(使用get-metadata命令查找ID)

python scripts/slides.py delete-slide "1abc123xyz789" "g123abc456"
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"}}]'
undefined
python scripts/slides.py batch-update "1abc123xyz789" '[{"replaceAllText":{"containsText":{"text":"foo"},"replaceText":"bar"}}]'
undefined

Slide Layouts

幻灯片布局

Available layouts for
add-slide --layout
:
  • BLANK
    - Empty slide (default)
  • TITLE
    - Title slide
  • TITLE_AND_BODY
    - Title with body text
  • TITLE_AND_TWO_COLUMNS
    - Title with two text columns
  • TITLE_ONLY
    - Title bar only
  • SECTION_HEADER
    - Section divider
  • ONE_COLUMN_TEXT
    - Single column text
  • MAIN_POINT
    - Main point highlight
  • BIG_NUMBER
    - Large number display
add-slide --layout
支持的布局选项:
  • BLANK
    - 空白幻灯片(默认)
  • TITLE
    - 标题幻灯片
  • TITLE_AND_BODY
    - 标题加正文
  • TITLE_AND_TWO_COLUMNS
    - 标题加两栏文本
  • TITLE_ONLY
    - 仅标题栏
  • SECTION_HEADER
    - 节标题
  • ONE_COLUMN_TEXT
    - 单栏文本
  • MAIN_POINT
    - 重点突出
  • BIG_NUMBER
    - 大数字展示

Presentation ID Format

演示文稿ID格式

You can use either:
  • Direct presentation ID:
    1abc123xyz789
  • Full Google Slides URL:
    https://docs.google.com/presentation/d/1abc123xyz789/edit
The scripts automatically extract the ID from URLs.
你可以使用以下两种格式:
  • 直接演示文稿ID:
    1abc123xyz789
  • 完整的Google Slides链接:
    https://docs.google.com/presentation/d/1abc123xyz789/edit
脚本会自动从链接中提取ID。

Output Format

输出格式

get-text

get-text

Returns extracted text from all slides, including:
  • Presentation title
  • Text from shapes/text boxes on each slide
  • Table data with cell contents
返回从所有幻灯片中提取的文本,包括:
  • 演示文稿标题
  • 每张幻灯片上形状/文本框中的文本
  • 表格数据及单元格内容

find

find

Returns list of matching presentations:
json
{
  "presentations": [
    {"id": "1abc...", "name": "Q4 Report", "modifiedTime": "2024-01-15T..."}
  ],
  "nextPageToken": "..."
}
返回匹配的演示文稿列表:
json
{
  "presentations": [
    {"id": "1abc...", "name": "Q4 Report", "modifiedTime": "2024-01-15T..."}
  ],
  "nextPageToken": "..."
}

get-metadata

get-metadata

Returns presentation details:
json
{
  "presentationId": "1abc...",
  "title": "My Presentation",
  "slideCount": 15,
  "pageSize": {"width": {...}, "height": {...}},
  "hasMasters": true,
  "hasLayouts": true
}
返回演示文稿详情:
json
{
  "presentationId": "1abc...",
  "title": "My Presentation",
  "slideCount": 15,
  "pageSize": {"width": {...}, "height": {...}},
  "hasMasters": true,
  "hasLayouts": true
}

Token Management

令牌管理

Tokens stored securely using the system keyring:
  • macOS: Keychain
  • Windows: Windows Credential Locker
  • Linux: Secret Service API (GNOME Keyring, KDE Wallet, etc.)
Service name:
google-slides-skill-oauth
Automatically refreshes expired tokens using Google's cloud function.
令牌通过系统密钥环安全存储:
  • macOS:Keychain
  • Windows:Windows凭据管理器
  • Linux:Secret Service API(GNOME Keyring、KDE Wallet等)
服务名称:
google-slides-skill-oauth
会通过Google云函数自动刷新过期令牌。