⚡ gws (Google Workspace CLI):一个命令管理 Google 全家桶,26k Stars 的官方 CLI 给 AI Agent 装上办公超能力
OpenAI 出过 Codex CLI,Google 出过 Gemini CLI,但 Google 最近端出了一盘更大的菜——gws(全称 @googleworkspace/cli)。26k Stars,Rust 写的,一个二进制文件就能操作 Drive、Gmail、Calendar、Sheets、Chat 等所有 Workspace 服务。
最骚的是:它不内置任何命令列表。gws 在运行时读取 Google 的 Discovery Service,动态生成整个命令树。Google 后端加了新 API,你什么都不用做,gws 自动就有那个命令。
安装
# npm 全局装(自动下载对应平台二进制)
npm install -g @googleworkspace/cli
# 或者 Homebrew(macOS / Linux)
brew install googleworkspace-cli
# 或者 Rust 编译
cargo install --git https://github.com/googleworkspace/cli --locked
装完跑 gws --help,你会看到所有可用资源——Drive、Gmail、Calendar、Sheets、Chat、Docs……全列出来了。
快速上手
# 认证(首次)
gws auth setup # 交互式配置 Google Cloud 项目
gws auth login # OAuth 登录
# 列文件
gws drive files list --params '{"pageSize": 10}'
# 建个表格
gws sheets spreadsheets create --json '{"properties": {"title": "Q1 Budget"}}'
# 发个 Chat 消息(带 --dry-run 预览)
gws chat spaces messages create \
--params '{"parent": "spaces/xyz"}' \
--json '{"text": "部署完成。"}' \
--dry-run
# 查看任意 API 的请求/响应结构
gws schema drive.files.list
为什么 AI Agent 需要它
每个 AI Agent 框架(Claude Code、OpenClaw、Hermes Agent)都在努力让 LLM 调用外部工具。但传统方式太痛苦了:
- 你要先读 Google API 文档
- 手写 OAuth 流程
- 拼 JSON 请求体
- 处理分页
gws 把这四步压缩成一行命令:
- 输出永远是结构化 JSON,LLM 直接消费
- 内置 --dry-run,Agent 可以先预览再执行
- --page-all 自动翻页,输出 NDJSON 流
# AI Agent 一条命令拉完所有文件
gws drive files list --params '{"pageSize": 100}' --page-all | jq -r '.files[].name'
# 或者让 gws schema 告诉 LLM 参数格式
gws schema calendar.events.insert
内置 40+ Agent Skills
gws 直接附带了针对主流 Agent 框架的 skill 文件。装完 gws,去 ~/.config/gws/skills/ 下面看——给 Claude Code、OpenClaw、Cline 的适配器都有了。不用自己写 MCP 服务器,不用配 tooluse 格式,复制粘贴就能用。
一句话总结
Google 给 AI Agent 开发者送了一把瑞士军刀——装上 gws,你的 Agent 就能像人一样操作 Google 全家桶了。
⚡ gws (Google Workspace CLI): 26k Stars, One CLI to Rule All Google Workspace — Built for AI Agents
Google has shipped Codex CLI, Gemini CLI, and now gws — the @googleworkspace/cli at 26k stars. Written in Rust, it's a single binary that drives Drive, Gmail, Calendar, Sheets, Chat, and every Workspace API.
The killer feature: gws has zero built-in commands. It reads Google's Discovery Service at runtime and dynamically builds its entire command tree. When Google adds a new API endpoint, gws picks it up automatically — no update needed.
Install
npm install -g @googleworkspace/cli
# or
brew install googleworkspace-cli
# or
cargo install --git https://github.com/googleworkspace/cli --locked
Quick Start
gws auth setup
gws drive files list --params '{"pageSize": 10}'
gws sheets spreadsheets create --json '{"properties": {"title": "Q1 Budget"}}'
gws chat spaces messages create --params '{"parent": "spaces/xyz"}' --json '{"text": "Deploy complete."}' --dry-run
gws schema drive.files.list
Every output is structured JSON — LLMs consume it directly. Built-in --dry-run lets agents preview before executing. --page-all streams paginated results as NDJSON.
Why AI Agents Love It
No more hand-rolled REST calls. No more OAuth boilerplate. gws ships with 40+ agent skill files for Claude Code, OpenClaw, Cline, and more — check ~/.config/gws/skills/ after install.
Zero config, structured output, auto-pagination. Your Agent just works.