oauth-setup
यह क्या करती है
यह स्किल OAuth साइन-इन वाले खाते को जोड़ने में मार्गदर्शन देती है, जैसे Gmail या दूसरी Google सेवाएँ। यह उन लोगों के लिए है जो चाहते हैं कि उनका एजेंट उनके अपने खाते का इस्तेमाल करे।
कब इस्तेमाल करें
- ✓जब आप चाहते हैं कि आपका एजेंट आपके Gmail या किसी दूसरी Google सेवा से जुड़े।
- ✓जब आप OAuth साइन-इन वाला कोई भी खाता जोड़ना चाहते हैं।
- ✓जब OAuth कनेक्शन redirect या scope की त्रुटि से विफल हो जाए।
Skill का लिंक
https://github.com/spinabot/brigade/blob/main/skills/oauth-setup/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरा Gmail खाता जोड़िए ताकि एजेंट मेरे लिए ईमेल भेज सके, और मुझे Google क्लाइंट बनाने के चरण भी समझाइए।”
हर हफ़्ते 5 नई skills, 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 में Desktop app क्लाइंट बनाने को कहती है, जो उसके लोकल साइन-इन लिसनर के साथ काम करता है।
कौन सी 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
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
1password
11kयह आपके एजेंट को 1Password कमांड लाइन टूल सेट करना और सुरक्षित तरीके से साइन इन करना सिखाती है, फिर ज़रूरत पर संग्रहीत सीक्रेट पढ़ने या डालने देती है।
apple-reminders
11kयह आपके एजेंट को टर्मिनल से Apple Reminders देखने, जोड़ने, बदलने, पूरा करने और हटाने देती है, जिसमें सूचियाँ और तारीख के फ़िल्टर भी शामिल हैं।
bluebubbles
11kयह आपके एजेंट को BlueBubbles के ज़रिए iMessage भेजने और संभालने देती है, जिसमें टेक्स्ट, अटैचमेंट, टैपबैक रिएक्शन, संपादन और ग्रुप सेटिंग्स शामिल हैं।
camsnap
11kयह आपके एजेंट को उन नेटवर्क सिक्योरिटी कैमरों से स्नैपशॉट, छोटी क्लिप लेने या मूवमेंट पर नज़र रखने देती है, जो आप पहले से सेट कर चुके हैं।
मिलती-जुलती skills
reverse-engineer-anything
422kयह आपके एजेंट को REA टूल से शिप हुई ऐप्स और पैकेज को अंदर से समझने, वर्ज़न की तुलना करने या दोबारा बनाने में मदद करती है।
1password
394kयह आपके एजेंट को 1Password CLI सेट करने, साइन इन करने और सीक्रेट्स की वैल्यू चैट में छापे बिना उन्हें पढ़ने या इस्तेमाल करने में मदद करती है।
healthcheck
394kयह आपके एजेंट को उस कंप्यूटर या सर्वर का सुरक्षा ऑडिट करने देती है जिस पर OpenClaw चलता है, जिसमें SSH, firewall, अपडेट और बैकअप शामिल हैं, और फिर सुरक्षित सुधार सुझाती है।