gws CLI: Shared patterns for authentication, global flags, and output formatting.
a3768d0The gws binary must be on $PATH. See the project README for install options.
# Browser-based OAuth (interactive)
gws auth login
# Service Account
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json
| Flag | Description |
|------|-------------|
| --format <FORMAT> | Output format: json (default), table, yaml, csv |
| --dry-run | Validate locally without calling the API |
| --sanitize <TEMPLATE> | Screen responses through Model Armor |
gws <service> <resource> [sub-resource] <method> [flags]
| Flag | Description |
|------|-------------|
| --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) |
--dry-run for destructive operations--sanitize for PII/content safety screening! expansion: Sheet ranges like Sheet1!A1 contain ! which zsh interprets as history expansion. Use double quotes with escaped inner quotes instead of single quotes:
# WRONG (zsh will mangle the !)
gws sheets +read --spreadsheet ID --range 'Sheet1!A1:D10'
# CORRECT
gws sheets +read --spreadsheet ID --range "Sheet1!A1:D10"
--params and --json values in single quotes so the shell does not interpret the inner double quotes:
gws drive files list --params '{"pageSize": 5}'
https://github.com/googleworkspace/clihttps://github.com/googleworkspace/cli/issuesCopy a source-pinned command for your client. You run it yourself.
Destination: .claude/skills/gws-shared · pinned to the source commit
# Run from your project root
git clone https://github.com/googleworkspace/cli.git .skillboard-tmp
git -C .skillboard-tmp checkout a3768d0e82ad83cca2da97724e46bea4ff0e6dbd
mkdir -p ".claude/skills"
cp -r ".skillboard-tmp/skills/gws-shared" ".claude/skills/"
rm -rf .skillboard-tmpReview the source before running. This copies files into your project; it is not a one-click install and does not verify runtime safety.
sudo apt update && sudo apt install -y gitnpm install -g @anthropic-ai/claude-code# Run from your project root
git clone https://github.com/googleworkspace/cli.git .skillboard-tmp
git -C .skillboard-tmp checkout a3768d0e82ad83cca2da97724e46bea4ff0e6dbd
mkdir -p ".claude/skills"
cp -r ".skillboard-tmp/skills/gws-shared" ".claude/skills/"
rm -rf .skillboard-tmpDestination: .claude/skills/gws-shared
Scanner static-checks@0.1.0 · commit a3768d0e82ad. Static checks cannot prove runtime safety – review the source and the exact diff before installing. How checks work.
No static rules matched. This is not a safety guarantee.