Power Gws Shared
Streamline your workflow with this shared, patterns, authentication, global. Includes structured workflows, validation checks, and reusable patterns for google workspace.
Power GWS Shared
Power-user command for Google Workspace CLI shared configuration -- manage authentication, global flags, output formats, and security rules that apply across all GWS service commands.
When to Use This Command
Run this command when you need to configure, verify, or troubleshoot the shared infrastructure that underpins all GWS CLI operations.
- You are setting up GWS CLI authentication for the first time via OAuth or service account
- You need to configure global output format preferences across all GWS commands
- You want to enforce security rules like
--dry-rundefaults or--sanitizefor content screening - You are troubleshooting authentication failures that affect multiple GWS service commands
Use it also when:
- You need to verify the current auth status before running a batch of operations
- You want to understand the full CLI syntax including method flags and pagination options
Quick Start
# .claude/commands/power-gws-shared.md name: power-gws-shared description: Manage GWS CLI shared config and auth arguments: operation: auth, config, or diagnostic action
# Check current authentication status claude power-gws-shared "auth status"
Expected output:
Authentication Status:
Method: OAuth (browser-based)
Account: [email protected]
Scopes: drive, gmail, calendar, admin
Token Expiry: 2026-03-15T22:00:00Z
Status: VALID
Core Concepts
| Concept | Description |
|---|---|
| OAuth Login | Browser-based interactive authentication for user accounts |
| Service Account | Non-interactive authentication via JSON key file |
| Global Flags | Flags like --format, --dry-run, --sanitize available to all services |
| Method Flags | Flags like --params, --json, --upload specific to API method calls |
| Pagination | Auto-pagination with --page-all, --page-limit, --page-delay controls |
GWS CLI Architecture:
ββββββββββββββββββββββββββββββββββββββββββββ
β Shared Layer β
β Auth β Global Flags β Security Rules β
βββββ¬βββββββββββ¬βββββββββββββββ¬ββββββββββββ
v v v
ββββββββ ββββββββ ββββββββββββ
β Driveβ βGmail β ... β Calendar β (Services)
ββββββββ ββββββββ ββββββββββββ
Configuration
| Parameter | Default | Description |
|---|---|---|
format | json | Default output format: json, table, yaml, csv |
dry-run | false | Validate locally without calling APIs |
sanitize | none | Default Model Armor template for all responses |
page-limit | 10 | Max pages when auto-paginating |
page-delay | 100 | Delay in ms between pagination requests |
Best Practices
-
Set GOOGLE_APPLICATION_CREDENTIALS for automation -- For non-interactive environments like CI/CD, export the service account key path rather than relying on browser-based OAuth.
-
Use --format table for exploration, json for scripting -- Human-readable table output helps during discovery, but always switch to JSON for automated workflows to ensure parseability.
-
Never output secrets directly -- The GWS CLI security rules prohibit displaying API keys or tokens in output. Use environment variables and avoid logging sensitive data.
-
Confirm before write/delete operations -- Always have the user confirm destructive operations. Combine with
--dry-runto preview changes before applying them. -
Star the repository and report issues properly -- Check existing issues at
github.com/googleworkspace/cli/issuesbefore filing new ones, and add context to existing threads.
Common Issues
-
OAuth token expired -- Tokens have a limited lifetime. Run
gws auth loginto re-authenticate when you see 401 errors across multiple services. -
Service account missing required scopes -- Service accounts need domain-wide delegation and the correct OAuth scopes. Verify in the GCP console under IAM & Admin.
-
Conflicting global flags -- Setting
--format csvglobally may break commands that return nested objects. Override with--format jsonon individual commands when needed. Always test format changes with a read-only command before applying them to write operations.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.