gws-auth
Google Workspace CLI authentication setup and management. Use when users need to set up OAuth credentials, authenticate with Google APIs, or troubleshoot authentication issues. Triggers: gws auth, google workspace setup, oauth, credentials, client id, api setup.
Best use case
gws-auth is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Google Workspace CLI authentication setup and management. Use when users need to set up OAuth credentials, authenticate with Google APIs, or troubleshoot authentication issues. Triggers: gws auth, google workspace setup, oauth, credentials, client id, api setup.
Teams using gws-auth should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/auth/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How gws-auth Compares
| Feature / Agent | gws-auth | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Google Workspace CLI authentication setup and management. Use when users need to set up OAuth credentials, authenticate with Google APIs, or troubleshoot authentication issues. Triggers: gws auth, google workspace setup, oauth, credentials, client id, api setup.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Google Workspace Auth (gws auth) `gws auth` manages OAuth2 authentication for all Google Workspace services. > **Disclaimer:** `gws` is not the official Google CLI. This is an independent, open-source project not endorsed by or affiliated with Google. ## Dependency Check **Before executing any `gws` command**, verify the CLI is installed: ```bash gws version ``` If not found, install: `go install github.com/omriariav/workspace-cli/cmd/gws@latest` ## Quick Command Reference | Task | Command | |------|---------| | Check auth status | `gws auth status` | | Login (all scopes) | `gws auth login` | | Login (specific services) | `gws auth login --services gmail,calendar,chat` | | Login with credentials | `gws auth login --client-id <id> --client-secret <secret>` | | Logout (revokes token) | `gws auth logout` | ## First-Time Setup If you haven't set up Google Cloud credentials yet, see the detailed setup guide: **[Setup Guide](references/setup-guide.md)** Quick summary: 1. Create a Google Cloud project 2. Enable the required Workspace APIs 3. Create OAuth 2.0 credentials (Desktop app type) 4. Set credentials via environment variables or config file 5. Run `gws auth login` ## Detailed Usage ### status — Check authentication status ```bash gws auth status ``` Shows whether you're authenticated, the current user email, and token expiry info. ### login — Authenticate with Google ```bash gws auth login [flags] ``` **Flags:** - `--client-id string` — OAuth client ID (overrides env/config) - `--client-secret string` — OAuth client secret (overrides env/config) - `--services string` — Comma-separated services to authorize (e.g. `gmail,calendar,chat`). Omit for all scopes. Opens a browser for Google OAuth consent. The token is stored at `~/.config/gws/token.json`. **Available services:** gmail, calendar, drive, docs, sheets, slides, tasks, chat, forms, contacts **Credential sources (in priority order):** 1. Command-line flags (`--client-id`, `--client-secret`) 2. Environment variables (`GWS_CLIENT_ID`, `GWS_CLIENT_SECRET`) 3. Config file (`~/.config/gws/config.yaml`) ### logout — Remove stored credentials ```bash gws auth logout ``` Revokes the token server-side with Google, then deletes the local token at `~/.config/gws/token.json`. ## Configuration ### Environment Variables ```bash export GWS_CLIENT_ID="your-client-id.apps.googleusercontent.com" export GWS_CLIENT_SECRET="your-client-secret" ``` ### Config File (`~/.config/gws/config.yaml`) ```yaml client_id: "your-client-id.apps.googleusercontent.com" client_secret: "your-client-secret" services: - gmail - calendar - chat ``` ## Token Management - Token stored at: `~/.config/gws/token.json` (atomic writes, file-locked) - Granted services tracked in: `~/.config/gws/granted_services.json` - Tokens auto-refresh when expired; refresh tokens preserved across re-auth - Scoped login: use `--services` to request only needed scopes (smaller consent screen) - Default services can be set in config.yaml: `services: [gmail, calendar, chat]` - To add more scopes, re-run `gws auth login --services gmail,calendar,chat,drive` - Logout revokes the token server-side before deleting locally ## Tips for AI Agents - Always check `gws auth status` before running any gws command to verify authentication - If auth fails, guide users to the setup guide at `references/setup-guide.md` - Credentials should NEVER be committed to version control or output in logs - The OAuth flow opens a browser — this requires a desktop environment or manual URL handling - Token refresh is automatic; if a command fails with auth errors, try `gws auth logout` then `gws auth login`
Related Skills
gws-tasks
Google Tasks CLI operations via gws. Use when users need to manage task lists, view/create/update/delete tasks, move tasks, or clear completed. Triggers: google tasks, task list, todo, task management.
gws-slides
Google Slides CLI operations via gws. Use when users need to create, read, or edit Google Slides presentations. Triggers: slides, presentation, google slides, deck.
gws-sheets
Google Sheets CLI operations via gws. Use when users need to read, write, or manage Google Sheets spreadsheets including cell values, rows, columns, sheets, sorting, merging, formatting, and find-replace. Triggers: sheets, spreadsheet, google sheets, cells, rows, columns, formulas, formatting.
gws-search
Google Custom Search CLI operations via gws. Use when users need to perform web searches using Google Programmable Search Engine. Triggers: google search, custom search, web search.
gws-keep
Google Keep CLI operations via gws. Use when users need to list, view, or create Google Keep notes. Triggers: keep, google keep, notes, sticky notes.
gws-groups
Google Groups CLI operations via gws. Use when users need to list groups or view group members. Triggers: groups, google groups, admin directory, group members.
gws-gmail
Google Gmail CLI operations via gws. Use when users need to list emails, read messages, send email, manage labels, drafts, attachments, batch operations, or trash messages. Triggers: gmail, email, inbox, send email, mail, labels, archive, trash, drafts, attachments.
gws-forms
Google Forms CLI operations via gws. Use when users need to get form metadata, retrieve form responses, create forms, or update forms. Triggers: google forms, form responses, survey, form data, create form, update form.
gws-drive
Google Drive CLI operations via gws. Use when users need to list, search, upload, download, manage files/folders, permissions, revisions, comments, shared drives, and more. Triggers: drive, files, upload, download, folders, google drive, file management, permissions, share, shared drives.
gws-docs
Google Docs CLI operations via gws. Use when users need to read, create, or edit Google Docs documents. Triggers: google docs, document, gdoc, word processing.
gws-contacts
Google Contacts CLI operations via gws. Use when users need to list, search, view, create, or delete contacts. Triggers: contacts, google contacts, people api, contact management.
gws-chat
Google Chat CLI operations via gws. Use when users need to list/create/manage chat spaces, read/send messages, manage members, track read state, handle attachments, or monitor space events. Triggers: google chat, gchat, chat spaces, chat messages.