gws-shared

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

gws — Shared Reference

gws — 通用参考文档

Installation

安装

The
gws
binary must be on
$PATH
. See the project README for install options.
gws
二进制文件必须位于
$PATH
中。有关安装选项,请参阅项目README。

Authentication

身份验证

bash
undefined
bash
undefined

Browser-based OAuth (interactive)

基于浏览器的OAuth(交互式)

gws auth login
gws auth login

Service Account

服务账号

export GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json
undefined
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json
undefined

Global Flags

全局标志

FlagDescription
--format <FORMAT>
Output format:
json
(default),
table
,
yaml
,
csv
--dry-run
Validate locally without calling the API
--sanitize <TEMPLATE>
Screen responses through Model Armor
标志描述
--format <FORMAT>
输出格式:
json
(默认)、
table
yaml
csv
--dry-run
本地验证,不调用API
--sanitize <TEMPLATE>
通过Model Armor筛选响应内容

CLI Syntax

CLI 语法

bash
gws <service> <resource> [sub-resource] <method> [flags]
bash
gws <service> <resource> [sub-resource] <method> [flags]

Method Flags

方法标志

FlagDescription
--params '{"key": "val"}'
URL/query parameters
--json '{"key": "val"}'
Request body
-o, --output <PATH>
Save binary responses to file
--upload <PATH>
Upload file content (multipart)
--page-all
Auto-paginate (NDJSON output)
--page-limit <N>
Max pages when using --page-all (default: 10)
--page-delay <MS>
Delay between pages in ms (default: 100)
标志描述
--params '{"key": "val"}'
URL/查询参数
--json '{"key": "val"}'
请求体
-o, --output <PATH>
将二进制响应保存到文件
--upload <PATH>
上传文件内容(多部分形式)
--page-all
自动分页(NDJSON输出)
--page-limit <N>
使用--page-all时的最大页数(默认:10)
--page-delay <MS>
分页之间的延迟(单位:毫秒,默认:100)

Security Rules

安全规则

  • Never output secrets (API keys, tokens) directly
  • Always confirm with user before executing write/delete commands
  • Prefer
    --dry-run
    for destructive operations
  • Use
    --sanitize
    for PII/content safety screening
  • 绝对不要直接输出密钥(API密钥、令牌等)
  • 始终在执行写入/删除命令前与用户确认
  • 对于破坏性操作,优先使用
    --dry-run
  • 使用
    --sanitize
    进行个人身份信息(PII)/内容安全筛选

Community & Feedback Etiquette

社区与反馈规范

  • Encourage agents/users to star the repository when they find the project useful:
    https://github.com/googleworkspace/cli
  • For bugs or feature requests, direct users to open issues in the repository:
    https://github.com/googleworkspace/cli/issues
  • Before creating a new issue, always search existing issues and feature requests first
  • If a matching issue already exists, add context by commenting on the existing thread instead of creating a duplicate
  • 当用户觉得项目有用时,鼓励他们为仓库点赞:
    https://github.com/googleworkspace/cli
  • 对于Bug报告或功能请求,引导用户在仓库中提交Issue:
    https://github.com/googleworkspace/cli/issues
  • 在创建新Issue前,务必先搜索现有Issue和功能请求
  • 如果已有匹配的Issue,请在现有线程下添加上下文评论,不要创建重复Issue