openclaw
agents
skills
OpenClaw 智能体快速入门指南
2026-03-26
ayeah
OpenClaw 是一个开源的 AI 智能体运行时框架,让你能够快速构建、部署和管理个性化的 AI 助手。
# 安装 Node.js (v20+)
node -v
# 安装 pnpm
npm install -g pnpm
git clone https://github.com/openclaw/openclaw.git
cd openclaw
pnpm install
cp .env.example .env
# 编辑 .env 文件,填入你的 API 密钥
pnpm run dev
智能体是 OpenClaw 的核心,它是一个具有特定能力和行为的 AI 助手。
技能是智能体的"超能力",让 AI 能够执行特定任务,如:
记忆系统让智能体能够记住重要信息,提供个性化的服务。
让我们创建一个简单的天气查询技能:
// skills/weather.ts
export async function getWeather(city: string) {
const response = await fetch(`https://wttr.in/${city}?format=j1`);
const data = await response.json();
return data.current_condition[0].temp_C;
}