ClawSkills logoClawSkills

gogcli - Google Workspace CLI

用于管理 Google Workspace 服务的命令行工具,包括 Gmail、Calendar、Drive、Sheets、Docs、Slides、Contacts、Tasks、People、Groups 和 Keep。

介绍

--- name: gogcli description: 用于 Gmail、Calendar、Drive、Sheets、Docs、Slides、Contacts、Tasks、People、Groups、Keep 的 Google Workspace CLI。当用户要求与 Google 服务交互时使用。

# gogcli - Google Workspace CLI

## 概述

gogcli 是一个用于从终端管理 Google Workspace 服务的 CLI 工具。支持 Gmail、Calendar、Drive、Sheets、Docs、Slides、Contacts、Tasks、People、Groups 和 Keep。

## 安装

### 快速安装(如果你有 brew): ```bash brew install steipete/tap/gogcli ```

### 从源代码构建(无 brew): ```bash # 1. Clone repository git clone https://github.com/steipete/gogcli.git

# 2. Navigate to directory cd gogcli

# 3. Build make

# 4. (Optional) Make available globally sudo make install ```

## 首次设置

在使用 gogcli 之前,请设置 OAuth 凭据:

**第一步:获取 OAuth 客户端凭据** 1. 前往 Google Cloud Console APIs & Services 2. 创建项目或使用现有项目 3. 前往 OAuth 同意屏幕 4. 使用以下设置创建 OAuth 2.0 客户端: - Application type(应用类型):"Desktop app" - Name(名称):"gogcli for Clawdbot" - Authorized redirect URIs(已授权的重定向 URI):`http://localhost:8085/callback` 5. 启用你需要的 API 6. 下载 OAuth 客户端凭据 JSON 文件 7. 将其复制到 `~/Downloads/`

**第二步:授权你的账户** ```bash cd gogcli ./bin/gog auth add [email protected] ~/Downloads/client_secret_....json ```

**第三步:验证** ```bash ./bin/gog auth list ./bin/gog gmail search 'is:unread' --max 5 ```

## 常用命令

### Gmail ```bash # Search ./bin/gog gmail search 'query' --max 20

# Send ./bin/gog gmail send '[email protected]' --subject 'Hello' --body 'Message'

# Labels ./bin/gog gmail labels list ```

### Calendar ```bash # List events ./bin/gog calendar events list --max 50

# Create event ./bin/gog calendar events create 'Meeting' --start '2026-01-30T10:00' ```

### Drive ```bash # List files ./bin/gog drive ls --query 'pdf' --max 20

# Upload file ./bin/gog drive upload ~/Documents/file.pdf ```

### Sheets ```bash # List sheets ./bin/gog sheets list

# Export sheet ./bin/gog sheets export <spreadsheet-id> --format pdf ```

### Contacts ```bash ./bin/gog contacts search 'John Doe' ```

### Tasks ```bash # List tasklists ./bin/gog tasks list

# Add task ./bin/gog tasks add --title 'Task' --due '2026-01-30' ```

## 注意事项

- 使用 `--json` 标志进行脚本编写 - 凭据存储在 `~/.config/gog/` 中 - 使用 `gog auth list` 检查身份验证状态

更多产品