{
 "schema_version": 1,
 "generated": "2026-10-25",
 "id": "googleworkspace-cli--script-gmail-drive-and-sheets-from-the-terminal",
 "repo": "googleworkspace/cli",
 "repo_url": "https://github.com/googleworkspace/cli",
 "repo_slug": "googleworkspace-cli",
 "title": "Script Gmail, Drive and Sheets from the terminal",
 "page_title": "How to script Gmail, Drive and Sheets from the terminal with Google Workspace CLI",
 "summary": "Install gws, sign in once, and call any Workspace API with JSON in and JSON out.",
 "who": "A developer or admin who wants quick scripts against Workspace without an SDK.",
 "problem": "Google API clients need boilerplate for auth, paging and request bodies.",
 "outcome": "Commands that list files, create sheets and post messages, with JSON you can pipe into jq.",
 "steps": [
  "Install: `npm install -g @googleworkspace/cli` or `brew install googleworkspace-cli`",
  "Run `gws auth setup` once, then `gws 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`"
 ],
 "agent_prompt": "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.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "20 minutes",
 "basis": "readme",
 "caveat": "Not an officially supported Google product, and breaking changes are expected before v1.0.",
 "category": "Work and operations",
 "tags": [
  "Work and operations"
 ],
 "lang": "rust",
 "requirements": [
  "A Google account and a Google Cloud project for OAuth (gws auth setup walks you through it)",
  "npm, Homebrew, Cargo or Nix"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "OAuth tokens grant access to your mail and files; keep them on your machine and revoke them when done."
  }
 ],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/googleworkspace-cli/script-gmail-drive-and-sheets-from-the-terminal/",
 "md": "https://dedupedai.com/use-cases/googleworkspace-cli/script-gmail-drive-and-sheets-from-the-terminal/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/googleworkspace-cli--script-gmail-drive-and-sheets-from-the-terminal.json",
 "api_version": "v1"
}
