Files
nexus/wiki/concepts/Google-Workspace-CLI.md

32 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
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