Loading...
Loading...
OpenClaw 中文官方技能库 — 翻译自 Clawdbot 官方技能,按场景分类整理,支持中文自然语言调用
npx skill4agent add aradotso/hermes-skills awesome-openclaw-skills-zhSkill by ara.so — Hermes Skills collection.
# Apple Mail 邮件客户端集成示例
技能名称: apple-mail
功能: 适用于 macOS 的 Apple Mail.app 集成
使用场景:
- 读取收件箱
- 搜索电子邮件
- 发送电子邮件
- 回复和管理消息# CalDAV 日历同步示例
技能名称: caldav-calendar
功能: 使用 vdirsyncer + khal 同步和查询 CalDAV 日历
支持平台:
- iCloud
- Google Calendar
- Fastmail
- Nextcloud# 克隆仓库
git clone https://github.com/clawdbot-ai/awesome-openclaw-skills-zh.git
cd awesome-openclaw-skills-zh
# 浏览 README 查看技能分类
cat README.md# 通过 OpenClaw CLI 安装技能(示例)
openclaw skill install clawdhub.com/skills/apple-mail# 例如:配置邮件相关的环境变量
export EMAIL_ADDRESS="user@example.com"
export EMAIL_PASSWORD="${EMAIL_PASSWORD}" # 从环境变量读取
export IMAP_HOST="imap.example.com"
export SMTP_HOST="smtp.example.com"# 在 Python 中调用示例
from openclaw import Agent
agent = Agent()
# 使用中文自然语言调用
agent.process("帮我搜索最近一周关于项目的邮件")
agent.process("创建一个明天下午3点的会议")
agent.process("查看今天的日程安排")# 使用 Apple Mail 技能
from openclaw.skills import AppleMailSkill
skill = AppleMailSkill()
# 搜索邮件
emails = skill.search_emails(
query="项目进展",
from_date="2024-01-01"
)
# 发送邮件
skill.send_email(
to="colleague@example.com",
subject="项目更新",
body="本周项目进展如下..."
)# 使用 Google Workspace 技能(无需 Cloud Console)
from openclaw.skills import GoogleWorkspaceSkill
skill = GoogleWorkspaceSkill()
# OAuth 登录
skill.authenticate()
# 读取 Gmail
messages = skill.gmail.get_messages(query="is:unread")
# 操作 Google Calendar
events = skill.calendar.get_events(
time_min="2024-01-01T00:00:00Z",
time_max="2024-01-31T23:59:59Z"
)
# 访问 Google Drive
files = skill.drive.list_files(query="type='application/pdf'")# 使用 Microsoft 365 技能
from openclaw.skills import Microsoft365Skill
skill = Microsoft365Skill()
# 管理 Outlook 日历
skill.calendar.create_event(
subject="团队会议",
start="2024-01-15T14:00:00",
end="2024-01-15T15:00:00",
attendees=["team@example.com"]
)
# 发送邮件
skill.mail.send(
to="manager@example.com",
subject="周报",
body="本周工作总结..."
)# 使用 Frigate NVR 监控技能
from openclaw.skills import FrigateSkill
skill = FrigateSkill(
host="http://frigate.local",
username="${FRIGATE_USERNAME}",
password="${FRIGATE_PASSWORD}"
)
# 获取摄像头快照
snapshot = skill.get_snapshot(camera="front_door")
# 检索运动事件
events = skill.get_events(
camera="driveway",
after="2024-01-01"
)# ~/.openclaw/skills.yaml
skills:
- name: apple-mail
enabled: true
config:
default_account: "work"
auto_archive: true
- name: google-workspace-mcp
enabled: true
config:
scopes:
- gmail.readonly
- calendar
- drive.readonly
- name: microsoft-365-cli
enabled: true
config:
tenant_id: "${AZURE_TENANT_ID}"
client_id: "${AZURE_CLIENT_ID}"# ~/.openclaw/.env
# 邮件服务配置
EMAIL_ADDRESS=user@example.com
EMAIL_PASSWORD=your_app_password
IMAP_HOST=imap.gmail.com
SMTP_HOST=smtp.gmail.com
# Microsoft 365
AZURE_TENANT_ID=your_tenant_id
AZURE_CLIENT_ID=your_client_id
AZURE_CLIENT_SECRET=your_client_secret
# Google Workspace(使用 OAuth,无需 API Key)
# 仅需通过浏览器登录
# 其他服务
DEX_API_KEY=your_dex_api_key
FRIGATE_USERNAME=admin
FRIGATE_PASSWORD=your_password# custom_skill.py
from openclaw.skill import Skill
class CustomEmailSkill(Skill):
"""自定义邮件处理技能"""
name = "custom-email-processor"
description = "高级邮件自动化处理"
def __init__(self):
super().__init__()
self.triggers = [
"处理待办邮件",
"自动分类邮件",
"智能回复邮件"
]
def process_inbox(self, filters=None):
"""处理收件箱"""
emails = self.fetch_emails(filters)
for email in emails:
# 使用 AI 分类
category = self.classify_email(email)
# 自动处理
if category == "urgent":
self.notify_user(email)
elif category == "spam":
self.archive_email(email)
else:
self.auto_reply(email)
def classify_email(self, email):
"""使用 AI 分类邮件"""
prompt = f"""
分类以下邮件:
主题: {email.subject}
发件人: {email.from_address}
内容: {email.body[:500]}
类别: urgent/normal/spam
"""
return self.ai_classify(prompt)# 检查 OpenClaw 版本
openclaw --version
# 更新技能库
openclaw skill update
# 清除缓存重新安装
openclaw skill cache clear
openclaw skill install <skill-name># 检查环境变量是否正确加载
openclaw config show
# 重新加载配置
source ~/.openclaw/.env
openclaw config reload# 某些技能需要额外授权
from openclaw import Agent
agent = Agent()
# 授权 Gmail 访问
agent.authorize_skill("google-workspace-mcp", scopes=[
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/calendar"
])# 配置中文语言模型
agent = Agent(
language="zh-CN",
model="gpt-4-turbo",
temperature=0.3 # 降低温度提高准确性
)from openclaw import Agent, SkillChain
agent = Agent()
# 创建技能链
chain = SkillChain([
"apple-mail-search", # 搜索邮件
"email-template-gen", # 生成回复
"apple-mail" # 发送回复
])
# 执行技能链
result = agent.execute_chain(chain, input={
"query": "项目相关邮件",
"action": "auto_reply"
})from openclaw.scheduler import SkillScheduler
scheduler = SkillScheduler()
# 每日早晨汇总邮件
scheduler.add_job(
skill="morning-email-rollup",
trigger="cron",
hour=8,
minute=0
)
# 每小时检查重要邮件
scheduler.add_job(
skill="email-prompt-injection-defense",
trigger="interval",
hours=1
)from openclaw.exceptions import SkillError
try:
result = agent.process("发送邮件给团队")
except SkillError as e:
print(f"技能执行失败: {e}")
# 回退到其他技能
result = agent.process("使用备用邮件服务发送")git checkout -b feature/new-skillgit commit -m "添加新技能: XXX"git push origin feature/new-skill