cli

googleworkspaceApache-2.0活跃维护

一条命令搞定 Google Workspace 全家桶:Drive、Gmail、日历、表格、文档、Chat、Admin 都能从命令行操作,接口按 Discovery Service 动态生成,还内置 AI agent 技能。

Google Workspace CLI — one command-line tool for Drive, Gmail, Calendar, Sheets, Docs, Chat, Admin, and more. Dynamically built from Google Discovery Service. Includes AI agent skills.

v0.22.5发布于 2026-03-31 18:53 UTC32,217star +49 / 7 天1,988fork同步于 2026-11-10 05:20 UTC

怎么上手

由 README 提炼,执行前请确认
npm install -g @googleworkspace/cli
gws auth setup
gws auth login
硬件要求按 README 说明

README 未说明硬件要求;需 Node.js 18+(或下载预编译二进制),并需要 Google Cloud 项目和 Google 账号完成 OAuth

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

一个命令行工具统一操作 Drive、Gmail、Calendar 等全部 Google Workspace API,命令面按 Discovery Service 动态生成

一条命令搞定 Google Workspace 全家桶:Drive、Gmail、日历、表格、文档、Chat、Admin 都能从命令行操作,接口按 Discovery Service 动态生成,还内置 AI agent 技能。

核心能力

  • 运行时读取 Google Discovery Service 动态生成全部命令
  • 所有响应输出结构化 JSON,便于脚本和 AI agent 消费
  • 内置 40+ agent skills,可接入 Gemini CLI 等智能体
  • 提供 --dry-run 预览请求与 --page-all 自动分页输出 NDJSON
  • 附带 +send、+agenda 等手写 helper 命令简化常见操作

容易踩的坑

