用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/marktoda/everclaw --skill add-channel-gmail命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | add-channel-gmail |
| description | Set up Gmail as a messaging channel — Google OAuth2, credentials, token exchange, and verification |
Walk the user through connecting Gmail to everclaw via Google OAuth2. This skill is standalone — run it from /setup or anytime to add Gmail. This is the most involved channel setup.
Work through each phase in order. Use TaskCreate to track progress. Be autonomous: detect what's already done, only ask questions when a real choice is needed. Use the Read and Edit tools to modify .env. NEVER echo secrets to the terminal or pass them as bash arguments.
Check .env exists in the project root. If not, tell the user to run /setup first and stop.
Read .env and check if CHANNEL_GMAIL is already set.
AskUserQuestion:
Gmail is already configured (
CHANNEL_GMAILis set in.env). What would you like to do?
- Keep it — Skip to verification
- Reconfigure — Set up from scratch (will need to re-authorize)
data/auth/gmail/ to clear old credentials before proceeding.Walk the user through creating OAuth2 credentials. This has many steps but each is straightforward.
Tell the user:
Create a Google Cloud project and enable the Gmail API:
- Go to the Google Cloud Console
- Click the project dropdown at the top and select New Project
- Name it (e.g., "everclaw") and click Create
- Make sure the new project is selected
- Go to APIs & Services → Library (left sidebar)
- Search for Gmail API and click Enable
Configure the OAuth consent screen:
- Go to APIs & Services → OAuth consent screen
- Select External user type (unless you have a Google Workspace org)
- Fill in the required fields (app name, user support email, developer contact email)
- Click Save and Continue through the remaining steps
- Under Test users, add the Gmail address you want the bot to use
Create OAuth2 credentials:
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- Application type: Desktop app (or Web application if you prefer)
- Name it and click Create
- Click Download JSON to download the credentials file
Use AskUserQuestion:
Did you download the credentials JSON file? Paste the full path to the downloaded file (e.g.,
~/Downloads/client_secret_123.json).
Copy the credentials file to the auth directory:
mkdir -p data/auth/gmail
cp "<user_provided_path>" data/auth/gmail/credentials.json
Append CHANNEL_GMAIL=1 to .env using the Edit tool. If reconfiguring, replace the existing line.
This phase combines restart with the interactive OAuth2 flow.
Detect the deployment method:
docker-compose.yml exists in the project root.docker compose up --build — you need to see the terminal output for the OAuth URL."node src/index.ts."Important for Docker users: They need to run in foreground to see the OAuth URL.
After restart, the Gmail adapter will print an OAuth2 authorization URL and then throw an error (this is expected on first run). Walk the user through the token exchange:
Complete the OAuth2 authorization:
- Look in the logs for a URL starting with
https://accounts.google.com/o/oauth2/v2/auth?...- Open that URL in your browser
- Sign in with the Gmail account the bot should use
- Click Allow to grant access (you may see a "This app isn't verified" warning — click Advanced → Go to [app name])
- After authorization, you'll be redirected. Copy the authorization code from the URL or page.
- Exchange it for a token by running this command (replace the placeholders):
curl -s -d "code=AUTH_CODE&client_id=YOUR_CLIENT_ID&client_secret=YOUR_SECRET&redirect_uri=YOUR_REDIRECT_URI&grant_type=authorization_code" https://oauth2.googleapis.com/tokenYou can find your client_id, client_secret, and redirect_uri in
data/auth/gmail/credentials.json.
Use AskUserQuestion:
Paste the JSON response from the curl command (it contains access_token and refresh_token).
Read the response, validate it looks like a token response (has access_token), and save it:
# Write the token using the Write tool — do NOT echo it to the terminal
Use the Write tool to save the token JSON to data/auth/gmail/token.json.
Tell the user to restart the bot again. This time the Gmail adapter should connect successfully — look for "Gmail connected" in the logs.
Check if ALLOWED_CHAT_IDS is already configured in .env (uncommented and non-empty).
If not configured (first channel):
Walk the user through discovery mode:
gmail:sender@example.com. Check the bot's logs or outgoing email for this."AskUserQuestion to collect the chat ID.Edit tool to set ALLOWED_CHAT_IDS=<chat_id> in .env. If the line is commented out, uncomment and set it.If already configured (adding another channel):
AskUserQuestion to collect the chat ID.Edit tool to append the new ID to the existing ALLOWED_CHAT_IDS value (comma-separated).After updating, tell the user to restart again.
data/auth/gmail/token.json exists and contains a refresh_tokendata/auth/gmail/credentials.json is validALLOWED_CHAT_IDS contains the right prefixed ID (e.g., gmail:sender@example.com)Tell the user they can add more channels later with /add-channel-telegram, /add-channel-discord, /add-channel-slack, or /add-channel-whatsapp.