返回顶部
c

civic-googleCivic谷歌

Use gog (Google CLI) without manual OAuth setup — Civic handles token management automatically

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 0.1.1
安全检测
已通过
169
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

civic-google

技能名称: civic-google

详细描述:
该技能描述了 @civic/openclaw-google 插件,它允许智能体使用 gog(Google Workspace CLI),而用户无需创建 Google Cloud 项目、配置 OAuth 凭据或管理令牌。Civic 充当 OAuth 代理——它提供 OAuth 客户端,在服务器端加密存储令牌,自动刷新令牌,并且插件仅请求每个命令实际所需的作用域。

隐私与安全

  • - 发送给 Civic 的内容: 插件通过 HTTPS 将 gog 命令前缀(例如 gog gmail send)发送到 app.civic.com 进行作用域解析。代理仅读取命令前缀以确定所需的 OAuth 作用域——命令参数(电子邮件地址、搜索查询、文件名)不会被代理记录、存储或使用。
  • CIVIC_TOKEN: 这是用户从 app.civic.com 上的 Civic 账户获取的专属 API 密钥。它用于验证用户身份以访问其自己的账户,且绝不会被共享。它作为 Bearer 令牌通过 HTTPS 发送。
  • 令牌处理: OAuth 访问令牌有效期短(约 1 小时),在 Civic 服务器上加密存储(AES-256),并自动刷新。智能体永远不会看到 OAuth 客户端密钥或刷新令牌。
  • 源代码: 该插件在 https://github.com/civicteam/openclaw-google 开源,并以 @civic/openclaw-google 发布在 npm 上。

设置

  1. 1. 安装插件:
bash openclaw plugins install @civic/openclaw-google
  1. 2. 安装 gog(Google CLI):
bash brew install gog
  1. 3. 在网关环境中设置您的 Civic API 令牌:
bash CIVIC_TOKEN=

从 app.civic.com -> 设置 -> API 密钥获取您的令牌。

  1. 4. 重启网关。

工作原理

  1. 1. 智能体调用 gog gmail search newerthan:1d
  2. 插件通过 beforetoolcall 钩子拦截 exec 工具调用
  3. 插件将命令前缀发送到 Civic 代理进行作用域解析
  4. 代理匹配 gog gmail -> gmail.readonly 作用域
  5. 如果已授权:返回一个短期访问令牌,插件设置 GOGACCESS_TOKEN 环境变量,gog 运行
  6. 如果尚未授权:阻止工具调用并显示一个授权 URL 供用户同意
  7. 每个作用域首次同意后,所有后续调用将自动进行

支持的服务和作用域映射

该插件将每个 gog 子命令映射到所需的最窄 OAuth 作用域。写操作获取特定作用域;无法识别的子命令回退到只读。

Gmail

  • - gog gmail send — gmail.send
  • gog gmail draft、gog gmail drafts — gmail.compose
  • gog gmail trash、archive、read、unread、batch — gmail.modify
  • gog gmail(通用)— gmail.readonly

日历

  • - gog calendar create、update、delete、respond、subscribe — calendar.events
  • gog calendar(通用)— calendar.readonly

云端硬盘

  • - gog drive upload、create、update、delete、move、rename、share、copy、import — drive.file
  • gog drive transfer — drive(完全访问,所有权转移必需)
  • gog drive(通用)— drive.readonly

文档

  • - gog docs create、edit、append — documents
  • gog docs copy、delete、import — documents + drive.file
  • gog docs export — documents.readonly + drive.file
  • gog docs(通用)— documents.readonly + drive.readonly

表格

  • - gog sheets write、append、delete、insert、format、merge、freeze、resize — spreadsheets
  • gog sheets create — spreadsheets + drive.file
  • gog sheets(通用)— spreadsheets.readonly + drive.readonly

幻灯片

  • - gog slides create、copy — presentations + drive.file
  • gog slides edit、update、duplicate、delete — presentations
  • gog slides(通用)— presentations.readonly + drive.readonly

任务

  • - gog tasks add、done、delete、move、update — tasks
  • gog tasks(通用)— tasks.readonly

联系人

  • - gog contacts create、update、delete、merge、batch — contacts
  • gog contacts(通用)— contacts.readonly

聊天

  • - gog chat send — chat.messages.create
  • gog chat create — chat.spaces
  • gog chat delete — chat.messages
  • gog chat(通用)— chat.spaces.readonly + chat.messages.readonly

表单

  • - gog forms create、update、delete — forms.body
  • gog forms(通用)— forms.body.readonly + forms.responses.readonly

Apps Script

  • - gog appscript run — script.projects
  • gog appscript deploy — script.deployments
  • gog appscript(通用)— script.projects.readonly + drive.readonly

故障排除

  • - 未配置 CIVICTOKEN — 在网关环境中设置 CIVICTOKEN。从 app.civic.com -> 设置 -> API 密钥获取。
  • 授权 URL 持续出现 — 用户需要点击授权链接并完成 Google 同意屏幕。每个作用域需要单独同意。
  • 之前工作正常后出现令牌错误 — 用户可能在 Google 账户设置中撤销了访问权限。通过触发任意 gog 命令重新授权。

自定义代理 URL

对于本地开发,在网关环境中设置 OPENCLAWPROXYURL:
bash
OPENCLAWPROXYURL=http://localhost:3013/openclaw

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 civic-google-1776186422 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 civic-google-1776186422 技能

通过命令行安装

skillhub install civic-google-1776186422

下载

⬇ 下载 civic-google v0.1.1(免费)

文件大小: 2.69 KB | 发布时间: 2026-4-17 14:21

v0.1.1 最新 2026-4-17 14:21
- Updated documentation to include privacy and security details, clarifying what user data is sent and how tokens are handled.
- Revised plugin description and setup steps for clarity and conciseness.
- Confirmed that all supported gog command scope mappings remain unchanged.
- No code or implementation changes in this release—documentation update only.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部