--- title: "gog CLI" type: entity tags: [cli, google-workspace, macos, automation] last_updated: 2026-04-15 --- ## 基本信息 - **类型**: 命令行工具 - **平台**: macOS - **安装**: `brew install steipete/tap/gogcli` - **路径**: /opt/homebrew/bin/gog - **功能**: 管理 Gmail/Google Calendar/Google Drive/Google Contacts/Google Docs/Google Sheets - **官网**: https://gogcli.sh ## 核心功能 | 服务 | 功能 | |------|------| | Gmail | 搜索、发送、创建草稿、发送草稿 | | Calendar | 查看/创建事件、查看颜色 | | Drive | 搜索文件 | | Contacts | 列出联系人 | | Docs | 导出文档、查看内容 | | Sheets | 获取/更新数据 | ## 认证配置 1. Google Cloud Console 创建 OAuth 客户端 ID(桌面应用) 2. 下载 credentials.json 移动到 ~/Library/Application\ Support/gogcli/ 3. 添加测试用户(ishenwei@gmail.com)绕过验证限制 4. 执行 `gog auth add ishenwei@gmail.com --services gmail,calendar,drive,contacts,docs,sheets` ## 常见错误 - 403 accessNotConfigured:Google Cloud 项目未启用对应 API - 解决:Google Cloud Console → APIs & Services → Library → 启用对应 API → 重新授权 ## 关联 - [[Google Calendar]]:gog CLI 的核心服务之一 - [[Gmail]]:gog CLI 的核心服务之一 - [[Google Workspace CLI]]:gog CLI 属于此类工具 ## Aliases - gogcli - gog - steipete/gogcli