32 lines
1.1 KiB
Markdown
32 lines
1.1 KiB
Markdown
---
|
||
title: "Google Workspace CLI"
|
||
type: concept
|
||
tags: [cli, google-workspace, automation, macos]
|
||
last_updated: 2026-04-15
|
||
---
|
||
|
||
## 定义
|
||
通过命令行界面(CLI)管理 Google Workspace 全部服务(Gmail/Calendar/Drive/Contacts/Docs/Sheets)的工具,支撑脚本化与自动化工作流。
|
||
|
||
## 核心工具
|
||
- [[gog CLI]]:macOS 专属,Homebrew 安装,支持 Gmail/Calendar/Drive/Contacts/Docs/Sheets
|
||
|
||
## 关键机制
|
||
- **OAuth 双层验证**:OAuth 凭证(身份)+ API Enablement(权限)缺一不可
|
||
- **账号级默认设置**:export GOG_ACCOUNT=ishenwei@gmail.com 避免每次指定账号
|
||
- **故障排除关键**:403 accessNotConfigured 的根因是 API 未启用而非 OAuth 问题
|
||
|
||
## 应用场景
|
||
- 邮件自动化(定时搜索/发送/归档)
|
||
- 日历自动化(定时检查日程/创建事件)
|
||
- 文档导出自动化(定时备份 Docs 内容)
|
||
|
||
## 关联
|
||
- [[gog CLI]] 是 Google Workspace CLI 在 macOS 的具体实现
|
||
- [[n8n Workflow自动化]] 可通过 gog CLI 作为节点调用 Google 服务
|
||
|
||
## Aliases
|
||
- Google CLI
|
||
- gog
|
||
|