<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>gws on </title>
    <link>/tags/gws/</link>
    <description>Recent content in gws on </description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Thu, 23 Apr 2026 17:45:00 +0800</lastBuildDate><atom:link href="/tags/gws/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>用 gws 给 Python 脚本提供 Google OAuth 凭据时的一些注意点</title>
      <link>/posts/gws-auth-export-pitfalls/</link>
      <pubDate>Thu, 23 Apr 2026 17:45:00 +0800</pubDate>
      
      <guid>/posts/gws-auth-export-pitfalls/</guid>
      <description>背景与动机 gws 是一个面向 Google Workspace API 的命令行工具。它的定位很直接：用一套统一的 CLI 去访问 Drive、Gmail、Calendar、Sheets、Docs、Chat 等 API，并且直接输出结构化 JSON。按项目 README 的说法，它是 “built for humans and AI agents”，命令面还是根据 Google 的 Discovery Service 动态生成的。
这里有个事实要先说清楚：它不是 Google 官方正式支持的产品。README 明确写了 “This is not an officially supported Google product.” 所以更准确的说法不是“Google 正式推出了一个新 OAuth 工具”，而是 Google Workspace 生态里出现了一个很实用的开源 CLI，它试图把大量样板代码和认证细节集中到一个工具里。
跟传统的 Google OAuth 接法相比，gws 的好处主要在工程层面。按 Google 官方的 OAuth 2.0 文档 和 Desktop App 流程，自己接一次用户授权通常要处理 OAuth client、浏览器跳转、回调、refresh token 持久化、scope 管理，以及后续 token 刷新。对一个只是想操作 Google Calendar 的脚本或 skill 来说，这些步骤并不复杂，但很分散，也很容易把注意力从“我要调用哪个 Calendar API”转移到“我又把 OAuth 配错在哪里”。</description>
    </item>
    
  </channel>
</rss>
