# Google Workspace CLI Command Reference Comprehensive reference for the `gws` CLI covering 18 services, 22 helper commands, global flags, and environment variables. --- ## Global Flags | Flag | Description | |------|-------------| | `--json` | Output as JSON | | `--format ndjson` | Output as newline-delimited JSON | | `--dry-run` | Show what would be done without executing | | `--limit ` | Maximum results to return | | `--page-all` | Fetch all pages of results | | `--fields ` | Partial response field mask | | `--quiet` | Suppress non-error output | | `--verbose` | Verbose debug output | | `--timeout ` | Request timeout in milliseconds | --- ## Environment Variables | Variable | Description | Default | |----------|-------------|---------| | `GWS_CLIENT_ID` | OAuth client ID | — | | `GWS_CLIENT_SECRET` | OAuth client secret | — | | `GWS_TOKEN_PATH` | Token storage location | `~/.config/gws/token.json` | | `GWS_SERVICE_ACCOUNT_KEY` | Service account JSON key path | — | | `GWS_DELEGATED_USER` | User to impersonate (service accounts) | — | | `GWS_DEFAULT_FORMAT` | Default output format | `text` | | `GWS_PAGINATION_LIMIT` | Default pagination limit | `100` | | `GWS_LOG_LEVEL` | Logging level (debug/info/warn/error) | `warn` | --- ## Services ### Gmail ```bash gws gmail users.messages list me --query "" --json gws gmail users.messages get me --json gws gmail users.messages send me --to --subject --body gws gmail users.messages reply me --thread-id --body gws gmail users.messages forward me --message-id --to gws gmail users.messages modify me --addLabelIds