Nhảy tới nội dung

🧙 Onboarding Wizard Chi Tiết

Onboarding Wizard là công cụ giúp bạn cấu hình OpenClaw một cách tự động và an toàn. Trang này giải thích chi tiết từng bước của wizard.

Khởi động Wizard

openclaw onboard --install-daemon
Các tùy chọn
- `--install-daemon`: Cài đặt service chạy nền (launchd trên macOS, systemd trên Linux) - `--skip-auth`: Bỏ qua setup authentication - `--skip-channels`: Bỏ qua setup channels

Bước 1: Chọn Gateway Mode

Wizard sẽ hỏi bạn muốn chạy Gateway ở chế độ nào:

ModeMô tảPhù hợp cho
LocalGateway chạy trên localhostSử dụng cá nhân, testing
RemoteGateway expose ra internetVPS, truy cập từ xa

Local Mode (Khuyên dùng cho người mới):

  • Chỉ truy cập được từ máy local
  • An toàn hơn, không cần expose port
  • Dashboard tại http://127.0.0.1:18789/

Bước 2: Cấu hình Authentication

2.1 Anthropic API Key (Khuyên dùng)

Cách đơn giản nhất để bắt đầu:

  1. Truy cập console.anthropic.com
  2. Đăng ký / Đăng nhập
  3. Vào Settings → API Keys → Create Key
  4. Copy key và paste vào wizard
? Enter your Anthropic API key: sk-ant-xxxxx
Bảo mật API Key
- Key được lưu mã hóa tại `~/.openclaw/credentials/` - **KHÔNG** commit vào Git - Đặt **Usage Limit** trên Anthropic Console để tránh chi phí bất ngờ

2.2 OAuth (Tùy chọn nâng cao)

OpenClaw hỗ trợ OAuth cho một số provider:

openclaw configure --section auth

Nơi lưu OAuth credentials:

  • Legacy: ~/.openclaw/credentials/oauth.json
  • Auth profiles: ~/.openclaw/agents/<agentId>/agent/auth-profiles.json

2.3 Claude Setup Token

Nếu bạn đã có Claude Code subscription:

claude setup-token

Wizard sẽ tự động detect và reuse credentials.


Bước 3: Cấu hình Channels

Wizard sẽ hỏi bạn muốn kết nối với platforms nào:

```bash ? Setup WhatsApp? (Y/n): Y ``` QR code sẽ hiện trong terminal. Quét bằng WhatsApp trên điện thoại. **Lưu ý:** WhatsApp yêu cầu Node.js runtime (không dùng Bun).

Bước 4: Pairing Defaults

Pairing là cơ chế bảo mật quan trọng của OpenClaw. Wizard sẽ hỏi:

? Default DM policy: (Use arrow keys)
❯ pairing (recommended - approve each user)
allowlist (only specific users)
open (dangerous - anyone can chat)
disabled (no DMs)

Chọn pairing (mặc định) để:

  • Chỉ những người được bạn phê duyệt mới chat được với bot
  • Ngăn chặn spam và lạm dụng API
  • Có audit trail đầy đủ

Bước 5: Workspace & Skills

Cấu hình Workspace

? Workspace directory: ~/.openclaw/workspace

Đây là thư mục mà Agent có thể truy cập để đọc/ghi file.

Cài đặt Skills (Optional)

Skills là các khả năng mở rộng for Agent:

? Install default skills? (Y/n): Y

Default skills bao gồm:

  • Web search (cần Brave API key)
  • File management
  • Code execution (sandboxed)

Bước 6: Daemon Installation

? Install as background service? (Y/n): Y

Điều này sẽ:

- Tạo `~/Library/LaunchAgents/com.openclaw.gateway.plist` - Gateway tự chạy khi login - Quản lý bằng `launchctl`

Kiểm tra sau Onboarding

Health Check

openclaw status
openclaw health

Security Audit

openclaw security audit --deep

Verify Gateway

openclaw gateway status

Output mong đợi:

Gateway Status: ✅ Running
- Port: 18789
- Uptime: 2 hours
- Connected channels: 2
- Active sessions: 1

Nơi lưu cấu hình

LoạiĐường dẫn
Config chính~/.openclaw/config.json
Credentials~/.openclaw/credentials/
Agent configs~/.openclaw/agents/<id>/
Logs~/.openclaw/logs/
Workspace~/.openclaw/workspace/

Cấu hình thủ công (Nâng cao)

Nếu bạn muốn bypass wizard và config bằng tay:

# Mở file config
vim ~/.openclaw/config.json

Ví dụ cấu hình:

{
"gateway": {
"port": 18789,
"auth": {
"token": "your-generated-token"
}
},
"routing": {
"agents": {
"main": {
"workspace": "~/.openclaw/workspace",
"sandbox": {
"mode": "off"
}
}
}
},
"channels": {
"whatsapp": { "enabled": true },
"telegram": { "enabled": true, "token": "..." }
}
}

Troubleshooting

Wizard bị crash

# Reset và chạy lại
rm -rf ~/.openclaw/
openclaw onboard --install-daemon

API Key không accept

  • Kiểm tra key có đúng format sk-ant-...
  • Kiểm tra key chưa bị revoke
  • Kiểm tra account có payment method

Daemon không start

# macOS
launchctl list | grep openclaw

# Linux
systemctl --user status openclaw-gateway

# Manual start
openclaw gateway --port 18789 --verbose

Next Steps


Cần hỗ trợ? Tham gia Discord hoặc Telegram