Skip to content
Back to skills

Gws Shared

BSecurity

gws CLI shared patterns for authentication, global flags, and output formatting. Read this before using any other gws-* skill.

  • 9 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 11, 2026
ai-agentsgoshellbashtestingapisecurity

Works with

  • claude code
  • cursor
  • cli
  • api
  • mcp

Security analysis

B84/100
  • criticalSends environment variables or credentials to an external URL
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned September 11, 2026

npx -y skills add nvdigitalsolutions/mcp-ai-wpoos --skill gws-shared --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gws Shared?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gws Shared
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/nvdigitalsolutions-gws-shared/badge)](https://www.skillsdirectory.com/skills/nvdigitalsolutions-gws-shared)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
type: Skill
name: gws-shared
version: 1.0.0
description: gws CLI shared patterns for authentication, global flags, and output formatting. Read this before using any other gws-* skill.
license: Apache-2.0
compatibility: Claude Code, Cursor, Gemini CLI, Codex CLI
---

# gws — Shared Reference

`gws` is a unified CLI for all Google Workspace APIs. It reads Google's Discovery Service at runtime, so every Workspace API endpoint is available without custom integration code.

## Installation

```bash
npm install -g @googleworkspace/cli
gws --version
```

## Authentication

### Interactive (desktop / laptop)

```bash
gws auth setup    # One-time: creates Cloud project, enables APIs, logs you in (requires gcloud)
gws auth login    # Subsequent scope selection and login
```

Log in with specific services to stay within testing-mode scope limits:

```bash
gws auth login -s drive,gmail,calendar,sheets
```

### Service Account (server / CI)

```bash
export GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE=/path/to/service-account.json
gws drive files list   # Works without interactive login
```

### Pre-obtained access token

```bash
export GOOGLE_WORKSPACE_CLI_TOKEN=$(gcloud auth print-access-token)
```

### Headless / CI export flow

```bash
# On machine with browser
gws auth export --unmasked > credentials.json

# On headless machine
export GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE=/path/to/credentials.json
```

## CLI Syntax

```bash
gws <service> <resource> [sub-resource] <method> [flags]
```

## Global Flags

| Flag | Description |
|------|-------------|
| `--format <FORMAT>` | Output format: `json` (default), `table`, `yaml`, `csv` |
| `--dry-run` | Validate request locally without calling the API |
| `--sanitize <TEMPLATE>` | Screen responses through Model Armor |

## 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) |

## Discovering Commands

```bash
# Browse all services
gws --help

# Browse a service's resources
gws drive --help

# Inspect a specific method's schema
gws schema drive.files.list
gws schema gmail.users.messages.send
```

## Shell Tips

### zsh `!` expansion in ranges

Sheet ranges like `Sheet1!A1` contain `!` which zsh interprets as history expansion. Use double quotes:

```bash
# WRONG (zsh mangles the !)
gws sheets +read --spreadsheet ID --range 'Sheet1!A1:D10'

# CORRECT
gws sheets +read --spreadsheet ID --range "Sheet1!A1:D10"
```

### JSON with inner double quotes

```bash
gws drive files list --params '{"pageSize": 5}'
```

## Security Rules

- **Never** output secrets, tokens, or API keys in responses
- **Always** confirm with the user before executing write or delete commands
- Prefer `--dry-run` for any destructive or sending operation
- Use `--sanitize` for PII screening when processing user-generated content

## MCP Server (for AI agents)

```bash
# Start a built-in MCP server exposing selected APIs
gws mcp -s drive,gmail,calendar,sheets
```

This exposes all methods of the selected services as MCP tools, giving any MCP-compatible AI agent direct Workspace access without additional integration code.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.