Credentials. OAuth tokens grant access to your mail and files; keep them on your machine and revoke them when done.
Who it is forA developer or admin who wants quick scripts against Workspace without an SDK.
The problemGoogle API clients need boilerplate for auth, paging and request bodies.
The outcomeCommands that list files, create sheets and post messages, with JSON you can pipe into jq.
What you need first
- A Google account and a Google Cloud project for OAuth (gws auth setup walks you through it)
- npm, Homebrew, Cargo or Nix
Steps
- Install:
npm install -g @googleworkspace/cliorbrew install googleworkspace-cli - Run
gws auth setuponce, thengws auth login - List files:
gws drive files list --params '{"pageSize": 10}' - Create a sheet:
gws sheets spreadsheets create --json '{"properties": {"title": "Q1 Budget"}}' - Check any method's schema with
gws schema drive.files.list
Prompt for your agent
Install googleworkspace/cli, authenticate it, and write a script that lists my 20 most recent Drive files into a new Google Sheet called <title>. Use --dry-run first and show me the output.
Caveat. Not an officially supported Google product, and breaking changes are expected before v1.0.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for googleworkspace/cli and "Script Gmail, Drive and Sheets from the terminal"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer