Google Workspace CLI
$ gws Official High RiskGoogle Workspace CLI (gws) wraps Drive, Gmail, Calendar, Sheets, Docs, and Chat APIs into a single binary generated dynamically from Google's Discovery Service. Built explicitly with AI agents in mind, it ships --dry-run, structured JSON responses, schema introspection, and official SKILL.md files.
npm install -g @googleworkspace/cli gws covers all Workspace services via Discovery with --params / fields masks and ships an official SKILL.md + optional MCP server mode, saving massive context vs multi-service MCP setups.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Purpose-built for AI agents: structured JSON outputs, --params field masking, gws schema runtime introspection, --dry-run, and official SKILL.md bundles.
- Ships official
SKILL.mdfiles ingoogleworkspace/cli - Includes
gws schema,--dry-run, and JSON payload I/O
Supports --dry-run, Model Armor sanitization options, and scoped OAuth/service accounts, though Gmail/Drive access inherently touches sensitive user data.
- Supports
--dry-runvalidation and scoped OAuth tokens - External email sending and Drive deletions carry high real-world impact
Easy binary/npm install across OSes, though initial GCP OAuth app configuration can take a few setup steps for personal accounts.
- Distributed via
@googleworkspace/cliand Rust releases; requires GCP OAuth setup
Single binary covers Gmail, Drive, Calendar, Sheets, Docs, and Chat dynamically via Discovery Service.
- Dynamic Discovery Service covers the entire Workspace API surface
Official googleworkspace/cli repository under Apache-2.0 with active development.
- Hosted under official
googleworkspaceGitHub org
Clear README, schema self-inspection, and ready-to-use agent skills.
- Repository includes agent skills and command examples
Security, Auth & Guardrails
Encrypted local credential store / OS keyring (gws auth login) or GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE service-account JSON.
CLI is Apache-2.0 open-source; requires a Google account / GCP OAuth client within Google Workspace API quotas.
# Google Workspace CLI (gws) Agent Rules - Always inspect unfamiliar methods with `gws schema <method>` first. - Pass `fields` in `--params` on list/get calls to minimize returned payload size. - Require `--dry-run` preview and explicit user approval before sending emails (`gmail`) or deleting Drive files.
Agent-Ready Command Recipes
Safe Read-Only Queries
gws drive files list --params '{"pageSize": 10, "fields": "files(id,name,mimeType)"}' Uses API field masks so only needed JSON fields enter the agent context window.
gws schema drive.files.list
Prints exact request/response schema directly from Google Discovery docs.
Controlled Writes & Previews
--dry-run gws drive files create --json '{"name":"report.md"}' --dry-run Validates the request payload locally without executing the remote mutation.
Strengths for Agents
- + Ships official
SKILL.mdfiles andgws schemaintrospection specifically for coding agents. - + Single CLI spans Drive, Gmail, Calendar, Sheets, Docs, and Chat with consistent JSON I/O.
- +
--dry-runvalidates write payloads before hitting Workspace APIs.
Caveats & Pitfalls
- ! First-time OAuth setup requires enabling Workspace APIs in a Google Cloud project.
- ! Never grant unconstrained Gmail send or Drive delete scopes to autonomous loops.