oauth-setup
하는 일
이 스킬은 Gmail이나 다른 Google 서비스처럼 OAuth 로그인을 쓰는 계정을 연결하도록 AI를 안내합니다. 자신이 소유한 계정을 에이전트가 쓰게 하려는 사람들을 위한 스킬입니다.
사용하는 경우
- ✓에이전트가 내 Gmail이나 다른 Google 서비스에 연결되기를 원할 때.
- ✓OAuth 로그인을 쓰는 계정을 연결하고 싶을 때.
- ✓OAuth 연결이 리디렉션이나 권한 범위 오류로 실패할 때.
스킬 링크
https://github.com/spinabot/brigade/blob/main/skills/oauth-setup/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“에이전트가 저를 대신해 이메일을 보낼 수 있도록 제 Gmail 계정을 연결해 주세요. Google 클라이언트를 만드는 방법도 단계별로 안내해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 로그인 흐름을 시작하고 권한을 승인할 링크를 줍니다. 로컬 리스너가 승인 코드를 받아 로그인 토큰을 안전하게 저장하므로, 코드를 직접 옮겨 적을 필요가 없습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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.
자주 묻는 질문
어떤 종류의 Google 클라이언트가 필요한가요?
Google Cloud에서 데스크톱 앱 클라이언트를 만들라고 안내하며, 이는 로컬 로그인 리스너와 잘 맞습니다.
어떤 Gmail 권한을 쓰나요?
Gmail 보내기 권한을 쓰므로, 에이전트가 나를 대신해 메일을 보낼 수 있습니다.
코드를 붙여 넣어야 하나요?
아닙니다. 스킬은 로컬 리스너를 통해 승인 코드를 자동으로 받습니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 11k
- 순위
- #11730
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
1password
11k에이전트가 1Password 명령줄 도구를 설정하고 안전하게 로그인하도록 가르친 뒤, 필요할 때 저장된 비밀 정보를 읽거나 넣도록 합니다.
apple-reminders
11k에이전트가 터미널에서 Apple 미리 알림을 보고, 추가하고, 수정하고, 완료하고, 삭제하도록 돕습니다. 목록과 날짜 필터도 포함합니다.
bluebubbles
11k에이전트가 BlueBubbles를 통해 iMessage를 보내고 관리하도록 돕습니다. 문자, 첨부 파일, 탭백 반응, 수정, 그룹 설정을 포함합니다.
camsnap
11k에이전트가 이미 설정한 네트워크 보안 카메라에서 스냅샷을 찍고, 짧은 클립을 녹화하거나, 움직임을 감시하도록 돕습니다.