oauth-setup
What it does
This skill guides the AI through connecting an account that uses OAuth sign-in, such as Gmail or other Google services. It is for people who want their agent to use an account they own.
When to use it
- ✓When you want your agent to connect to your Gmail or another Google service.
- ✓When you want to connect any account that uses OAuth sign-in.
- ✓When an OAuth connection fails with a redirect or scope error.
Skill link
https://github.com/spinabot/brigade/blob/main/skills/oauth-setup/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Connect my Gmail account so the agent can send emails for me, and walk me through creating the Google client.”
5 new skills a week. 1 minute to read.
How it works
The AI starts the sign-in flow and gives you a link to approve access. It captures the approval code on a local listener and stores the sign-in tokens securely, so codes do not need to be copied by hand.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
OAuth setup
Use the oauth_authorize tool — NEVER hand-roll an http listener in bash. It opens a one-shot loopback listener on a free port (no EADDRINUSE, no port juggling), captures the code, and seals the tokens into the credential store.
The two mistakes to avoid (they cost a whole session once)
- Use a Desktop-app OAuth client, not a Web client. In Google Cloud Console → Credentials → Create OAuth client ID → Application type: Desktop app. Desktop clients accept ANY
http://127.0.0.1:<port>loopback redirect with no redirect-URI registration. A Web client requires the exact redirect URI pre-registered, which is what causesredirect_uri_mismatch. - Use the real scope. Gmail send is
https://www.googleapis.com/auth/gmail.send(NOThttps://gmail.com/..., which doesn't exist). Addopenid https://www.googleapis.com/auth/userinfo.emailif you want the account address auto-filled.
Flow
- Ask the operator to create a Desktop-app OAuth client (Gmail API enabled, consent screen in Testing with themselves as a test user) and paste the client id + secret.
- Start the flow:
oauth_authorize({ action: "start", provider: "google-gmail", authorizationEndpoint: "https://accounts.google.com/o/oauth2/v2/auth", tokenEndpoint: "https://oauth2.googleapis.com/token", userInfoEndpoint: "https://www.googleapis.com/oauth2/v3/userinfo", clientId: "<id>", clientSecret: "<secret>", scopes: ["https://www.googleapis.com/auth/gmail.send", "openid", "https://www.googleapis.com/auth/userinfo.email"], extraAuthParams: { access_type: "offline", prompt: "consent" } })access_type=offline+prompt=consentare required for a refresh token (otherwise re-auth is needed when the access token expires). - Send the operator the returned
authUrlto click. - Await the redirect — it exchanges the code and seals the tokens:
If it returns statusoauth_authorize({ action: "await", flowId: "<flowId from start>" })pending, the operator hasn't clicked yet — tell them, then callawaitagain.
Using a connected account (sending mail)
The tokens are sealed in the credential store — you can't read them from a file or the DB, and you shouldn't try. To use a connected account:
- Check what's connected:
oauth_authorize({ action: "status" })→ lists each account (provider, email, scopes, expiry). No secrets. - Get a usable token:
oauth_authorize({ action: "token", provider: "google-gmail" })→ returnsaccessToken. It auto-refreshes from the sealed refresh token when the old one expired, so you always get a live token. (Passprovideronly if more than one account is connected.) - Call the API with it. Gmail send:
POST https://gmail.googleapis.com/gmail/v1/users/me/messages/send, headerAuthorization: Bearer <accessToken>, body{ "raw": "<base64url RFC-822 message>" }.
Never cat the credential store, grep for the token, or hand-roll a refresh — action:"token" is the only retrieval path, and it keeps the refresh token + client secret sealed.
FAQ
What type of Google client do I need?
The skill asks you to create a Desktop app client in Google Cloud, which works with its local sign-in listener.
Which Gmail permission does it use?
It uses the Gmail send permission, so the agent can send mail on your behalf.
Do I need to paste a code?
No. The skill captures the approval code automatically through a local listener.
Details
Original description by the author
Connect an OAuth 2.0 service (Gmail, Google APIs, etc.) using the built-in oauth_authorize tool — get a click-to-authorize link, auto-capture the code, and seal the tokens. Use whenever the operator asks to connect Gmail / a Google API / any OAuth account.
repo: spinabot/brigade
Popularity
- GitHub stars
- 11k
- Ranking position
- #11730
- License
- MIT
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
1password
11kTeaches your agent to set up the 1Password command line tool and sign in safely, then read or inject stored secrets when they are needed.
apple-reminders
11kLets your agent view, add, edit, complete and delete Apple Reminders from the terminal, including lists and date filters.
bluebubbles
11kLets your agent send and manage iMessages through BlueBubbles, including texts, attachments, tapback reactions, edits and group settings.
camsnap
11kLets your agent take snapshots, short clips or watch for motion from network security cameras that you have already set up.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.