skillfed

gws-shared

gws-shared is a reference guide for the gws CLI's core patterns: browser-based OAuth and service account authentication, global flags for output formatting and API validation, and method-specific options for pagination and file handling. It covers essential syntax, shell quoting tips, and security practices for working with Google Workspace APIs.

gws-shared documents the CLI syntax, authentication methods, and global flags for the gws Google Workspace command-line tool.

AI-generated summary based on this skill's SKILL.md

30,031 1,753 Apache-2.0 updated by googleworkspace

Install

googleworkspace/cli/gws-shared · repository language: Rust

CLI (skillfed)coming soon
git clone https://github.com/googleworkspace/cli
cp -r cli/skills/gws-shared ~/.claude/skills/gws-shared

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What are gws CLI authentication and global flags?

gws-shared documents the core authentication methods and global flags for the gws CLI. Authentication options include browser-based OAuth login and service account setup. Global flags control output formatting (JSON, table, YAML, CSV), API response handling, dry-run validation, and pagination behavior. These flags apply across all gws commands and enable you to customize how results are displayed and processed.

How do I set up OAuth or service account authentication in gws?

gws-shared covers both authentication approaches. OAuth uses browser-based login for interactive sessions, while service account authentication uses credentials stored in environment variables or configuration files. The guide explains credential management, environment variable setup, and best practices for securing credentials. Choose OAuth for interactive use and service accounts for automated workflows or CI/CD pipelines.

How can I configure gws output formatting (JSON, table, YAML, CSV)?

gws-shared explains output formatting options through global flags that let you choose between JSON, table, YAML, and CSV formats. These flags control how API responses are displayed and parsed. You can apply formatting globally across commands or override it per-command. The guide covers API response handling to ensure your chosen format matches your downstream processing needs.

What does gws dry run validation do and how do I use it?

gws-shared describes the dry-run option as a validation mechanism that simulates command execution without making destructive changes. Use dry-run flags to preview operations, test pagination settings, and confirm parameter syntax before applying them. This is especially useful for validating complex queries, file uploads, and API calls that modify data.

What security best practices and shell escaping techniques does gws-shared cover?

gws-shared provides guidance on shell quoting, history expansion handling (especially in zsh), and PII screening practices. It covers proper parameter escaping to prevent injection attacks, credential protection strategies, and safe handling of sensitive data in command-line arguments. The guide emphasizes shell tips to avoid common mistakes when constructing gws commands with special characters.

How do pagination, file upload, and method-specific options work in gws?

gws-shared explains pagination with auto-paginate settings, page delay limits, and result limits for handling large datasets. File upload options cover multipart uploads and parameter handling. Method-specific options vary by command but are documented with examples. The guide shows how to combine these features for efficient API interactions and bulk operations.

SKILL.md

rendered from the published skill — quoted content, verbatim

gws — Shared Reference

Installation

The gws binary must be on $PATH. See the project README for install options.

Authentication

# Browser-based OAuth (interactive)
gws auth login

# Service Account
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json

Global Flags

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

CLI Syntax

gws <service> <resource> [sub-resource] <method> [flags]
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)

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 1 file
skills/gws-shared/SKILL.md

Related skills

Tags

cli-reference oauth-setup output-formatting api-patterns shell-scripting security-practices pagination-control credential-management dry-run-testing data-sanitization