# Google Workspace CLI (`gws`) Context The `gws` CLI provides dynamic access to Google Workspace APIs (Drive, Gmail, Calendar, Sheets, Admin, etc.) by parsing Discovery Documents at runtime. ## Rules of Engagement for Agents * **Schema Discovery:** *If you don't know the exact JSON payload structure, run `gws schema .` first to inspect the schema before executing.* * **Context Window Protection:** *Workspace APIs (like Drive and Gmail) return massive JSON blobs. ALWAYS use field masks when listing or getting resources by appending `--params '{"fields": "id,name"}'` to avoid overwhelming your context window.* * **Dry-Run Safety:** *Always use the `--dry-run` flag for mutating operations (create, update, delete) to validate your JSON payload before actual execution.* ## Core Syntax ```bash gws [sub-resource] [flags] ``` Use `--help` to get help on the available commands. ```bash gws --help gws --help gws --help gws --help ``` ### Key Flags - `--params ''`: URL/query parameters (e.g., `id`, `q`, `pageSize`). - `--json ''`: Request body for POST/PUT/PATCH methods. - `--page-all`: Auto-paginates results and outputs NDJSON (one JSON object per line). - `--fields ''`: Limits the response fields (critical for AI context window efficiency). - `--upload `: Files for multipart uploads (e.g., `drive files create`). - `--output `: Destination for binary downloads (e.g., `drive files get`). - `--sanitize