# OpenClaw 入门第一篇:安装配置与常用命令完整教程
从零开始安装配置 OpenClaw,新手看完就能上手。
---
## 1.1 一键安装(macOS/Linux)
```bash
# 一键安装脚本
curl -fsSL https://raw.githubusercontent.com/openclaw/openclaw/main/install.sh | bash
```
安装完成后需要重启终端或执行:
```bash
source ~/.zshrc
# 如果使用 bash
source ~/.bashrc
```
## 1.2 验证安装
```bash
# 检查版本
openclaw --version
# 检查状态
openclaw status
```
## 1.3 配置 API Key
OpenClaw 需要配置大模型 API,以火山引擎为例:
```bash
# 编辑配置文件
openclaw config edit
```
在配置文件中添加:
```json
{
"models": {
"default": "volcengine/ark-code-latest",
"volcengine": {
"accessKeyId": "你的AK",
"secretAccessKey": "你的SK",
"endpoint": "https://ark.cn-beijing.volces.com/api/v3"
}
}
}
```
保存后重启网关:
```bash
openclaw gateway restart
```
## 1.4 启动网关
```bash
# 启动网关
openclaw gateway start
# 查看状态
openclaw gateway status
```
## 1.5 常用命令汇总
| 命令 | 用途 |
|------|------|
| `openclaw status` | 查看系统状态 |
| `openclaw gateway start` | 启动网关 |
| `openclaw gateway stop` | 停止网关 |
| `openclaw gateway restart` | 重启网关 |
| `openclaw config get` | 查看当前配置 |
| `openclaw config edit` | 编辑配置 |
| `openclaw skills list` | 查看已安装技能 |
| `openclaw skills check` | 检查技能完整性 |
夜雨聆风