gws auth setup 依赖已安装并登录的 gcloud CLI,没有则需手动在 Cloud Console 配置 OAuth 并放置 client_secret.json;OAuth 应用处于测试模式时授权范围上限约 25 个,recommended 预设的 85+ scope 会失败,需用 -s 指定具体服务;手动配置时必须在 OAuth 同意屏幕把自己加为测试用户,否则登录报 Access blocked;Sheets 范围含 ! 需用单引号包裹避免 bash 历史展开

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README
这个条目还没有人工点评。如果它对你很有用,欢迎到 提交仓库 页写下你的使用经验。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    最近发版

    5 个版本v0.22.5
    1. v0.22.5最新正式版2026-03-31 · 2026-03-31 18:53 UTC

      Installation

      Download the archive for your OS and architecture from the assets below.

      Linux / macOS

      Replace <target> with your platform (e.g., aarch64-apple-darwin or x86_64-unknown-linux-gnu).

      # 1. Download the archive and its checksum
      curl -sLO https://github.com/googleworkspace/cli/releases/download/v0.22.5/google-workspace-cli-<target>.tar.gz
      curl -sLO https://github.com/googleworkspace/cli/releases/download/v0.22.5/google-workspace-cli-<target>.tar.gz.sha256
      
      # 2. Verify the checksum
      shasum -a 256 -c google-workspace-cli-<target>.tar.gz.sha256
      
      # 3. Extract and install
      tar -xzf google-workspace-cli-<target>.tar.gz
      chmod +x gws
      sudo mv gws /usr/local/bin/
      

      Windows

      1. Download google-workspace-cli-x86_64-pc-windows-msvc.zip and its .sha256 file
      2. Verify the checksum (e.g., using PowerShell Get-FileHash)
      3. Extract the archive and move gws.exe to a directory included in your system PATH.

      What's Changed

      Full Changelog: https://github.com/googleworkspace/cli/compare/v0.22.4...v0.22.5

    2. v0.22.42026-03-31 · 2026-03-31 17:27 UTC
      查看更新说明

      What's Changed

      Full Changelog: https://github.com/googleworkspace/cli/compare/v0.22.3...v0.22.4

    3. v0.22.30.22.32026-03-26 · 2026-03-26 18:55 UTC
      查看更新说明

      Release Notes

      Patch Changes

      • 674d53a: Fix Lint Skills CI job by installing uv via astral-sh/setup-uv before running uvx

      • c7c42f6: fix: register script service and resolve test path validation errors

      • 80bd150: feat(auth): use strict OS keychain integration on macOS and Windows

        Closes #623. The CLI no longer writes a fallback .encryption_key text file on macOS and Windows when securely storing credentials. Instead, it strictly uses the native OS keychain (Keychain Access on macOS, Credential Manager on Windows). If an old .encryption_key file is found during a successful keychain login, it will be automatically deleted for security. Linux deployments continue to use a seamless file-based fallback by default to ensure maximum compatibility with headless continuous integration (CI) runners, Docker containers, and SSH environments without desktop DBUS services.

      • ec7f56b: Sync generated skills with latest Google Discovery API specs

      Install google-workspace-cli 0.22.3

      Install prebuilt binaries via shell script

      curl --proto '=https' --tlsv1.2 -LsSf https://github.com/googleworkspace/cli/releases/download/v0.22.3/google-workspace-cli-installer.sh | sh
      

      Install prebuilt binaries via powershell script

      powershell -ExecutionPolicy Bypass -c "irm https://github.com/googleworkspace/cli/releases/download/v0.22.3/google-workspace-cli-installer.ps1 | iex"
      

      Install prebuilt binaries into your npm project

      npm install @googleworkspace/[email protected]
      

      Download google-workspace-cli 0.22.3

      FilePlatformChecksum
      google-workspace-cli-aarch64-apple-darwin.tar.gzApple Silicon macOSchecksum
      google-workspace-cli-x86_64-apple-darwin.tar.gzIntel macOSchecksum
      google-workspace-cli-x86_64-pc-windows-msvc.zipx64 Windowschecksum
      google-workspace-cli-aarch64-unknown-linux-gnu.tar.gzARM64 Linuxchecksum
      google-workspace-cli-x86_64-unknown-linux-gnu.tar.gzx64 Linuxchecksum
      google-workspace-cli-aarch64-unknown-linux-musl.tar.gzARM64 MUSL Linuxchecksum
      google-workspace-cli-x86_64-unknown-linux-musl.tar.gzx64 MUSL Linuxchecksum

      Verifying GitHub Artifact Attestations

      The artifacts in

    4. v0.22.10.22.12026-03-25 · 2026-03-25 17:37 UTC
      查看更新说明

      Release Notes

      Patch Changes

      • 6a45832: Sync generated skills with latest Google Discovery API specs

      Install google-workspace-cli 0.22.1

      Install prebuilt binaries via shell script

      curl --proto '=https' --tlsv1.2 -LsSf https://github.com/googleworkspace/cli/releases/download/v0.22.1/google-workspace-cli-installer.sh | sh
      

      Install prebuilt binaries via powershell script

      powershell -ExecutionPolicy Bypass -c "irm https://github.com/googleworkspace/cli/releases/download/v0.22.1/google-workspace-cli-installer.ps1 | iex"
      

      Install prebuilt binaries into your npm project

      npm install @googleworkspace/[email protected]
      

      Download google-workspace-cli 0.22.1

      FilePlatformChecksum
      google-workspace-cli-aarch64-apple-darwin.tar.gzApple Silicon macOSchecksum
      google-workspace-cli-x86_64-apple-darwin.tar.gzIntel macOSchecksum
      google-workspace-cli-x86_64-pc-windows-msvc.zipx64 Windowschecksum
      google-workspace-cli-aarch64-unknown-linux-gnu.tar.gzARM64 Linuxchecksum
      google-workspace-cli-x86_64-unknown-linux-gnu.tar.gzx64 Linuxchecksum
      google-workspace-cli-aarch64-unknown-linux-musl.tar.gzARM64 MUSL Linuxchecksum
      google-workspace-cli-x86_64-unknown-linux-musl.tar.gzx64 MUSL Linuxchecksum

      Verifying GitHub Artifact Attestations

      The artifacts in this release have attestations generated with GitHub Artifact Attestations. These can be verified by using the GitHub CLI:

      gh attestation verify <file-path of downloaded artifact> --repo googleworkspace/cli
      

      You can also download the attestation from GitHub and verify against that directly:

      gh attestation verify <file-path of downloaded artifact> --bundle <file-path of downloaded attestation>
      
    5. v0.22.00.22.02026-03-24 · 2026-03-24 22:25 UTC
      查看更新说明

      Release Notes

      Minor Changes

      • 0850c48: Add --draft flag to Gmail +send, +reply, +reply-all, and +forward helpers to save messages as drafts instead of sending them immediately

      Install google-workspace-cli 0.22.0

      Install prebuilt binaries via shell script

      curl --proto '=https' --tlsv1.2 -LsSf https://github.com/googleworkspace/cli/releases/download/v0.22.0/google-workspace-cli-installer.sh | sh
      

      Install prebuilt binaries via powershell script

      powershell -ExecutionPolicy Bypass -c "irm https://github.com/googleworkspace/cli/releases/download/v0.22.0/google-workspace-cli-installer.ps1 | iex"
      

      Install prebuilt binaries into your npm project

      npm install @googleworkspace/[email protected]
      

      Download google-workspace-cli 0.22.0

      FilePlatformChecksum
      google-workspace-cli-aarch64-apple-darwin.tar.gzApple Silicon macOSchecksum
      google-workspace-cli-x86_64-apple-darwin.tar.gzIntel macOSchecksum
      google-workspace-cli-x86_64-pc-windows-msvc.zipx64 Windowschecksum
      google-workspace-cli-aarch64-unknown-linux-gnu.tar.gzARM64 Linuxchecksum
      google-workspace-cli-x86_64-unknown-linux-gnu.tar.gzx64 Linuxchecksum
      google-workspace-cli-aarch64-unknown-linux-musl.tar.gzARM64 MUSL Linuxchecksum
      google-workspace-cli-x86_64-unknown-linux-musl.tar.gzx64 MUSL Linuxchecksum

      Verifying GitHub Artifact Attestations

      The artifacts in this release have attestations generated with GitHub Artifact Attestations. These can be verified by using the GitHub CLI:

      gh attestation verify <file-path of downloaded artifact> --repo googleworkspace/cli
      

      You can also download the attestation from GitHub and verify against that directly:

      gh attestation verify <file-path of downloaded artifact> --bundle <file-path of downloaded attestation>
      

    README 原文

    未翻译

    One CLI for all of Google Workspace — built for humans and AI agents. Drive, Gmail, Calendar, and every Workspace API. Zero boilerplate. Structured JSON output. 40+ agent skills included.

    [!NOTE] This is not an officially supported Google product.

    ⬇️ Download the latest release for your OS

    gws doesn't ship a static list of commands. It reads Google's own Discovery Service at runtime and builds its entire command surface dynamically. When Google Workspace adds an API endpoint or method, gws picks it up automatically.

    [!IMPORTANT] This project is under active development. Expect breaking changes as we march toward v1.0.

    Contents

    Prerequisites

    • Node.js 18+ — for npm install (or download a pre-built binary from GitHub Releases)
    • A Google Cloud project — required for OAuth credentials. You can create one via the Google Cloud Console or with the gcloud CLI or with the gws auth setup command.
    • A Google account with access to Google Workspace

    Installation

    The recommended way to install gws is to download the pre-built binary for your OS and architecture from the GitHub Releases page. Extract the archive and place the gws binary in your $PATH.

    For convenience, you can also use npm to automate downloading the appropriate binary from GitHub Releases:

    npm install -g @googleworkspace/cli
    

    Or build from source:

    cargo install --git https://github.com/googleworkspace/cli --locked
    

    A Nix flake is also available at github:googleworkspace/cli

    nix run github:googleworkspace/cli
    

    On macOS and Linux, you can also install via Homebrew:

    brew install googleworkspace-cli
    

    Quick Start

    gws auth setup     # walks you through Google Cloud project config
    gws auth login     # subsequent OAuth login
    gws drive files list --params '{"pageSize": 5}'
    

    Why gws?

    For humans — stop writing curl calls against REST docs. gws gives you --help on every resource, --dry-run to preview requests, and auto‑pagination.

    For AI agents — every response is structured JSON. Pair it with the included agent skills and your LLM can manage Workspace without custom tooling.

    # List the 10 most recent files
    gws drive files list --params '{"pageSize": 10}'
    
    # Create a spreadsheet
    gws sheets spreadsheets create --json '{"properties": {"title": "Q1 Budget"}}'
    
    # Send a Chat message
    gws chat spaces messages create \
      --params '{"parent": "spaces/xyz"}' \
      --json '{"text": "Deploy complete."}' \
      --dry-run
    
    # Introspect any method's request/response schema
    gws schema drive.files.list
    
    # Stream paginated results as NDJSON
    gws drive files list --params '{"pageSize": 100}' --page-all | jq -r '.files[].name'
    

    Authentication

    The CLI supports multiple auth workflows so it works on your laptop, in CI, and on a server.

    Which setup should I use?

    I have…Use
    gcloud installed and authenticatedgws auth setup (fastest)
    A GCP project but no gcloudManual OAuth setup
    An existing OAuth access tokenGOOGLE_WORKSPACE_CLI_TOKEN
    Existing CredentialsGOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE

    Interactive (local desktop)

    Credentials are encrypted at rest (AES-256-GCM) with the key stored in your OS keyring (or ~/.config/gws/.encryption_key when GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND=file).

    gws auth setup       # one-time: creates a Cloud project, enables APIs, logs you in
    gws auth login       # subsequent scope selection and login
    

    gws auth setup requires the gcloud CLI. If you don't have gcloud, use the manual setup below instead.

    [!WARNING] Scope limits in testing mode: If your OAuth app is unverified (testing mode), Google limits consent to ~25 scopes. The recommended scope preset includes 85+ scopes and will fail for unverified apps (especially for @gmail.com accounts). Choose individual services instead to filter the scope picker:

    gws auth login -s drive,gmail,sheets
    

    Manual OAuth setup (Google Cloud Console)

    Use this when gws auth setup cannot automate project/client creation, or when you want explicit control.

    1. Open Google Cloud Console in the target project:
      • OAuth consent screen: https://console.cloud.google.com/apis/credentials/consent?project=<PROJECT_ID>
      • Credentials: https://console.cloud.google.com/apis/credentials?project=<PROJECT_ID>
    2. Configure OAuth branding/audience if prompted:
      • App type: External (testing mode is fine)
    3. Add your account under Test users
    4. Create an OAuth client:
      • Type: Desktop app
    5. Download the client JSON and save it to:
      • ~/.config/gws/client_secret.json

    [!IMPORTANT] You must add yourself as a test user. In the OAuth consent screen, click Test users → Add users and enter your Google account email. Without this, login will fail with a generic "Access blocked" error.

    Then run:

    gws auth login
    

    Browser-assisted auth (human or agent)

    You can complete OAuth either manually or with browser automation.

    • Human flow: run gws auth login, open the printed URL, approve scopes.
    • Agent-assisted flow: the agent opens the URL, selects account, handles consent prompts, and returns control once the localhost callback succeeds.

    If consent shows "Google hasn't verified this app" (testing mode), click Continue. If scope checkboxes appear, select required scopes (or Select all) before continuing.

    Headless / CI (export flow)

    1. Complete interactive auth on a machine with a browser.
    2. Export credentials:
      gws auth export --unmasked > credentials.json
      
    3. On the headless machine:
      export GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE=/path/to/credentials.json
      gws drive files list   # just works
      

    Service Account (server-to-server)

    Point to your key file; no login needed.

    export GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE=/path/to/service-account.json
    gws drive files list
    

    Pre-obtained Access Token

    Useful when another tool (e.g. gcloud) already mints tokens for your environment.

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

    Precedence

    PrioritySourceSet via
    1Access tokenGOOGLE_WORKSPACE_CLI_TOKEN
    2Credentials fileGOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE
    3Encrypted credentialsgws auth login
    4Plaintext credentials~/.config/gws/credentials.json

    Environment variables can also live in a .env file.

    AI Agent Skills

    The repo ships 100+ Agent Skills (SKILL.md files) — one for every supported API, plus higher-level helpers for common workflows and 50 curated recipes for Gmail, Drive, Docs, Calendar, and Sheets. See the full Skills Index for the complete list.

    # Install all skills at once
    npx skills add https://github.com/googleworkspace/cli
    
    # Or pick only what you need
    npx skills add https://github.com/googleworkspace/cli/tree/main/skills/gws-drive
    npx skills add https://github.com/googleworkspace/cli/tree/main/skills/gws-gmail
    
    # Symlink all skills (stays in sync with repo)
    ln -s $(pwd)/skills/gws-* ~/.openclaw/skills/
    
    # Or copy specific skills
    cp -r skills/gws-drive skills/gws-gmail ~/.openclaw/skills/
    

    The gws-shared skill includes an install block so OpenClaw auto-installs the CLI via npm if gws isn't on PATH.

    Gemini CLI Extension

    1. Authenticate the CLI first:

      gws auth setup
      
    2. Install the extension into the Gemini CLI:

      gemini extensions install https://github.com/googleworkspace/cli
      

    Installing this extension gives your Gemini CLI agent direct access to all gws commands and Google Workspace agent skills. Because gws handles its own authentication securely, you simply need to authenticate your terminal once prior to using the agent, and the extension will automatically inherit your credentials.

    Advanced Usage

    Multipart Uploads

    gws drive files create --json '{"name": "report.pdf"}' --upload ./report.pdf
    

    Pagination

    FlagDescriptionDefault
    --page-allAuto-paginate, one JSON line per page (NDJSON)off
    --page-limit <N>Max pages to fetch10
    --page-delay <MS>Delay between pages100 ms

    Google Sheets — Shell Escaping

    Sheets ranges use ! which bash interprets as history expansion. Always wrap values in single quotes:

    # Read cells A1:C10 from "Sheet1"
    gws sheets spreadsheets values get \
      --params '{"spreadsheetId": "SPREADSHEET_ID", "range": "Sheet1!A1:C10"}'
    
    # Append rows
    gws sheets spreadsheets values append \
      --params '{"spreadsheetId": "ID", "range": "Sheet1!A1", "valueInputOption": "USER_ENTERED"}' \
      --json '{"values": [["Name", "Score"], ["Alice", 95]]}'
    

    Helper Commands

    Some services ship hand-crafted helper commands alongside the auto-generated Discovery surface. Helper commands are prefixed with + so they are visually distinct and never collide with Discovery-generated method names.

    Time-aware helpers (+agenda, +standup-report, +weekly-digest, +meeting-prep) automatically use your Google account timezone (fetched from Calendar Settings API and cached for 24 hours). Override with --timezone/--tz on +agenda, or set the --timezone flag for explicit control.

    Run gws <service> --help to see both Discovery methods and helper commands together.

    gws gmail --help      # shows +send, +reply, +reply-all, +forward, +triage, +watch …
    gws calendar --help   # shows +insert, +agenda …
    gws drive --help      # shows +upload …
    

    Full helper reference:

    ServiceCommandDescription
    gmail+sendSend an email
    gmail+replyReply to a message (handles threading automatically)
    gmail+reply-allReply-all to a message
    gmail+forwardForward a message to new recipients
    gmail+triageShow unread inbox summary (sender, subject, date)
    gmail+watchWatch for new emails and stream them as NDJSON
    sheets+appendAppend a row to a spreadsheet
    sheets+readRead values from a spreadsheet
    docs+writeAppend text to a document
    chat+sendSend a message to a space
    drive+uploadUpload a file with automatic metadata
    calendar+insertCreate a new event
    calendar+agendaShow upcoming events (uses Google account timezone; override with --timezone)
    script+pushReplace all files in an Apps Script project with local files
    workflow+standup-reportToday's meetings + open tasks as a standup summary
    workflow+meeting-prepPrepare for your next meeting: agenda, attendees, and linked docs
    workflow+email-to-taskConvert a Gmail message into a Google Tasks entry
    workflow+weekly-digestWeekly summary: this week's meetings + unread email count
    workflow+file-announceAnnounce a Drive file in a Chat space
    events+subscribeSubscribe to Workspace events and stream them as NDJSON
    events+renewRenew/reactivate Workspace Events subscriptions
    modelarmor+sanitize-promptSanitize a user prompt through a Model Armor template
    modelarmor+sanitize-responseSanitize a model response through a Model Armor template
    modelarmor+create-templateCreate a new Model Armor template

    Examples:

    # Send an email
    gws gmail +send --to [email protected] --subject "Hello" --body "Hi there"
    
    # Reply to a message
    gws gmail +reply --message-id MESSAGE_ID --body "Thanks!"
    
    # Append a row to a spreadsheet
    gws sheets +append --spreadsheet SPREADSHEET_ID --values "Alice,95"
    
    # Show today's calendar agenda
    gws calendar +agenda
    
    # Upload a file to Drive
    gws drive +upload ./report.pdf --name "Q1 Report"
    
    # Morning standup summary
    gws workflow +standup-report
    
    # Show today's agenda in a specific timezone
    gws calendar +agenda --today --timezone America/New_York
    

    Model Armor (Response Sanitization)

    Integrate Google Cloud Model Armor to scan API responses for prompt injection before they reach your agent.

    gws gmail users messages get --params '...' \
      --sanitize "projects/P/locations/L/templates/T"
    
    VariableDescription
    GOOGLE_WORKSPACE_CLI_SANITIZE_TEMPLATEDefault Model Armor template
    GOOGLE_WORKSPACE_CLI_SANITIZE_MODEwarn (default) or block

    Environment Variables

    All variables are optional. See .env.example for a copy-paste template.

    VariableDescription
    GOOGLE_WORKSPACE_CLI_TOKENPre-obtained OAuth2 access token (highest priority)
    GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILEPath to OAuth credentials JSON (user or service account)
    GOOGLE_WORKSPACE_CLI_CLIENT_IDOAuth client ID (alternative to client_secret.json)
    GOOGLE_WORKSPACE_CLI_CLIENT_SECRETOAuth client secret (paired with CLIENT_ID)
    GOOGLE_WORKSPACE_CLI_CONFIG_DIROverride config directory (default: ~/.config/gws)
    GOOGLE_WORKSPACE_CLI_SANITIZE_TEMPLATEDefault Model Armor template
    GOOGLE_WORKSPACE_CLI_SANITIZE_MODEwarn (default) or block
    GOOGLE_WORKSPACE_CLI_LOGLog level for stderr (e.g., gws=debug). Off by default.
    GOOGLE_WORKSPACE_CLI_LOG_FILEDirectory for JSON log files with daily rotation. Off by default.
    GOOGLE_WORKSPACE_PROJECT_IDGCP project ID override for quota/billing and fallback for helper commands

    Environment variables can also be set in a .env file (loaded via dotenvy).

    Exit Codes

    gws uses structured exit codes so scripts can branch on the failure type without parsing error output.

    CodeMeaningExample cause
    0SuccessCommand completed normally
    1API errorGoogle returned a 4xx/5xx response
    2Auth errorCredentials missing, expired, or invalid
    3Validation errorBad arguments, unknown service, invalid flag
    4Discovery errorCould not fetch the API schema document
    5Internal errorUnexpected failure
    gws drive files list --params '{"fileId": "bad"}'
    echo $?   # 1 — API error
    
    gws unknown-service files list
    echo $?   # 3 — validation error (unknown service)
    

    Architecture

    gws uses a two-phase parsing strategy:

    1. Read argv[1] to identify the service (e.g. drive)
    2. Fetch the service's Discovery Document (cached 24 h)
    3. Build a clap::Command tree from the document's resources and methods
    4. Re-parse the remaining arguments
    5. Authenticate, build the HTTP request, execute

    All output — success, errors, download metadata — is structured JSON.

    Troubleshooting

    "Access blocked" or 403 during login

    Your OAuth app is in testing mode and your account is not listed as a test user.

    Fix: Open the OAuth consent screen in your GCP project → Test users → Add users → enter your Google account email. Then retry gws auth login.

    "Google hasn't verified this app"

    Expected when your app is in testing mode. Click Advanced → Go to <app name> (unsafe) to proceed. This is safe for personal use; verification is only required to publish the app to other users.

    Too many scopes / consent screen error

    Unverified (testing mode) apps are limited to ~25 OAuth scopes. The recommended scope preset includes many scopes and will exceed this limit.

    Fix: Select only the scopes you need:

    gws auth login --scopes drive,gmail,calendar
    

    gcloud CLI not found

    gws auth setup requires the gcloud CLI to automate project creation. You have three options:

    1. Install gcloud and use gcloud directly.
    2. Re-run gws auth setup which wraps gcloud calls.
    3. Skip gcloud entirely — set up OAuth credentials manually in the Cloud Console

    redirect_uri_mismatch

    The OAuth client was not created as a Desktop app type. In the Credentials page, delete the existing client, create a new one with type Desktop app, and download the new JSON.

    API not enabled — accessNotConfigured

    If a required Google API is not enabled for your GCP project, you will see a 403 error with reason accessNotConfigured:

    {
      "error": {
        "code": 403,
        "message": "Gmail API has not been used in project 549352339482 ...",
        "reason": "accessNotConfigured",
        "enable_url": "https://console.developers.google.com/apis/api/gmail.googleapis.com/overview?project=549352339482"
      }
    }
    

    gws also prints an actionable hint to stderr:

    💡 API not enabled for your GCP project.
       Enable it at: https://console.developers.google.com/apis/api/gmail.googleapis.com/overview?project=549352339482
       After enabling, wait a few seconds and retry your command.
    

    Steps to fix:

    1. Click the enable_url link (or copy it from the enable_url JSON field).
    2. In the GCP Console, click Enable.
    3. Wait ~10 seconds, then retry your gws command.

    [!TIP] You can also run gws auth setup which walks you through enabling all required APIs for your project automatically.

    Development

    cargo build                       # dev build
    cargo clippy -- -D warnings       # lint
    cargo test                        # unit tests
    ./scripts/coverage.sh             # HTML coverage report → target/llvm-cov/html/
    

    License

    Apache-2.0

    Disclaimer

    [!CAUTION] This is not an officially supported Google product.