agentsclimarketplace

Gws workspace

Skill laojin1900/365Skill/skills/gws-workspace

Operate Google Workspace — Gmail, Calendar, Drive, Sheets, Docs, Slides, Chat, Tasks — through the gws CLI (github.com/googleworkspace/cli) with read-by-default safety gates. Use when the user mentions gws, Gmail, email inbox/send/reply/triage, 邮件/收件箱/发邮件/未读邮件, Google Calendar, 日程/日历/创建会议, Google Drive, 谷歌网盘/上传 Drive, Google Sheets, 谷歌表格, Google Docs, 谷歌文档, or asks for Google Workspace automation such as daily/weekly mail+calendar digests (邮件汇总/日程周报). Also use when installing gws, configuring its OAuth client, or troubleshooting gws authentication errors.From its SKILL.md

Install
npx -y skills add laojin1900/365Skill --skill gws-workspace

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

5.2 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

gws Workspace Operations

Operate a user's Google Workspace account through the gws CLI — one binary covering every Workspace API, built dynamically from Google's Discovery Service, with structured JSON output. It is open source (Apache-2.0) but not an officially supported Google product and is pre-v1: expect breaking changes and pin versions in production.

Preflight

Before the first gws call in a session:

gws auth status --format json
  • auth_method: "oauth2" or service_account → proceed.
  • auth_method: "none" → stop. Follow references/setup-guide.md with the user to install gws and complete OAuth. Never invent client IDs, client secrets, or tokens; OAuth setup requires real user actions in the Google Cloud Console.
  • command not found → install: npm install -g @googleworkspace/cli (alternatives: brew install googleworkspace-cli, cargo, nix).

The stderr line Using keyring backend: keyring is informational, not an error. Parse stdout only.

Command Model

Two surfaces; prefer helper commands when one fits.

Helper commands (+ prefix, hand-written):

ServiceCommandPurpose
gmail+send --to A --subject S --body BSend email
gmail+reply --message-id ID --body BReply (threads automatically)
gmail+triageUnread inbox summary
gmail+watchStream new mail as NDJSON
calendar+agenda [--today] [--timezone TZ]Upcoming events
calendar+insertCreate an event
drive+upload ./file --name NUpload a file
sheets+read --spreadsheet IDRead values
sheets+append --spreadsheet ID --values "a,b"Append a row
docs+writeAppend text to a document
chat+sendMessage a space
workflow+standup-report, +weekly-digest, +meeting-prepComposite digests

Discovery commands (full API surface):

gws <service> <resource> <method> --params '{"k":"v"}'   # query/path params
gws <service> <resource> <method> --json '{"k":"v"}'     # request body
gws schema gmail.users.messages.list                     # inspect any method
gws gmail --help                                         # live command list
  • Message metadata: request format: "metadata" plus metadataHeaders: ["Subject","From","Date"]; body parts are base64url in payload.body.data / payload.parts.
  • Gmail search uses standard q operators (is:unread, newer_than:7d, after:2026/07/01 before:2026/07/08).
  • Useful flags: --format json|table|yaml|csv, --page-all (NDJSON pagination), --output <path> (binary download), --upload <path>.

Safety Gates

  • Read freely. list/get/triage/agenda/read need no confirmation.
  • Confirm externally visible actions. Before gmail +send/+reply/+forward, chat +send, or creating calendar events that invite guests, restate the recipients, subject, and body summary; execute only after explicit approval.
  • Confirm destructive actions. Deleting mail, Drive files, or events, and modifying existing events or documents, require explicit approval with the target ID shown.
  • Least privilege. Request only the scopes the task needs during gws auth login; start read-only and expand. Never print credentials, tokens, or ~/.config/gws/ contents into chat output.
  • Timezone: +agenda uses the Google account timezone; pass --timezone explicitly when the user expects another zone.

Troubleshooting

SymptomCauseFix
Access blocked / access_deniedConsent screen in testing mode, account not a test userAdd the account under Google Auth Platform → Audience → Test users
Token refresh failsStale encrypted credentialsDelete ~/.config/gws/credentials.enc, re-run gws auth login
Scope/permission errorsScope not granted at loginRe-run gws auth login with the needed scopes (incremental)
Method not foundDiscovery document cached or new APIgws <service> --help; commands are generated at runtime from the live Discovery Service
No OAuth client / lost secretGoogle shows a client secret only once, at creationCreate a new Desktop client and download the JSON immediately — see references/setup-guide.md

References

  • references/setup-guide.md — from-zero install and OAuth setup: GCP project, consent screen, Desktop client, the secret-visible-once policy, test users, headless/CI credentials, and service accounts. Read it whenever gws auth status is not oauth2 or the user asks to install gws.

What ships with it: 1 file

4.0 KB alongside SKILL.md

references/

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.