feat: add one-line install module (curl | bash / irm | iex)
New install/ module for network-based installation without USB: - install.sh: Mac/Linux 7-step installer (Node.js + OpenClaw + QQ plugin + 10 CN skills + interactive model config + launcher) - install.ps1: Windows PowerShell equivalent - All downloads via npmmirror.com China mirrors - 10 AI model choices with Chinese interactive menu (default DeepSeek) - Scripts copied to website/ for Vercel hosting at u-claw.org/install.sh Updated guide.html with dedicated "一键在线安装" page section and quickstart integration.
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -35,3 +35,6 @@ u-claw-app/resources/runtime/
|
||||
|
||||
# ── Bootable USB build artifacts (scripts are tracked, downloads are not) ──
|
||||
bootable/.download-cache/
|
||||
|
||||
# ── Install module cache ──
|
||||
install/.download-cache/
|
||||
|
||||
@@ -16,10 +16,11 @@ U 盘 = 插上就能用
|
||||
|
||||
The repo is NOT a "build tool" or "generator" — it IS the USB structure. `setup.sh` only fills in large deps that can't go in git. After `setup.sh`, the `portable/` folder is directly copyable to a USB drive.
|
||||
|
||||
Three distribution forms:
|
||||
Four distribution forms:
|
||||
1. **Portable USB** (`portable/`): Run from USB on existing Mac/Windows, zero install.
|
||||
2. **Electron desktop app** (`u-claw-app/`): Install-to-computer version, packaged as DMG/EXE.
|
||||
3. **Bootable Linux USB** (`bootable/`): Ventoy + Ubuntu 24.04 — boots any x86_64 PC from USB, no OS needed.
|
||||
4. **One-line install** (`install/`): `curl | bash` or `irm | iex` — download and install from network, no USB needed.
|
||||
|
||||
## Development Commands
|
||||
|
||||
@@ -68,8 +69,14 @@ bootable/ Linux 可启动 U 盘模块(完全独立,不依赖其他
|
||||
linux-setup/ — setup-openclaw.sh 安装到 /opt/u-claw/
|
||||
独立仓库镜像: github.com/dongsheng123132/u-claw-linux
|
||||
|
||||
install/ 一键在线安装模块(curl | bash / irm | iex)
|
||||
install.sh (Mac/Linux) + install.ps1 (Windows)
|
||||
7 步流程: 系统检测 → Node.js → OpenClaw → QQ插件 → 技能 → 模型配置 → 启动脚本
|
||||
安装到 ~/.uclaw/,与 Mac-Install.command 结果相同
|
||||
|
||||
website/ Static HTML deployed to u-claw.org via Vercel
|
||||
vercel.json sets outputDirectory: "website"
|
||||
install.sh / install.ps1 — 复制自 install/,供 curl 下载
|
||||
```
|
||||
|
||||
Both portable and desktop versions auto-find a free port in range 18789–18799 and start the OpenClaw gateway. On first run, they detect whether a model is configured — if not, they open Config.html; otherwise, they open the dashboard.
|
||||
|
||||
32
README.md
32
README.md
@@ -21,6 +21,22 @@
|
||||
|
||||
> 📖 **[完整教程](https://u-claw.org/tutorial.html)** — 从零开始的手工安装指南、模型配置、聊天平台接入,小白也能看懂。
|
||||
|
||||
### 一键安装(推荐)
|
||||
|
||||
不需要 U 盘,一行命令直接装到电脑:
|
||||
|
||||
```bash
|
||||
# Mac / Linux
|
||||
curl -fsSL https://u-claw.org/install.sh | bash
|
||||
|
||||
# Windows (PowerShell 管理员)
|
||||
irm https://u-claw.org/install.ps1 | iex
|
||||
```
|
||||
|
||||
自动完成: Node.js 下载 → OpenClaw 安装 → 10 个中国技能 → 模型配置 → 启动脚本生成。全程国内镜像,无需翻墙。
|
||||
|
||||
详见 [`install/README.md`](install/README.md)。
|
||||
|
||||
### 快速开始:制作便携版 U 盘
|
||||
|
||||
```bash
|
||||
@@ -194,6 +210,22 @@ The codebase itself is the USB file skeleton. Run `setup.sh` to download large d
|
||||
|
||||
> 📖 **[Full Tutorial](https://u-claw.org/tutorial.html)** — Step-by-step manual installation, model setup, chat platform integration.
|
||||
|
||||
### One-Line Install (Recommended)
|
||||
|
||||
No USB needed — install directly to your computer:
|
||||
|
||||
```bash
|
||||
# Mac / Linux
|
||||
curl -fsSL https://u-claw.org/install.sh | bash
|
||||
|
||||
# Windows (PowerShell as Admin)
|
||||
irm https://u-claw.org/install.ps1 | iex
|
||||
```
|
||||
|
||||
Automatically downloads Node.js, installs OpenClaw, configures 10 Chinese-optimized skills, and sets up your AI model. All downloads use China mirrors.
|
||||
|
||||
See [`install/README.md`](install/README.md) for details.
|
||||
|
||||
### Quick Start: Build a Portable USB
|
||||
|
||||
```bash
|
||||
|
||||
119
install/README.md
Normal file
119
install/README.md
Normal file
@@ -0,0 +1,119 @@
|
||||
# U-Claw 一键安装 / One-Line Install
|
||||
|
||||
> 一行命令安装 OpenClaw + 技能包 + 模型配置
|
||||
> One command to install OpenClaw + skills + model config
|
||||
|
||||
## 安装 / Install
|
||||
|
||||
### Mac / Linux
|
||||
|
||||
```bash
|
||||
curl -fsSL https://u-claw.org/install.sh | bash
|
||||
```
|
||||
|
||||
### Windows (PowerShell 管理员)
|
||||
|
||||
```powershell
|
||||
irm https://u-claw.org/install.ps1 | iex
|
||||
```
|
||||
|
||||
### 本地运行
|
||||
|
||||
```bash
|
||||
# Mac/Linux
|
||||
bash install/install.sh
|
||||
|
||||
# Windows
|
||||
powershell -ExecutionPolicy Bypass -File install\install.ps1
|
||||
```
|
||||
|
||||
## 安装流程 (7 步)
|
||||
|
||||
| 步骤 | 内容 | 说明 |
|
||||
|------|------|------|
|
||||
| 1 | Banner + 系统检测 | 自动识别 OS/Arch |
|
||||
| 2 | Node.js v22 | 安装到 `~/.uclaw/runtime/`,系统有 v20+ 则复用 |
|
||||
| 3 | OpenClaw | npm 安装到 `~/.uclaw/core/` |
|
||||
| 4 | QQ 插件 | 非致命,失败不影响主功能 |
|
||||
| 5 | 10 个中国技能 | 小红书、B站、微博等内容创作技能 |
|
||||
| 6 | 模型配置 | 中文交互菜单,默认 DeepSeek |
|
||||
| 7 | 启动脚本 + 验证 | 生成 start.command / start.bat |
|
||||
|
||||
## 支持的 AI 模型
|
||||
|
||||
### 国内(无需翻墙)
|
||||
|
||||
| 编号 | 模型 | 说明 |
|
||||
|------|------|------|
|
||||
| 1 | DeepSeek | ⭐ 推荐,性价比最高 |
|
||||
| 2 | Kimi/月之暗面 | 长文档 |
|
||||
| 3 | 通义千问 | 有免费额度 |
|
||||
| 4 | 智谱GLM | 学术场景 |
|
||||
| 5 | MiniMax | 多模态 |
|
||||
| 6 | 豆包 | 火山引擎 |
|
||||
| 7 | 硅基流动 | 聚合多模型 |
|
||||
|
||||
### 海外
|
||||
|
||||
| 编号 | 模型 |
|
||||
|------|------|
|
||||
| 8 | Claude |
|
||||
| 9 | GPT |
|
||||
|
||||
### 本地
|
||||
|
||||
| 编号 | 模型 |
|
||||
|------|------|
|
||||
| 10 | Ollama |
|
||||
|
||||
## 安装目录结构
|
||||
|
||||
```
|
||||
~/.uclaw/
|
||||
├── runtime/node-{platform}/ # Node.js v22
|
||||
├── core/ # OpenClaw + QQ 插件
|
||||
│ ├── package.json
|
||||
│ └── node_modules/
|
||||
│ └── openclaw/skills/ ← 技能在这里
|
||||
├── data/
|
||||
│ ├── .openclaw/openclaw.json ← 模型配置
|
||||
│ ├── memory/ ← AI 记忆
|
||||
│ └── backups/ ← 备份
|
||||
├── start.command (Mac) ← 启动脚本
|
||||
└── start.bat (Windows) ← 启动脚本
|
||||
```
|
||||
|
||||
## 技术细节
|
||||
|
||||
- **Node.js**: 只装到 `~/.uclaw/runtime/`,不动系统 Node;系统已有 v20+ 则复用
|
||||
- **镜像**: 全走 `npmmirror.com`(Node 二进制 + npm 包),国内无需翻墙
|
||||
- **Windows 编码**: `chcp 65001` + UTF8 输出确保中文显示
|
||||
- **管道模式**: `curl | bash` 时自动跳过交互,使用默认配置
|
||||
- **卸载**: `rm -rf ~/.uclaw` (Mac/Linux) 或删除 `%USERPROFILE%\.uclaw` (Windows)
|
||||
|
||||
## 包含技能
|
||||
|
||||
| 技能 | 用途 |
|
||||
|------|------|
|
||||
| xiaohongshu-writer | 小红书笔记写作 |
|
||||
| bilibili-helper | B站视频优化 |
|
||||
| weibo-poster | 微博内容创作 |
|
||||
| wechat-article | 微信公众号文章 |
|
||||
| zhihu-writer | 知乎回答/文章 |
|
||||
| douyin-script | 抖音短视频脚本 |
|
||||
| china-search | 国内搜索引擎 |
|
||||
| china-translate | 中英互译 |
|
||||
| china-weather | 天气查询 |
|
||||
| deepseek-helper | DeepSeek API 助手 |
|
||||
|
||||
## 与其他分发形式的关系
|
||||
|
||||
```
|
||||
install/ ← 一键在线安装(本模块)
|
||||
portable/ ← U 盘便携版
|
||||
u-claw-app/ ← Electron 桌面版
|
||||
bootable/ ← Linux 可启动 U 盘
|
||||
```
|
||||
|
||||
install/ 安装的结果与 portable/ 的 Mac-Install.command 相同,
|
||||
区别是不需要 U 盘,直接从网络下载所有组件。
|
||||
628
install/install.ps1
Normal file
628
install/install.ps1
Normal file
@@ -0,0 +1,628 @@
|
||||
# ============================================================
|
||||
# U-Claw 一键安装脚本 (Windows PowerShell)
|
||||
# 用法: irm https://u-claw.org/install.ps1 | iex
|
||||
# 或: powershell -ExecutionPolicy Bypass -File install.ps1
|
||||
# ============================================================
|
||||
|
||||
# 编码 + 执行策略
|
||||
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
||||
$OutputEncoding = [System.Text.Encoding]::UTF8
|
||||
try { chcp 65001 | Out-Null } catch {}
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force -ErrorAction SilentlyContinue
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# ---- 常量 ----
|
||||
$UCLAW_DIR = "$env:USERPROFILE\.uclaw"
|
||||
$RUNTIME_DIR = "$UCLAW_DIR\runtime"
|
||||
$CORE_DIR = "$UCLAW_DIR\core"
|
||||
$DATA_DIR = "$UCLAW_DIR\data"
|
||||
$CONFIG_PATH = "$DATA_DIR\.openclaw\openclaw.json"
|
||||
$NODE_VERSION = "v22.14.0"
|
||||
$MIRROR = "https://registry.npmmirror.com"
|
||||
$NODE_MIRROR = "https://npmmirror.com/mirrors/node"
|
||||
|
||||
# ---- 颜色函数 ----
|
||||
function Write-Green($msg) { Write-Host $msg -ForegroundColor Green }
|
||||
function Write-Cyan($msg) { Write-Host $msg -ForegroundColor Cyan }
|
||||
function Write-Yellow($msg) { Write-Host $msg -ForegroundColor Yellow }
|
||||
function Write-Red($msg) { Write-Host $msg -ForegroundColor Red }
|
||||
|
||||
# ============================================================
|
||||
# Step 1: Banner + 系统检测
|
||||
# ============================================================
|
||||
Clear-Host
|
||||
Write-Host ""
|
||||
Write-Cyan " ╔══════════════════════════════════════════╗"
|
||||
Write-Cyan " ║ 🦞 U-Claw 一键安装 (Windows) ║"
|
||||
Write-Cyan " ║ 让 AI 助手一行命令装好 ║"
|
||||
Write-Cyan " ╚══════════════════════════════════════════╝"
|
||||
Write-Host ""
|
||||
|
||||
# 系统检测
|
||||
$ARCH = $env:PROCESSOR_ARCHITECTURE
|
||||
if ($ARCH -eq "AMD64" -or $ARCH -eq "x86_64") {
|
||||
$PLATFORM = "win-x64"
|
||||
Write-Green " 系统: Windows x64 ✓"
|
||||
} elseif ($ARCH -eq "ARM64") {
|
||||
$PLATFORM = "win-arm64"
|
||||
Write-Green " 系统: Windows ARM64 ✓"
|
||||
} else {
|
||||
Write-Red " 不支持的架构: $ARCH"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host " 安装目录: $UCLAW_DIR" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
# 检查已有安装
|
||||
if (Test-Path "$CORE_DIR\node_modules\openclaw") {
|
||||
Write-Yellow " 检测到已有安装: $UCLAW_DIR"
|
||||
$overwrite = Read-Host " 覆盖安装?(y/n) [y]"
|
||||
if ($overwrite -eq "n" -or $overwrite -eq "N") {
|
||||
Write-Host " 已取消" -ForegroundColor DarkGray
|
||||
exit 0
|
||||
}
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
# 创建目录
|
||||
New-Item -ItemType Directory -Force -Path $RUNTIME_DIR | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path $CORE_DIR | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path "$DATA_DIR\.openclaw" | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path "$DATA_DIR\memory" | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path "$DATA_DIR\backups" | Out-Null
|
||||
|
||||
# ============================================================
|
||||
# Step 2: Node.js v22 安装
|
||||
# ============================================================
|
||||
Write-Host " [1/7] 安装 Node.js $NODE_VERSION ..." -ForegroundColor White
|
||||
|
||||
$NODE_INSTALL_DIR = "$RUNTIME_DIR\node-$PLATFORM"
|
||||
$INSTALL_NODE = ""
|
||||
$INSTALL_NPM = ""
|
||||
$USE_SYSTEM_NODE = $false
|
||||
|
||||
# 检查系统 Node.js
|
||||
$sysNode = Get-Command node -ErrorAction SilentlyContinue
|
||||
if ($sysNode) {
|
||||
$sysVer = & node --version 2>$null
|
||||
$major = [int]($sysVer -replace 'v','').Split('.')[0]
|
||||
if ($major -ge 20) {
|
||||
Write-Green " ✓ 系统已有 Node.js $sysVer,复用"
|
||||
$INSTALL_NODE = "node"
|
||||
$INSTALL_NPM = "npm"
|
||||
$USE_SYSTEM_NODE = $true
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $USE_SYSTEM_NODE) {
|
||||
if (Test-Path "$NODE_INSTALL_DIR\node.exe") {
|
||||
Write-Green " ✓ Node.js 已存在,跳过下载"
|
||||
$INSTALL_NODE = "$NODE_INSTALL_DIR\node.exe"
|
||||
$INSTALL_NPM = "$NODE_INSTALL_DIR\npm.cmd"
|
||||
} else {
|
||||
Write-Cyan " ↓ 从国内镜像下载 Node.js $NODE_VERSION ($PLATFORM)..."
|
||||
$zipName = "node-$NODE_VERSION-$PLATFORM.zip"
|
||||
$url = "$NODE_MIRROR/$NODE_VERSION/$zipName"
|
||||
$tempZip = "$env:TEMP\$zipName"
|
||||
$tempExtract = "$env:TEMP\node-extract-uclaw"
|
||||
|
||||
# 下载
|
||||
Write-Host " $url"
|
||||
try {
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
Invoke-WebRequest -Uri $url -OutFile $tempZip -UseBasicParsing
|
||||
} catch {
|
||||
# 尝试 curl
|
||||
try {
|
||||
& curl.exe -# -L $url -o $tempZip
|
||||
} catch {
|
||||
Write-Red " ✗ 下载失败!请检查网络连接"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# 解压
|
||||
Write-Host " 解压中..."
|
||||
if (Test-Path $tempExtract) { Remove-Item -Recurse -Force $tempExtract }
|
||||
Expand-Archive -Path $tempZip -DestinationPath $tempExtract -Force
|
||||
$extractedDir = Get-ChildItem $tempExtract | Select-Object -First 1
|
||||
New-Item -ItemType Directory -Force -Path $NODE_INSTALL_DIR | Out-Null
|
||||
Copy-Item -Recurse -Force "$($extractedDir.FullName)\*" $NODE_INSTALL_DIR
|
||||
|
||||
# 清理
|
||||
Remove-Item -Force $tempZip -ErrorAction SilentlyContinue
|
||||
Remove-Item -Recurse -Force $tempExtract -ErrorAction SilentlyContinue
|
||||
|
||||
if (Test-Path "$NODE_INSTALL_DIR\node.exe") {
|
||||
Write-Green " ✓ Node.js 安装完成"
|
||||
$INSTALL_NODE = "$NODE_INSTALL_DIR\node.exe"
|
||||
$INSTALL_NPM = "$NODE_INSTALL_DIR\npm.cmd"
|
||||
} else {
|
||||
Write-Red " ✗ Node.js 下载失败"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
|
||||
# ============================================================
|
||||
# Step 3: OpenClaw 安装
|
||||
# ============================================================
|
||||
Write-Host " [2/7] 安装 OpenClaw ..." -ForegroundColor White
|
||||
|
||||
if (Test-Path "$CORE_DIR\node_modules\openclaw") {
|
||||
Write-Green " ✓ OpenClaw 已安装,跳过"
|
||||
} else {
|
||||
if (-not (Test-Path "$CORE_DIR\package.json")) {
|
||||
@'
|
||||
{
|
||||
"name": "u-claw-core",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"openclaw": "latest"
|
||||
}
|
||||
}
|
||||
'@ | Out-File -Encoding utf8 "$CORE_DIR\package.json"
|
||||
}
|
||||
|
||||
Write-Cyan " ↓ 从国内镜像安装..."
|
||||
Push-Location $CORE_DIR
|
||||
& $INSTALL_NODE $INSTALL_NPM install --registry=$MIRROR 2>&1 | Select-Object -Last 5
|
||||
Pop-Location
|
||||
Write-Green " ✓ OpenClaw 安装完成"
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
|
||||
# ============================================================
|
||||
# Step 4: QQ 插件
|
||||
# ============================================================
|
||||
Write-Host " [3/7] 安装 QQ 插件 ..." -ForegroundColor White
|
||||
|
||||
if (Test-Path "$CORE_DIR\node_modules\@sliverp\qqbot") {
|
||||
Write-Green " ✓ QQ 插件已安装,跳过"
|
||||
} else {
|
||||
Write-Cyan " ↓ 安装 QQ 插件..."
|
||||
try {
|
||||
Push-Location $CORE_DIR
|
||||
& $INSTALL_NODE $INSTALL_NPM install "@sliverp/qqbot@latest" --registry=$MIRROR 2>&1 | Out-Null
|
||||
Pop-Location
|
||||
Write-Green " ✓ QQ 插件安装完成"
|
||||
} catch {
|
||||
Write-Yellow " ⚠ QQ 插件安装失败(不影响主功能)"
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
|
||||
# ============================================================
|
||||
# Step 5: 写入 10 个中国技能
|
||||
# ============================================================
|
||||
Write-Host " [4/7] 安装中国本地化技能 (10个) ..." -ForegroundColor White
|
||||
|
||||
$SKILLS_TARGET = "$CORE_DIR\node_modules\openclaw\skills"
|
||||
if (-not (Test-Path $SKILLS_TARGET)) { New-Item -ItemType Directory -Force -Path $SKILLS_TARGET | Out-Null }
|
||||
|
||||
$skillCount = 0
|
||||
|
||||
$skills = @{
|
||||
"bilibili-helper" = @'
|
||||
---
|
||||
name: bilibili-helper
|
||||
description: "B站内容助手 - 视频标题描述优化、标签策略、封面设计建议、分区选择、评论互动"
|
||||
metadata: { "openclaw": { "emoji": "📺" } }
|
||||
---
|
||||
|
||||
# B站内容助手
|
||||
|
||||
帮助 UP 主优化视频标题、描述、标签和封面,提升视频在 B 站的推荐和互动表现。
|
||||
|
||||
## 标题公式
|
||||
|
||||
1. **疑问式**: "为什么XX?看完你就懂了"
|
||||
2. **教程式**: "XX教程|从零开始手把手教学"
|
||||
3. **测评式**: "花了XX元买了XX,值不值?"
|
||||
4. **挑战式**: "挑战XX天只用XX"
|
||||
5. **盘点式**: "XX年度十大XX盘点"
|
||||
|
||||
## 分区选择指南
|
||||
|
||||
| 内容类型 | 推荐分区 |
|
||||
|---------|---------|
|
||||
| 编程教程 | 科技 → 计算机技术 |
|
||||
| 日常 vlog | 生活 → 日常 |
|
||||
| 游戏实况 | 游戏 → 单机/网游 |
|
||||
| 知识科普 | 知识 → 社科人文/科学科普 |
|
||||
| AI/数码 | 科技 → 软件应用 |
|
||||
'@
|
||||
|
||||
"china-search" = @'
|
||||
---
|
||||
name: china-search
|
||||
description: "国内搜索引擎 - 百度、搜狗、Bing中国搜索,绕过GFW限制"
|
||||
metadata: { "openclaw": { "emoji": "🔍" } }
|
||||
---
|
||||
|
||||
# 国内搜索引擎助手
|
||||
|
||||
通过 curl 调用百度、搜狗、Bing 中国等国内搜索引擎获取信息。
|
||||
|
||||
## 搜索命令
|
||||
|
||||
```bash
|
||||
curl -s -L "https://www.baidu.com/s?wd=关键词" -H "User-Agent: Mozilla/5.0"
|
||||
curl -s -L "https://weixin.sogou.com/weixin?query=关键词" -H "User-Agent: Mozilla/5.0"
|
||||
curl -s -L "https://cn.bing.com/search?q=关键词" -H "User-Agent: Mozilla/5.0"
|
||||
```
|
||||
'@
|
||||
|
||||
"china-translate" = @'
|
||||
---
|
||||
name: china-translate
|
||||
description: "中英互译 + 本地化 - 技术翻译、UI本地化、文化适配、避免机翻腔"
|
||||
metadata: { "openclaw": { "emoji": "🌐" } }
|
||||
---
|
||||
|
||||
# 中英互译 + 本地化助手
|
||||
|
||||
专业的中英双向翻译工具,专注技术文档翻译、产品本地化和文化适配。
|
||||
|
||||
## 常见术语对照
|
||||
|
||||
| English | 中文 |
|
||||
|---------|------|
|
||||
| Deploy | 部署 |
|
||||
| Repository | 仓库 |
|
||||
| Container | 容器 |
|
||||
| Middleware | 中间件 |
|
||||
| Render | 渲染 |
|
||||
| Token | Token / 令牌 |
|
||||
| Prompt | 提示词 |
|
||||
| Fine-tune | 微调 |
|
||||
'@
|
||||
|
||||
"china-weather" = @'
|
||||
---
|
||||
name: china-weather
|
||||
description: "中国城市天气查询 - 支持中文城市名、wttr.in接口"
|
||||
metadata: { "openclaw": { "emoji": "🌤️" } }
|
||||
---
|
||||
|
||||
# 中国城市天气查询
|
||||
|
||||
```bash
|
||||
curl -s "wttr.in/深圳?lang=zh"
|
||||
curl -s "wttr.in/深圳?format=j1"
|
||||
```
|
||||
'@
|
||||
|
||||
"deepseek-helper" = @'
|
||||
---
|
||||
name: deepseek-helper
|
||||
description: "DeepSeek API 助手 - 编程辅助、模型选择、API调用指南、定价信息"
|
||||
metadata: { "openclaw": { "emoji": "🤖" } }
|
||||
---
|
||||
|
||||
# DeepSeek API 助手
|
||||
|
||||
## 模型对比
|
||||
|
||||
| 模型 | 适用场景 | 上下文 |
|
||||
|------|---------|--------|
|
||||
| deepseek-chat | 日常对话、文案 | 32K |
|
||||
| deepseek-coder | 代码生成 | 16K |
|
||||
| deepseek-reasoner | 复杂推理 | 64K |
|
||||
|
||||
- API 兼容 OpenAI 格式,base_url: https://api.deepseek.com
|
||||
- 国内直连,API Key: https://platform.deepseek.com
|
||||
'@
|
||||
|
||||
"douyin-script" = @'
|
||||
---
|
||||
name: douyin-script
|
||||
description: "抖音/快手短视频脚本 - 前3秒hook、脚本结构、话题标签策略"
|
||||
metadata: { "openclaw": { "emoji": "🎬" } }
|
||||
---
|
||||
|
||||
# 抖音/快手短视频脚本助手
|
||||
|
||||
## 前3秒 Hook 公式
|
||||
|
||||
1. 反常识: "你一直在做的XX其实是错的"
|
||||
2. 数字冲击: "只花了100块,效果比1000块的还好"
|
||||
3. 悬念提问: "猜猜这个东西是干什么的?"
|
||||
4. 情绪共鸣: "打工人看完都沉默了..."
|
||||
5. 结果前置: "最终效果太绝了!"
|
||||
|
||||
## 话题标签: 大+中+小话题,共5-8个
|
||||
## 黄金时段: 早7-9、午12-14、晚18-22
|
||||
'@
|
||||
|
||||
"wechat-article" = @'
|
||||
---
|
||||
name: wechat-article
|
||||
description: "微信公众号文章写作 - 文章结构、排版规范、阅读转化优化"
|
||||
metadata: { "openclaw": { "emoji": "💚" } }
|
||||
---
|
||||
|
||||
# 微信公众号文章写作助手
|
||||
|
||||
## 排版规范
|
||||
|
||||
- 正文字号 15-16px,行间距 1.75-2x
|
||||
- 正文色 #3f3f3f,强调色 #007AFF
|
||||
- 每段 3-5 行,每 300 字配一张图
|
||||
- 标题 30 字以内,前 15 字抓眼球
|
||||
'@
|
||||
|
||||
"weibo-poster" = @'
|
||||
---
|
||||
name: weibo-poster
|
||||
description: "微博内容创作 - 140字优化、话题热搜、配图描述、发布时机"
|
||||
metadata: { "openclaw": { "emoji": "🔴" } }
|
||||
---
|
||||
|
||||
# 微博内容创作助手
|
||||
|
||||
## 140字技巧: 先写后删,一条一观点,金句收尾
|
||||
## 配图: 1张突出/3张对比/6张叙述/9张九宫格
|
||||
## 发布: 工作日午休+下班后,周末上午+晚上
|
||||
'@
|
||||
|
||||
"xiaohongshu-writer" = @'
|
||||
---
|
||||
name: xiaohongshu-writer
|
||||
description: "小红书笔记写作助手 - 标题优化、emoji策略、话题标签、笔记结构"
|
||||
metadata: { "openclaw": { "emoji": "📕" } }
|
||||
---
|
||||
|
||||
# 小红书笔记写作助手
|
||||
|
||||
## 标题公式
|
||||
|
||||
1. 数字法: "5个/10种/100元以内"
|
||||
2. 反差法: "月薪3千 vs 月薪3万"
|
||||
3. 测评法: "亲测有效!"
|
||||
4. 合集法: "XX合集|一篇搞定"
|
||||
|
||||
## 写作要点: 每段≤3行,emoji每段1-2个,标签3-8个
|
||||
'@
|
||||
|
||||
"zhihu-writer" = @'
|
||||
---
|
||||
name: zhihu-writer
|
||||
description: "知乎回答/文章写作 - 回答结构、专业语气、引用规范"
|
||||
metadata: { "openclaw": { "emoji": "📝" } }
|
||||
---
|
||||
|
||||
# 知乎回答/文章写作助手
|
||||
|
||||
## 回答结构: 先说结论 → 分点论证 → 总结升华
|
||||
## 风格: 自信不傲慢,专业但易懂,有态度但包容
|
||||
## 盐值: 500-3000字,原创,回复评论,专注2-3个话题
|
||||
'@
|
||||
}
|
||||
|
||||
foreach ($skillName in $skills.Keys) {
|
||||
$skillDir = "$SKILLS_TARGET\$skillName"
|
||||
if (-not (Test-Path $skillDir)) {
|
||||
New-Item -ItemType Directory -Force -Path $skillDir | Out-Null
|
||||
$skills[$skillName] | Out-File -Encoding utf8 "$skillDir\SKILL.md"
|
||||
$skillCount++
|
||||
}
|
||||
}
|
||||
|
||||
Write-Green " ✓ 中国技能安装完成 (+$skillCount 个)"
|
||||
Write-Host ""
|
||||
|
||||
# ============================================================
|
||||
# Step 6: 交互式模型配置
|
||||
# ============================================================
|
||||
Write-Host " [5/7] 配置 AI 模型 ..." -ForegroundColor White
|
||||
Write-Host ""
|
||||
|
||||
$hasConfig = (Test-Path $CONFIG_PATH) -and (Select-String -Path $CONFIG_PATH -Pattern "apiKey" -Quiet -ErrorAction SilentlyContinue)
|
||||
|
||||
if ($hasConfig) {
|
||||
Write-Green " ✓ 已有模型配置,跳过"
|
||||
} else {
|
||||
Write-Host " 请选择 AI 模型:" -ForegroundColor White
|
||||
Write-Host ""
|
||||
Write-Host " ── 国内推荐(无需翻墙)──" -ForegroundColor White
|
||||
Write-Host " 1) DeepSeek ⭐ 推荐,性价比最高" -ForegroundColor Green
|
||||
Write-Host " 2) Kimi/月之暗面"
|
||||
Write-Host " 3) 通义千问/阿里"
|
||||
Write-Host " 4) 智谱GLM"
|
||||
Write-Host " 5) MiniMax"
|
||||
Write-Host " 6) 豆包/火山引擎"
|
||||
Write-Host " 7) 硅基流动"
|
||||
Write-Host ""
|
||||
Write-Host " ── 海外模型 ──" -ForegroundColor White
|
||||
Write-Host " 8) Claude 9) GPT"
|
||||
Write-Host ""
|
||||
Write-Host " ── 本地 ──" -ForegroundColor White
|
||||
Write-Host " 10) Ollama 本地模型"
|
||||
Write-Host ""
|
||||
|
||||
$choice = Read-Host " 请输入编号 [1]"
|
||||
if ([string]::IsNullOrEmpty($choice)) { $choice = "1" }
|
||||
|
||||
$modelConfigs = @{
|
||||
"1" = @{ model="deepseek-chat"; baseUrl="https://api.deepseek.com/v1"; provider="custom"; label="DeepSeek API Key"; hint="获取: https://platform.deepseek.com/api_keys"; needKey=$true }
|
||||
"2" = @{ model="moonshot-v1-auto"; baseUrl="https://api.moonshot.cn/v1"; provider="custom"; label="Moonshot API Key"; hint="获取: https://platform.moonshot.cn/console/api-keys"; needKey=$true }
|
||||
"3" = @{ model="qwen-plus"; baseUrl="https://dashscope.aliyuncs.com/compatible-mode/v1"; provider="custom"; label="通义千问 API Key"; hint="获取: https://dashscope.console.aliyun.com/apiKey(有免费额度)"; needKey=$true }
|
||||
"4" = @{ model="glm-4-plus"; baseUrl="https://open.bigmodel.cn/api/paas/v4"; provider="custom"; label="智谱 API Key"; hint="获取: https://open.bigmodel.cn/usercenter/apikeys"; needKey=$true }
|
||||
"5" = @{ model="abab6.5s-chat"; baseUrl="https://api.minimax.chat/v1"; provider="custom"; label="MiniMax API Key"; hint="获取: https://platform.minimaxi.com/"; needKey=$true }
|
||||
"6" = @{ model="doubao-pro-256k"; baseUrl="https://ark.cn-beijing.volces.com/api/v3"; provider="custom"; label="火山引擎 API Key"; hint="获取: https://console.volcengine.com/ark"; needKey=$true }
|
||||
"7" = @{ model="deepseek-ai/DeepSeek-V3"; baseUrl="https://api.siliconflow.cn/v1"; provider="custom"; label="硅基流动 API Key"; hint="获取: https://cloud.siliconflow.cn/account/ak"; needKey=$true }
|
||||
"8" = @{ model="claude-sonnet-4-20250514"; baseUrl=""; provider="anthropic"; label="Anthropic API Key"; hint="获取: https://console.anthropic.com/settings/keys(需翻墙)"; needKey=$true }
|
||||
"9" = @{ model="gpt-4o"; baseUrl=""; provider="openai"; label="OpenAI API Key"; hint="获取: https://platform.openai.com/api-keys(需翻墙)"; needKey=$true }
|
||||
"10" = @{ model="llama3.2"; baseUrl="http://127.0.0.1:11434/v1"; provider="custom"; label=""; hint="先安装 Ollama (https://ollama.com),运行: ollama run llama3.2"; needKey=$false }
|
||||
}
|
||||
|
||||
$cfg = $modelConfigs[$choice]
|
||||
if (-not $cfg) {
|
||||
Write-Yellow " 未知选项,使用默认 DeepSeek"
|
||||
$cfg = $modelConfigs["1"]
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Cyan " $($cfg.hint)"
|
||||
Write-Host ""
|
||||
|
||||
$apiKey = ""
|
||||
if ($cfg.needKey) {
|
||||
$apiKey = Read-Host " 请输入 $($cfg.label)"
|
||||
if ([string]::IsNullOrEmpty($apiKey)) {
|
||||
Write-Yellow " ⚠ 未输入 API Key,稍后可通过 Config.html 配置"
|
||||
}
|
||||
}
|
||||
|
||||
# 写配置
|
||||
if ($cfg.provider -eq "custom" -and $cfg.baseUrl) {
|
||||
$configJson = @"
|
||||
{
|
||||
"gateway": {
|
||||
"mode": "local",
|
||||
"auth": { "token": "uclaw" }
|
||||
},
|
||||
"agent": {
|
||||
"model": "$($cfg.model)",
|
||||
"apiKey": "$apiKey",
|
||||
"baseUrl": "$($cfg.baseUrl)"
|
||||
}
|
||||
}
|
||||
"@
|
||||
} else {
|
||||
$configJson = @"
|
||||
{
|
||||
"gateway": {
|
||||
"mode": "local",
|
||||
"auth": { "token": "uclaw" }
|
||||
},
|
||||
"agent": {
|
||||
"model": "$($cfg.model)",
|
||||
"apiKey": "$apiKey",
|
||||
"provider": "$($cfg.provider)"
|
||||
}
|
||||
}
|
||||
"@
|
||||
}
|
||||
|
||||
$configJson | Out-File -Encoding utf8 $CONFIG_PATH
|
||||
Write-Green " ✓ 模型配置完成: $($cfg.model)"
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
|
||||
# ============================================================
|
||||
# Step 7: 生成启动脚本 + 验证 + 摘要
|
||||
# ============================================================
|
||||
Write-Host " [6/7] 生成启动脚本 ..." -ForegroundColor White
|
||||
|
||||
$startBat = @'
|
||||
@echo off
|
||||
setlocal EnableDelayedExpansion
|
||||
chcp 65001 >nul 2>&1
|
||||
title U-Claw
|
||||
|
||||
set "DIR=%~dp0"
|
||||
set "NODE_BIN=%DIR%runtime\node-win-x64\node.exe"
|
||||
if not exist "%NODE_BIN%" set "NODE_BIN=node"
|
||||
|
||||
set "OPENCLAW_MJS=%DIR%core\node_modules\openclaw\openclaw.mjs"
|
||||
set "OPENCLAW_HOME=%DIR%data"
|
||||
set "OPENCLAW_STATE_DIR=%DIR%data\.openclaw"
|
||||
set "OPENCLAW_CONFIG_PATH=%DIR%data\.openclaw\openclaw.json"
|
||||
|
||||
REM Find available port
|
||||
set PORT=18789
|
||||
:check_port
|
||||
netstat -an | findstr ":%PORT% " | findstr "LISTENING" >nul 2>&1
|
||||
if %errorlevel%==0 (
|
||||
set /a PORT+=1
|
||||
if !PORT! gtr 18799 (echo 没有可用端口 & pause & exit /b 1)
|
||||
goto :check_port
|
||||
)
|
||||
|
||||
cd /d "%DIR%core"
|
||||
start /B "" cmd /c "timeout /t 3 /nobreak >nul && start http://127.0.0.1:!PORT!/#token=uclaw"
|
||||
"%NODE_BIN%" "%OPENCLAW_MJS%" gateway run --allow-unconfigured --force --port !PORT!
|
||||
pause
|
||||
'@
|
||||
|
||||
$startBat | Out-File -Encoding ascii "$UCLAW_DIR\start.bat"
|
||||
|
||||
Write-Green " ✓ 启动脚本已生成"
|
||||
Write-Host ""
|
||||
|
||||
# ============================================================
|
||||
# 验证
|
||||
# ============================================================
|
||||
Write-Host " [7/7] 验证安装 ..." -ForegroundColor White
|
||||
Write-Host ""
|
||||
|
||||
# Node.js
|
||||
try {
|
||||
$nodeVer = & $INSTALL_NODE --version 2>$null
|
||||
Write-Green " [✓] Node.js $nodeVer"
|
||||
} catch {
|
||||
Write-Red " [✗] Node.js"
|
||||
}
|
||||
|
||||
# OpenClaw
|
||||
if (Test-Path "$CORE_DIR\node_modules\openclaw\openclaw.mjs") {
|
||||
Write-Green " [✓] OpenClaw 已安装"
|
||||
} else {
|
||||
Write-Red " [✗] OpenClaw"
|
||||
}
|
||||
|
||||
# QQ 插件
|
||||
if (Test-Path "$CORE_DIR\node_modules\@sliverp\qqbot") {
|
||||
Write-Green " [✓] QQ 插件"
|
||||
} else {
|
||||
Write-Yellow " [⚠] QQ 插件(未安装,不影响主功能)"
|
||||
}
|
||||
|
||||
# 技能
|
||||
$installedSkills = (Get-ChildItem -Directory $SKILLS_TARGET -ErrorAction SilentlyContinue).Count
|
||||
Write-Green " [✓] 中国技能 (${installedSkills}个)"
|
||||
|
||||
# 配置
|
||||
if (Test-Path $CONFIG_PATH) {
|
||||
Write-Green " [✓] 配置文件"
|
||||
} else {
|
||||
Write-Yellow " [⚠] 配置文件(需启动后配置)"
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
|
||||
# ============================================================
|
||||
# 摘要
|
||||
# ============================================================
|
||||
$installSize = "{0:N0} MB" -f ((Get-ChildItem -Recurse $UCLAW_DIR -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum).Sum / 1MB)
|
||||
|
||||
Write-Host ""
|
||||
Write-Green " ╔══════════════════════════════════════════╗"
|
||||
Write-Green " ║ ✅ U-Claw 安装成功! ║"
|
||||
Write-Green " ╚══════════════════════════════════════════╝"
|
||||
Write-Host ""
|
||||
Write-Host " 安装位置: $UCLAW_DIR" -ForegroundColor White
|
||||
Write-Host " 大小: $installSize" -ForegroundColor White
|
||||
Write-Host ""
|
||||
Write-Host " 启动方式:" -ForegroundColor White
|
||||
Write-Host " 双击 $UCLAW_DIR\start.bat" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
Write-Host " 打开后:" -ForegroundColor White
|
||||
Write-Host " 浏览器自动打开 → 开始和 AI 对话" -ForegroundColor White
|
||||
Write-Host ""
|
||||
Write-Host " 如需重新配置模型,编辑 $CONFIG_PATH" -ForegroundColor DarkGray
|
||||
Write-Host " 卸载: 删除 $UCLAW_DIR 文件夹" -ForegroundColor DarkGray
|
||||
Write-Host ""
|
||||
Write-Host " 按回车关闭..." -ForegroundColor DarkGray
|
||||
Read-Host
|
||||
1122
install/install.sh
Executable file
1122
install/install.sh
Executable file
File diff suppressed because it is too large
Load Diff
@@ -97,6 +97,7 @@ ul{padding-left:20px}
|
||||
<div class="nav-group-items">
|
||||
<a class="nav-item active" href="#" data-page="intro">什么是 U-Claw</a>
|
||||
<a class="nav-item" href="#" data-page="quickstart">3 分钟快速上手</a>
|
||||
<a class="nav-item" href="#" data-page="oneclick">⚡ 一键在线安装</a>
|
||||
<a class="nav-item" href="#" data-page="usb-run">从 U 盘运行(免安装)</a>
|
||||
<a class="nav-item" href="#" data-page="install-pc">安装到电脑(桌面版)</a>
|
||||
<a class="nav-item" href="#" data-page="dev-build">开发者搭建指南</a>
|
||||
@@ -219,7 +220,18 @@ ul{padding-left:20px}
|
||||
<div class="page" id="page-quickstart">
|
||||
<h1>3 分钟快速上手</h1>
|
||||
|
||||
<h2>方式一:U 盘便携版(免安装)</h2>
|
||||
<h2>方式一:一键在线安装(推荐)</h2>
|
||||
<div class="card" style="border-color:var(--cyan)">
|
||||
<p>不需要 U 盘,一行命令搞定一切:</p>
|
||||
<pre><code># Mac / Linux
|
||||
curl -fsSL https://u-claw.org/install.sh | bash
|
||||
|
||||
# Windows (PowerShell 管理员)
|
||||
irm https://u-claw.org/install.ps1 | iex</code></pre>
|
||||
<p style="color:var(--dim);margin-bottom:0">自动下载 Node.js → 安装 OpenClaw → 10 个中国技能 → 交互式选模型 → 生成启动脚本。<br>全程国内镜像,约 2-5 分钟。<a href="#" data-page="oneclick">查看详细说明 →</a></p>
|
||||
</div>
|
||||
|
||||
<h2>方式二:U 盘便携版(免安装)</h2>
|
||||
<div class="step"><div class="step-num">1</div><div class="step-content"><strong>插入 U 盘</strong><p style="color:var(--dim)">将 U-Claw U 盘插入电脑</p></div></div>
|
||||
<div class="step"><div class="step-num">2</div><div class="step-content"><strong>双击启动脚本</strong>
|
||||
<table><tr><th>系统</th><th>双击打开</th></tr>
|
||||
@@ -230,12 +242,12 @@ ul{padding-left:20px}
|
||||
<div class="step"><div class="step-num">3</div><div class="step-content"><strong>首次配置</strong><p style="color:var(--dim)">浏览器自动打开 Config.html → 选择 AI 模型 → 填写 API Key</p></div></div>
|
||||
<div class="step"><div class="step-num">4</div><div class="step-content"><strong>开始使用</strong><p style="color:var(--dim)">控制台自动打开 <code>http://127.0.0.1:18789</code></p></div></div>
|
||||
|
||||
<h2>方式二:桌面安装版</h2>
|
||||
<h2>方式三:桌面安装版</h2>
|
||||
<div class="step"><div class="step-num">1</div><div class="step-content"><strong>下载安装包</strong><p style="color:var(--dim)">从 <a href="https://github.com/dongsheng123132/u-claw/releases" target="_blank">GitHub Releases</a> 下载 DMG (Mac) 或 EXE (Windows)</p></div></div>
|
||||
<div class="step"><div class="step-num">2</div><div class="step-content"><strong>安装并打开</strong><p style="color:var(--dim)">双击安装,打开 U-Claw App</p></div></div>
|
||||
<div class="step"><div class="step-num">3</div><div class="step-content"><strong>首次配置</strong><p style="color:var(--dim)">App 自动弹出配置页面 → 选择模型 → 填 API Key</p></div></div>
|
||||
|
||||
<h2>方式三:开发者自己搭建</h2>
|
||||
<h2>方式四:开发者自己搭建</h2>
|
||||
<div class="step"><div class="step-num">1</div><div class="step-content"><strong>克隆代码</strong>
|
||||
<pre><code>git clone https://github.com/dongsheng123132/u-claw.git</code></pre>
|
||||
</div></div>
|
||||
@@ -257,6 +269,107 @@ npm run dev</code></pre>
|
||||
</div></div>
|
||||
</div>
|
||||
|
||||
<!-- ===== 一键在线安装 ===== -->
|
||||
<div class="page" id="page-oneclick">
|
||||
<h1>⚡ 一键在线安装</h1>
|
||||
<p style="color:var(--dim);font-size:1.05em;margin-bottom:24px">不需要 U 盘,不需要 Git,一行命令装好 OpenClaw + 技能包 + 模型配置。全程国内镜像,无需翻墙。</p>
|
||||
|
||||
<div class="card" style="border-color:var(--cyan)">
|
||||
<h3 style="margin-top:0">Mac / Linux</h3>
|
||||
<pre><code>curl -fsSL https://u-claw.org/install.sh | bash</code></pre>
|
||||
<h3>Windows(PowerShell 管理员)</h3>
|
||||
<pre><code>irm https://u-claw.org/install.ps1 | iex</code></pre>
|
||||
<p style="color:var(--dim);margin-bottom:0">打开终端,复制粘贴,回车即可。整个过程约 2-5 分钟。</p>
|
||||
</div>
|
||||
|
||||
<h2>安装流程(7 步全自动)</h2>
|
||||
|
||||
<div class="step"><div class="step-num">1</div><div class="step-content"><strong>系统检测</strong><p style="color:var(--dim)">自动识别 macOS / Linux / Windows,以及 CPU 架构(ARM64 / x64)</p></div></div>
|
||||
|
||||
<div class="step"><div class="step-num">2</div><div class="step-content"><strong>安装 Node.js v22</strong><p style="color:var(--dim)">安装到 <code>~/.uclaw/runtime/</code>,不动系统环境。如果系统已有 v20+,自动复用</p></div></div>
|
||||
|
||||
<div class="step"><div class="step-num">3</div><div class="step-content"><strong>安装 OpenClaw</strong><p style="color:var(--dim)">从 npmmirror 国内镜像下载安装到 <code>~/.uclaw/core/</code></p></div></div>
|
||||
|
||||
<div class="step"><div class="step-num">4</div><div class="step-content"><strong>安装 QQ 插件</strong><p style="color:var(--dim)">自动安装 QQ 机器人插件(失败不影响主功能)</p></div></div>
|
||||
|
||||
<div class="step"><div class="step-num">5</div><div class="step-content"><strong>安装 10 个中国技能</strong><p style="color:var(--dim)">小红书、B站、微博、微信公众号、知乎、抖音、国内搜索、翻译、天气、DeepSeek 助手</p></div></div>
|
||||
|
||||
<div class="step"><div class="step-num">6</div><div class="step-content"><strong>选择 AI 模型</strong><p style="color:var(--dim)">中文交互菜单,支持 10 个模型。默认 DeepSeek,回车即选。输入 API Key 自动写入配置</p></div></div>
|
||||
|
||||
<div class="step"><div class="step-num">7</div><div class="step-content"><strong>验证 + 生成启动脚本</strong><p style="color:var(--dim)">自动检查所有组件是否安装成功,生成 <code>start.command</code> (Mac) 或 <code>start.bat</code> (Win)</p></div></div>
|
||||
|
||||
<h2>支持的 AI 模型</h2>
|
||||
|
||||
<h3>国内模型(无需翻墙)</h3>
|
||||
<table>
|
||||
<tr><th>编号</th><th>模型</th><th>说明</th></tr>
|
||||
<tr><td>1</td><td><strong>DeepSeek</strong></td><td>⭐ 推荐,性价比最高,编程首选</td></tr>
|
||||
<tr><td>2</td><td>Kimi / 月之暗面</td><td>长文档,256K 上下文</td></tr>
|
||||
<tr><td>3</td><td>通义千问 / 阿里</td><td>有免费额度</td></tr>
|
||||
<tr><td>4</td><td>智谱 GLM</td><td>学术场景</td></tr>
|
||||
<tr><td>5</td><td>MiniMax</td><td>语音多模态</td></tr>
|
||||
<tr><td>6</td><td>豆包 / 火山引擎</td><td>火山引擎生态</td></tr>
|
||||
<tr><td>7</td><td>硅基流动</td><td>聚合多模型,一个 Key 切换</td></tr>
|
||||
</table>
|
||||
|
||||
<h3>海外 + 本地模型</h3>
|
||||
<table>
|
||||
<tr><th>编号</th><th>模型</th><th>说明</th></tr>
|
||||
<tr><td>8</td><td>Claude</td><td>需翻墙</td></tr>
|
||||
<tr><td>9</td><td>GPT</td><td>需翻墙</td></tr>
|
||||
<tr><td>10</td><td>Ollama</td><td>本地模型,无需 API Key</td></tr>
|
||||
</table>
|
||||
|
||||
<h2>安装后的目录结构</h2>
|
||||
<pre><code>~/.uclaw/
|
||||
├── runtime/node-{platform}/ # Node.js v22(不影响系统)
|
||||
├── core/ # OpenClaw + QQ 插件
|
||||
│ └── node_modules/
|
||||
│ └── openclaw/skills/ ← 10 个中国技能
|
||||
├── data/
|
||||
│ ├── .openclaw/openclaw.json ← 模型配置(API Key 在这里)
|
||||
│ ├── memory/ ← AI 记忆
|
||||
│ └── backups/ ← 备份
|
||||
├── start.command (Mac) ← 双击启动
|
||||
└── start.bat (Windows) ← 双击启动</code></pre>
|
||||
|
||||
<h2>安装后怎么用</h2>
|
||||
|
||||
<div class="step"><div class="step-num">1</div><div class="step-content"><strong>启动</strong>
|
||||
<pre><code># Mac: 双击 ~/.uclaw/start.command 或
|
||||
bash ~/.uclaw/start.command
|
||||
|
||||
# Windows: 双击 %USERPROFILE%\.uclaw\start.bat</code></pre>
|
||||
</div></div>
|
||||
|
||||
<div class="step"><div class="step-num">2</div><div class="step-content"><strong>浏览器自动打开</strong><p style="color:var(--dim)">访问 <code>http://127.0.0.1:18789/#token=uclaw</code>,开始和 AI 对话</p></div></div>
|
||||
|
||||
<div class="tip"><strong>改模型?</strong>编辑 <code>~/.uclaw/data/.openclaw/openclaw.json</code>,改完自动生效(热加载)</div>
|
||||
|
||||
<h2>卸载</h2>
|
||||
<pre><code># Mac / Linux
|
||||
rm -rf ~/.uclaw
|
||||
|
||||
# Windows (PowerShell)
|
||||
Remove-Item -Recurse -Force "$env:USERPROFILE\.uclaw"</code></pre>
|
||||
|
||||
<h2>与其他安装方式对比</h2>
|
||||
<table>
|
||||
<tr><th>方式</th><th>需要 U 盘</th><th>需要网络</th><th>适合场景</th></tr>
|
||||
<tr><td><strong>⚡ 一键在线安装</strong></td><td>❌ 不需要</td><td>✅ 需要</td><td>自己电脑、有网环境</td></tr>
|
||||
<tr><td>U 盘便携版</td><td>✅ 需要</td><td>❌ 不需要</td><td>公司电脑、无网环境、装机</td></tr>
|
||||
<tr><td>桌面版 (Electron)</td><td>❌ 不需要</td><td>✅ 下载安装包</td><td>想要 App 体验</td></tr>
|
||||
<tr><td>Linux 启动盘</td><td>✅ 需要</td><td>❌ 不需要</td><td>无操作系统的裸机</td></tr>
|
||||
</table>
|
||||
|
||||
<div class="warn"><strong>管道模式:</strong><code>curl | bash</code> 时无法交互,脚本自动跳过模型选择。启动后用 Config.html 页面配置即可。</div>
|
||||
|
||||
<div class="footer-nav">
|
||||
<a href="#" data-page="quickstart">← 3 分钟快速上手</a>
|
||||
<a href="#" data-page="usb-run">从 U 盘运行 →</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ===== 从 U 盘运行 ===== -->
|
||||
<div class="page" id="page-usb-run">
|
||||
<h1>从 U 盘运行(免安装便携模式)</h1>
|
||||
|
||||
628
website/install.ps1
Normal file
628
website/install.ps1
Normal file
@@ -0,0 +1,628 @@
|
||||
# ============================================================
|
||||
# U-Claw 一键安装脚本 (Windows PowerShell)
|
||||
# 用法: irm https://u-claw.org/install.ps1 | iex
|
||||
# 或: powershell -ExecutionPolicy Bypass -File install.ps1
|
||||
# ============================================================
|
||||
|
||||
# 编码 + 执行策略
|
||||
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
||||
$OutputEncoding = [System.Text.Encoding]::UTF8
|
||||
try { chcp 65001 | Out-Null } catch {}
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force -ErrorAction SilentlyContinue
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# ---- 常量 ----
|
||||
$UCLAW_DIR = "$env:USERPROFILE\.uclaw"
|
||||
$RUNTIME_DIR = "$UCLAW_DIR\runtime"
|
||||
$CORE_DIR = "$UCLAW_DIR\core"
|
||||
$DATA_DIR = "$UCLAW_DIR\data"
|
||||
$CONFIG_PATH = "$DATA_DIR\.openclaw\openclaw.json"
|
||||
$NODE_VERSION = "v22.14.0"
|
||||
$MIRROR = "https://registry.npmmirror.com"
|
||||
$NODE_MIRROR = "https://npmmirror.com/mirrors/node"
|
||||
|
||||
# ---- 颜色函数 ----
|
||||
function Write-Green($msg) { Write-Host $msg -ForegroundColor Green }
|
||||
function Write-Cyan($msg) { Write-Host $msg -ForegroundColor Cyan }
|
||||
function Write-Yellow($msg) { Write-Host $msg -ForegroundColor Yellow }
|
||||
function Write-Red($msg) { Write-Host $msg -ForegroundColor Red }
|
||||
|
||||
# ============================================================
|
||||
# Step 1: Banner + 系统检测
|
||||
# ============================================================
|
||||
Clear-Host
|
||||
Write-Host ""
|
||||
Write-Cyan " ╔══════════════════════════════════════════╗"
|
||||
Write-Cyan " ║ 🦞 U-Claw 一键安装 (Windows) ║"
|
||||
Write-Cyan " ║ 让 AI 助手一行命令装好 ║"
|
||||
Write-Cyan " ╚══════════════════════════════════════════╝"
|
||||
Write-Host ""
|
||||
|
||||
# 系统检测
|
||||
$ARCH = $env:PROCESSOR_ARCHITECTURE
|
||||
if ($ARCH -eq "AMD64" -or $ARCH -eq "x86_64") {
|
||||
$PLATFORM = "win-x64"
|
||||
Write-Green " 系统: Windows x64 ✓"
|
||||
} elseif ($ARCH -eq "ARM64") {
|
||||
$PLATFORM = "win-arm64"
|
||||
Write-Green " 系统: Windows ARM64 ✓"
|
||||
} else {
|
||||
Write-Red " 不支持的架构: $ARCH"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host " 安装目录: $UCLAW_DIR" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
# 检查已有安装
|
||||
if (Test-Path "$CORE_DIR\node_modules\openclaw") {
|
||||
Write-Yellow " 检测到已有安装: $UCLAW_DIR"
|
||||
$overwrite = Read-Host " 覆盖安装?(y/n) [y]"
|
||||
if ($overwrite -eq "n" -or $overwrite -eq "N") {
|
||||
Write-Host " 已取消" -ForegroundColor DarkGray
|
||||
exit 0
|
||||
}
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
# 创建目录
|
||||
New-Item -ItemType Directory -Force -Path $RUNTIME_DIR | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path $CORE_DIR | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path "$DATA_DIR\.openclaw" | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path "$DATA_DIR\memory" | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path "$DATA_DIR\backups" | Out-Null
|
||||
|
||||
# ============================================================
|
||||
# Step 2: Node.js v22 安装
|
||||
# ============================================================
|
||||
Write-Host " [1/7] 安装 Node.js $NODE_VERSION ..." -ForegroundColor White
|
||||
|
||||
$NODE_INSTALL_DIR = "$RUNTIME_DIR\node-$PLATFORM"
|
||||
$INSTALL_NODE = ""
|
||||
$INSTALL_NPM = ""
|
||||
$USE_SYSTEM_NODE = $false
|
||||
|
||||
# 检查系统 Node.js
|
||||
$sysNode = Get-Command node -ErrorAction SilentlyContinue
|
||||
if ($sysNode) {
|
||||
$sysVer = & node --version 2>$null
|
||||
$major = [int]($sysVer -replace 'v','').Split('.')[0]
|
||||
if ($major -ge 20) {
|
||||
Write-Green " ✓ 系统已有 Node.js $sysVer,复用"
|
||||
$INSTALL_NODE = "node"
|
||||
$INSTALL_NPM = "npm"
|
||||
$USE_SYSTEM_NODE = $true
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $USE_SYSTEM_NODE) {
|
||||
if (Test-Path "$NODE_INSTALL_DIR\node.exe") {
|
||||
Write-Green " ✓ Node.js 已存在,跳过下载"
|
||||
$INSTALL_NODE = "$NODE_INSTALL_DIR\node.exe"
|
||||
$INSTALL_NPM = "$NODE_INSTALL_DIR\npm.cmd"
|
||||
} else {
|
||||
Write-Cyan " ↓ 从国内镜像下载 Node.js $NODE_VERSION ($PLATFORM)..."
|
||||
$zipName = "node-$NODE_VERSION-$PLATFORM.zip"
|
||||
$url = "$NODE_MIRROR/$NODE_VERSION/$zipName"
|
||||
$tempZip = "$env:TEMP\$zipName"
|
||||
$tempExtract = "$env:TEMP\node-extract-uclaw"
|
||||
|
||||
# 下载
|
||||
Write-Host " $url"
|
||||
try {
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
Invoke-WebRequest -Uri $url -OutFile $tempZip -UseBasicParsing
|
||||
} catch {
|
||||
# 尝试 curl
|
||||
try {
|
||||
& curl.exe -# -L $url -o $tempZip
|
||||
} catch {
|
||||
Write-Red " ✗ 下载失败!请检查网络连接"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# 解压
|
||||
Write-Host " 解压中..."
|
||||
if (Test-Path $tempExtract) { Remove-Item -Recurse -Force $tempExtract }
|
||||
Expand-Archive -Path $tempZip -DestinationPath $tempExtract -Force
|
||||
$extractedDir = Get-ChildItem $tempExtract | Select-Object -First 1
|
||||
New-Item -ItemType Directory -Force -Path $NODE_INSTALL_DIR | Out-Null
|
||||
Copy-Item -Recurse -Force "$($extractedDir.FullName)\*" $NODE_INSTALL_DIR
|
||||
|
||||
# 清理
|
||||
Remove-Item -Force $tempZip -ErrorAction SilentlyContinue
|
||||
Remove-Item -Recurse -Force $tempExtract -ErrorAction SilentlyContinue
|
||||
|
||||
if (Test-Path "$NODE_INSTALL_DIR\node.exe") {
|
||||
Write-Green " ✓ Node.js 安装完成"
|
||||
$INSTALL_NODE = "$NODE_INSTALL_DIR\node.exe"
|
||||
$INSTALL_NPM = "$NODE_INSTALL_DIR\npm.cmd"
|
||||
} else {
|
||||
Write-Red " ✗ Node.js 下载失败"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
|
||||
# ============================================================
|
||||
# Step 3: OpenClaw 安装
|
||||
# ============================================================
|
||||
Write-Host " [2/7] 安装 OpenClaw ..." -ForegroundColor White
|
||||
|
||||
if (Test-Path "$CORE_DIR\node_modules\openclaw") {
|
||||
Write-Green " ✓ OpenClaw 已安装,跳过"
|
||||
} else {
|
||||
if (-not (Test-Path "$CORE_DIR\package.json")) {
|
||||
@'
|
||||
{
|
||||
"name": "u-claw-core",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"openclaw": "latest"
|
||||
}
|
||||
}
|
||||
'@ | Out-File -Encoding utf8 "$CORE_DIR\package.json"
|
||||
}
|
||||
|
||||
Write-Cyan " ↓ 从国内镜像安装..."
|
||||
Push-Location $CORE_DIR
|
||||
& $INSTALL_NODE $INSTALL_NPM install --registry=$MIRROR 2>&1 | Select-Object -Last 5
|
||||
Pop-Location
|
||||
Write-Green " ✓ OpenClaw 安装完成"
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
|
||||
# ============================================================
|
||||
# Step 4: QQ 插件
|
||||
# ============================================================
|
||||
Write-Host " [3/7] 安装 QQ 插件 ..." -ForegroundColor White
|
||||
|
||||
if (Test-Path "$CORE_DIR\node_modules\@sliverp\qqbot") {
|
||||
Write-Green " ✓ QQ 插件已安装,跳过"
|
||||
} else {
|
||||
Write-Cyan " ↓ 安装 QQ 插件..."
|
||||
try {
|
||||
Push-Location $CORE_DIR
|
||||
& $INSTALL_NODE $INSTALL_NPM install "@sliverp/qqbot@latest" --registry=$MIRROR 2>&1 | Out-Null
|
||||
Pop-Location
|
||||
Write-Green " ✓ QQ 插件安装完成"
|
||||
} catch {
|
||||
Write-Yellow " ⚠ QQ 插件安装失败(不影响主功能)"
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
|
||||
# ============================================================
|
||||
# Step 5: 写入 10 个中国技能
|
||||
# ============================================================
|
||||
Write-Host " [4/7] 安装中国本地化技能 (10个) ..." -ForegroundColor White
|
||||
|
||||
$SKILLS_TARGET = "$CORE_DIR\node_modules\openclaw\skills"
|
||||
if (-not (Test-Path $SKILLS_TARGET)) { New-Item -ItemType Directory -Force -Path $SKILLS_TARGET | Out-Null }
|
||||
|
||||
$skillCount = 0
|
||||
|
||||
$skills = @{
|
||||
"bilibili-helper" = @'
|
||||
---
|
||||
name: bilibili-helper
|
||||
description: "B站内容助手 - 视频标题描述优化、标签策略、封面设计建议、分区选择、评论互动"
|
||||
metadata: { "openclaw": { "emoji": "📺" } }
|
||||
---
|
||||
|
||||
# B站内容助手
|
||||
|
||||
帮助 UP 主优化视频标题、描述、标签和封面,提升视频在 B 站的推荐和互动表现。
|
||||
|
||||
## 标题公式
|
||||
|
||||
1. **疑问式**: "为什么XX?看完你就懂了"
|
||||
2. **教程式**: "XX教程|从零开始手把手教学"
|
||||
3. **测评式**: "花了XX元买了XX,值不值?"
|
||||
4. **挑战式**: "挑战XX天只用XX"
|
||||
5. **盘点式**: "XX年度十大XX盘点"
|
||||
|
||||
## 分区选择指南
|
||||
|
||||
| 内容类型 | 推荐分区 |
|
||||
|---------|---------|
|
||||
| 编程教程 | 科技 → 计算机技术 |
|
||||
| 日常 vlog | 生活 → 日常 |
|
||||
| 游戏实况 | 游戏 → 单机/网游 |
|
||||
| 知识科普 | 知识 → 社科人文/科学科普 |
|
||||
| AI/数码 | 科技 → 软件应用 |
|
||||
'@
|
||||
|
||||
"china-search" = @'
|
||||
---
|
||||
name: china-search
|
||||
description: "国内搜索引擎 - 百度、搜狗、Bing中国搜索,绕过GFW限制"
|
||||
metadata: { "openclaw": { "emoji": "🔍" } }
|
||||
---
|
||||
|
||||
# 国内搜索引擎助手
|
||||
|
||||
通过 curl 调用百度、搜狗、Bing 中国等国内搜索引擎获取信息。
|
||||
|
||||
## 搜索命令
|
||||
|
||||
```bash
|
||||
curl -s -L "https://www.baidu.com/s?wd=关键词" -H "User-Agent: Mozilla/5.0"
|
||||
curl -s -L "https://weixin.sogou.com/weixin?query=关键词" -H "User-Agent: Mozilla/5.0"
|
||||
curl -s -L "https://cn.bing.com/search?q=关键词" -H "User-Agent: Mozilla/5.0"
|
||||
```
|
||||
'@
|
||||
|
||||
"china-translate" = @'
|
||||
---
|
||||
name: china-translate
|
||||
description: "中英互译 + 本地化 - 技术翻译、UI本地化、文化适配、避免机翻腔"
|
||||
metadata: { "openclaw": { "emoji": "🌐" } }
|
||||
---
|
||||
|
||||
# 中英互译 + 本地化助手
|
||||
|
||||
专业的中英双向翻译工具,专注技术文档翻译、产品本地化和文化适配。
|
||||
|
||||
## 常见术语对照
|
||||
|
||||
| English | 中文 |
|
||||
|---------|------|
|
||||
| Deploy | 部署 |
|
||||
| Repository | 仓库 |
|
||||
| Container | 容器 |
|
||||
| Middleware | 中间件 |
|
||||
| Render | 渲染 |
|
||||
| Token | Token / 令牌 |
|
||||
| Prompt | 提示词 |
|
||||
| Fine-tune | 微调 |
|
||||
'@
|
||||
|
||||
"china-weather" = @'
|
||||
---
|
||||
name: china-weather
|
||||
description: "中国城市天气查询 - 支持中文城市名、wttr.in接口"
|
||||
metadata: { "openclaw": { "emoji": "🌤️" } }
|
||||
---
|
||||
|
||||
# 中国城市天气查询
|
||||
|
||||
```bash
|
||||
curl -s "wttr.in/深圳?lang=zh"
|
||||
curl -s "wttr.in/深圳?format=j1"
|
||||
```
|
||||
'@
|
||||
|
||||
"deepseek-helper" = @'
|
||||
---
|
||||
name: deepseek-helper
|
||||
description: "DeepSeek API 助手 - 编程辅助、模型选择、API调用指南、定价信息"
|
||||
metadata: { "openclaw": { "emoji": "🤖" } }
|
||||
---
|
||||
|
||||
# DeepSeek API 助手
|
||||
|
||||
## 模型对比
|
||||
|
||||
| 模型 | 适用场景 | 上下文 |
|
||||
|------|---------|--------|
|
||||
| deepseek-chat | 日常对话、文案 | 32K |
|
||||
| deepseek-coder | 代码生成 | 16K |
|
||||
| deepseek-reasoner | 复杂推理 | 64K |
|
||||
|
||||
- API 兼容 OpenAI 格式,base_url: https://api.deepseek.com
|
||||
- 国内直连,API Key: https://platform.deepseek.com
|
||||
'@
|
||||
|
||||
"douyin-script" = @'
|
||||
---
|
||||
name: douyin-script
|
||||
description: "抖音/快手短视频脚本 - 前3秒hook、脚本结构、话题标签策略"
|
||||
metadata: { "openclaw": { "emoji": "🎬" } }
|
||||
---
|
||||
|
||||
# 抖音/快手短视频脚本助手
|
||||
|
||||
## 前3秒 Hook 公式
|
||||
|
||||
1. 反常识: "你一直在做的XX其实是错的"
|
||||
2. 数字冲击: "只花了100块,效果比1000块的还好"
|
||||
3. 悬念提问: "猜猜这个东西是干什么的?"
|
||||
4. 情绪共鸣: "打工人看完都沉默了..."
|
||||
5. 结果前置: "最终效果太绝了!"
|
||||
|
||||
## 话题标签: 大+中+小话题,共5-8个
|
||||
## 黄金时段: 早7-9、午12-14、晚18-22
|
||||
'@
|
||||
|
||||
"wechat-article" = @'
|
||||
---
|
||||
name: wechat-article
|
||||
description: "微信公众号文章写作 - 文章结构、排版规范、阅读转化优化"
|
||||
metadata: { "openclaw": { "emoji": "💚" } }
|
||||
---
|
||||
|
||||
# 微信公众号文章写作助手
|
||||
|
||||
## 排版规范
|
||||
|
||||
- 正文字号 15-16px,行间距 1.75-2x
|
||||
- 正文色 #3f3f3f,强调色 #007AFF
|
||||
- 每段 3-5 行,每 300 字配一张图
|
||||
- 标题 30 字以内,前 15 字抓眼球
|
||||
'@
|
||||
|
||||
"weibo-poster" = @'
|
||||
---
|
||||
name: weibo-poster
|
||||
description: "微博内容创作 - 140字优化、话题热搜、配图描述、发布时机"
|
||||
metadata: { "openclaw": { "emoji": "🔴" } }
|
||||
---
|
||||
|
||||
# 微博内容创作助手
|
||||
|
||||
## 140字技巧: 先写后删,一条一观点,金句收尾
|
||||
## 配图: 1张突出/3张对比/6张叙述/9张九宫格
|
||||
## 发布: 工作日午休+下班后,周末上午+晚上
|
||||
'@
|
||||
|
||||
"xiaohongshu-writer" = @'
|
||||
---
|
||||
name: xiaohongshu-writer
|
||||
description: "小红书笔记写作助手 - 标题优化、emoji策略、话题标签、笔记结构"
|
||||
metadata: { "openclaw": { "emoji": "📕" } }
|
||||
---
|
||||
|
||||
# 小红书笔记写作助手
|
||||
|
||||
## 标题公式
|
||||
|
||||
1. 数字法: "5个/10种/100元以内"
|
||||
2. 反差法: "月薪3千 vs 月薪3万"
|
||||
3. 测评法: "亲测有效!"
|
||||
4. 合集法: "XX合集|一篇搞定"
|
||||
|
||||
## 写作要点: 每段≤3行,emoji每段1-2个,标签3-8个
|
||||
'@
|
||||
|
||||
"zhihu-writer" = @'
|
||||
---
|
||||
name: zhihu-writer
|
||||
description: "知乎回答/文章写作 - 回答结构、专业语气、引用规范"
|
||||
metadata: { "openclaw": { "emoji": "📝" } }
|
||||
---
|
||||
|
||||
# 知乎回答/文章写作助手
|
||||
|
||||
## 回答结构: 先说结论 → 分点论证 → 总结升华
|
||||
## 风格: 自信不傲慢,专业但易懂,有态度但包容
|
||||
## 盐值: 500-3000字,原创,回复评论,专注2-3个话题
|
||||
'@
|
||||
}
|
||||
|
||||
foreach ($skillName in $skills.Keys) {
|
||||
$skillDir = "$SKILLS_TARGET\$skillName"
|
||||
if (-not (Test-Path $skillDir)) {
|
||||
New-Item -ItemType Directory -Force -Path $skillDir | Out-Null
|
||||
$skills[$skillName] | Out-File -Encoding utf8 "$skillDir\SKILL.md"
|
||||
$skillCount++
|
||||
}
|
||||
}
|
||||
|
||||
Write-Green " ✓ 中国技能安装完成 (+$skillCount 个)"
|
||||
Write-Host ""
|
||||
|
||||
# ============================================================
|
||||
# Step 6: 交互式模型配置
|
||||
# ============================================================
|
||||
Write-Host " [5/7] 配置 AI 模型 ..." -ForegroundColor White
|
||||
Write-Host ""
|
||||
|
||||
$hasConfig = (Test-Path $CONFIG_PATH) -and (Select-String -Path $CONFIG_PATH -Pattern "apiKey" -Quiet -ErrorAction SilentlyContinue)
|
||||
|
||||
if ($hasConfig) {
|
||||
Write-Green " ✓ 已有模型配置,跳过"
|
||||
} else {
|
||||
Write-Host " 请选择 AI 模型:" -ForegroundColor White
|
||||
Write-Host ""
|
||||
Write-Host " ── 国内推荐(无需翻墙)──" -ForegroundColor White
|
||||
Write-Host " 1) DeepSeek ⭐ 推荐,性价比最高" -ForegroundColor Green
|
||||
Write-Host " 2) Kimi/月之暗面"
|
||||
Write-Host " 3) 通义千问/阿里"
|
||||
Write-Host " 4) 智谱GLM"
|
||||
Write-Host " 5) MiniMax"
|
||||
Write-Host " 6) 豆包/火山引擎"
|
||||
Write-Host " 7) 硅基流动"
|
||||
Write-Host ""
|
||||
Write-Host " ── 海外模型 ──" -ForegroundColor White
|
||||
Write-Host " 8) Claude 9) GPT"
|
||||
Write-Host ""
|
||||
Write-Host " ── 本地 ──" -ForegroundColor White
|
||||
Write-Host " 10) Ollama 本地模型"
|
||||
Write-Host ""
|
||||
|
||||
$choice = Read-Host " 请输入编号 [1]"
|
||||
if ([string]::IsNullOrEmpty($choice)) { $choice = "1" }
|
||||
|
||||
$modelConfigs = @{
|
||||
"1" = @{ model="deepseek-chat"; baseUrl="https://api.deepseek.com/v1"; provider="custom"; label="DeepSeek API Key"; hint="获取: https://platform.deepseek.com/api_keys"; needKey=$true }
|
||||
"2" = @{ model="moonshot-v1-auto"; baseUrl="https://api.moonshot.cn/v1"; provider="custom"; label="Moonshot API Key"; hint="获取: https://platform.moonshot.cn/console/api-keys"; needKey=$true }
|
||||
"3" = @{ model="qwen-plus"; baseUrl="https://dashscope.aliyuncs.com/compatible-mode/v1"; provider="custom"; label="通义千问 API Key"; hint="获取: https://dashscope.console.aliyun.com/apiKey(有免费额度)"; needKey=$true }
|
||||
"4" = @{ model="glm-4-plus"; baseUrl="https://open.bigmodel.cn/api/paas/v4"; provider="custom"; label="智谱 API Key"; hint="获取: https://open.bigmodel.cn/usercenter/apikeys"; needKey=$true }
|
||||
"5" = @{ model="abab6.5s-chat"; baseUrl="https://api.minimax.chat/v1"; provider="custom"; label="MiniMax API Key"; hint="获取: https://platform.minimaxi.com/"; needKey=$true }
|
||||
"6" = @{ model="doubao-pro-256k"; baseUrl="https://ark.cn-beijing.volces.com/api/v3"; provider="custom"; label="火山引擎 API Key"; hint="获取: https://console.volcengine.com/ark"; needKey=$true }
|
||||
"7" = @{ model="deepseek-ai/DeepSeek-V3"; baseUrl="https://api.siliconflow.cn/v1"; provider="custom"; label="硅基流动 API Key"; hint="获取: https://cloud.siliconflow.cn/account/ak"; needKey=$true }
|
||||
"8" = @{ model="claude-sonnet-4-20250514"; baseUrl=""; provider="anthropic"; label="Anthropic API Key"; hint="获取: https://console.anthropic.com/settings/keys(需翻墙)"; needKey=$true }
|
||||
"9" = @{ model="gpt-4o"; baseUrl=""; provider="openai"; label="OpenAI API Key"; hint="获取: https://platform.openai.com/api-keys(需翻墙)"; needKey=$true }
|
||||
"10" = @{ model="llama3.2"; baseUrl="http://127.0.0.1:11434/v1"; provider="custom"; label=""; hint="先安装 Ollama (https://ollama.com),运行: ollama run llama3.2"; needKey=$false }
|
||||
}
|
||||
|
||||
$cfg = $modelConfigs[$choice]
|
||||
if (-not $cfg) {
|
||||
Write-Yellow " 未知选项,使用默认 DeepSeek"
|
||||
$cfg = $modelConfigs["1"]
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Cyan " $($cfg.hint)"
|
||||
Write-Host ""
|
||||
|
||||
$apiKey = ""
|
||||
if ($cfg.needKey) {
|
||||
$apiKey = Read-Host " 请输入 $($cfg.label)"
|
||||
if ([string]::IsNullOrEmpty($apiKey)) {
|
||||
Write-Yellow " ⚠ 未输入 API Key,稍后可通过 Config.html 配置"
|
||||
}
|
||||
}
|
||||
|
||||
# 写配置
|
||||
if ($cfg.provider -eq "custom" -and $cfg.baseUrl) {
|
||||
$configJson = @"
|
||||
{
|
||||
"gateway": {
|
||||
"mode": "local",
|
||||
"auth": { "token": "uclaw" }
|
||||
},
|
||||
"agent": {
|
||||
"model": "$($cfg.model)",
|
||||
"apiKey": "$apiKey",
|
||||
"baseUrl": "$($cfg.baseUrl)"
|
||||
}
|
||||
}
|
||||
"@
|
||||
} else {
|
||||
$configJson = @"
|
||||
{
|
||||
"gateway": {
|
||||
"mode": "local",
|
||||
"auth": { "token": "uclaw" }
|
||||
},
|
||||
"agent": {
|
||||
"model": "$($cfg.model)",
|
||||
"apiKey": "$apiKey",
|
||||
"provider": "$($cfg.provider)"
|
||||
}
|
||||
}
|
||||
"@
|
||||
}
|
||||
|
||||
$configJson | Out-File -Encoding utf8 $CONFIG_PATH
|
||||
Write-Green " ✓ 模型配置完成: $($cfg.model)"
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
|
||||
# ============================================================
|
||||
# Step 7: 生成启动脚本 + 验证 + 摘要
|
||||
# ============================================================
|
||||
Write-Host " [6/7] 生成启动脚本 ..." -ForegroundColor White
|
||||
|
||||
$startBat = @'
|
||||
@echo off
|
||||
setlocal EnableDelayedExpansion
|
||||
chcp 65001 >nul 2>&1
|
||||
title U-Claw
|
||||
|
||||
set "DIR=%~dp0"
|
||||
set "NODE_BIN=%DIR%runtime\node-win-x64\node.exe"
|
||||
if not exist "%NODE_BIN%" set "NODE_BIN=node"
|
||||
|
||||
set "OPENCLAW_MJS=%DIR%core\node_modules\openclaw\openclaw.mjs"
|
||||
set "OPENCLAW_HOME=%DIR%data"
|
||||
set "OPENCLAW_STATE_DIR=%DIR%data\.openclaw"
|
||||
set "OPENCLAW_CONFIG_PATH=%DIR%data\.openclaw\openclaw.json"
|
||||
|
||||
REM Find available port
|
||||
set PORT=18789
|
||||
:check_port
|
||||
netstat -an | findstr ":%PORT% " | findstr "LISTENING" >nul 2>&1
|
||||
if %errorlevel%==0 (
|
||||
set /a PORT+=1
|
||||
if !PORT! gtr 18799 (echo 没有可用端口 & pause & exit /b 1)
|
||||
goto :check_port
|
||||
)
|
||||
|
||||
cd /d "%DIR%core"
|
||||
start /B "" cmd /c "timeout /t 3 /nobreak >nul && start http://127.0.0.1:!PORT!/#token=uclaw"
|
||||
"%NODE_BIN%" "%OPENCLAW_MJS%" gateway run --allow-unconfigured --force --port !PORT!
|
||||
pause
|
||||
'@
|
||||
|
||||
$startBat | Out-File -Encoding ascii "$UCLAW_DIR\start.bat"
|
||||
|
||||
Write-Green " ✓ 启动脚本已生成"
|
||||
Write-Host ""
|
||||
|
||||
# ============================================================
|
||||
# 验证
|
||||
# ============================================================
|
||||
Write-Host " [7/7] 验证安装 ..." -ForegroundColor White
|
||||
Write-Host ""
|
||||
|
||||
# Node.js
|
||||
try {
|
||||
$nodeVer = & $INSTALL_NODE --version 2>$null
|
||||
Write-Green " [✓] Node.js $nodeVer"
|
||||
} catch {
|
||||
Write-Red " [✗] Node.js"
|
||||
}
|
||||
|
||||
# OpenClaw
|
||||
if (Test-Path "$CORE_DIR\node_modules\openclaw\openclaw.mjs") {
|
||||
Write-Green " [✓] OpenClaw 已安装"
|
||||
} else {
|
||||
Write-Red " [✗] OpenClaw"
|
||||
}
|
||||
|
||||
# QQ 插件
|
||||
if (Test-Path "$CORE_DIR\node_modules\@sliverp\qqbot") {
|
||||
Write-Green " [✓] QQ 插件"
|
||||
} else {
|
||||
Write-Yellow " [⚠] QQ 插件(未安装,不影响主功能)"
|
||||
}
|
||||
|
||||
# 技能
|
||||
$installedSkills = (Get-ChildItem -Directory $SKILLS_TARGET -ErrorAction SilentlyContinue).Count
|
||||
Write-Green " [✓] 中国技能 (${installedSkills}个)"
|
||||
|
||||
# 配置
|
||||
if (Test-Path $CONFIG_PATH) {
|
||||
Write-Green " [✓] 配置文件"
|
||||
} else {
|
||||
Write-Yellow " [⚠] 配置文件(需启动后配置)"
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
|
||||
# ============================================================
|
||||
# 摘要
|
||||
# ============================================================
|
||||
$installSize = "{0:N0} MB" -f ((Get-ChildItem -Recurse $UCLAW_DIR -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum).Sum / 1MB)
|
||||
|
||||
Write-Host ""
|
||||
Write-Green " ╔══════════════════════════════════════════╗"
|
||||
Write-Green " ║ ✅ U-Claw 安装成功! ║"
|
||||
Write-Green " ╚══════════════════════════════════════════╝"
|
||||
Write-Host ""
|
||||
Write-Host " 安装位置: $UCLAW_DIR" -ForegroundColor White
|
||||
Write-Host " 大小: $installSize" -ForegroundColor White
|
||||
Write-Host ""
|
||||
Write-Host " 启动方式:" -ForegroundColor White
|
||||
Write-Host " 双击 $UCLAW_DIR\start.bat" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
Write-Host " 打开后:" -ForegroundColor White
|
||||
Write-Host " 浏览器自动打开 → 开始和 AI 对话" -ForegroundColor White
|
||||
Write-Host ""
|
||||
Write-Host " 如需重新配置模型,编辑 $CONFIG_PATH" -ForegroundColor DarkGray
|
||||
Write-Host " 卸载: 删除 $UCLAW_DIR 文件夹" -ForegroundColor DarkGray
|
||||
Write-Host ""
|
||||
Write-Host " 按回车关闭..." -ForegroundColor DarkGray
|
||||
Read-Host
|
||||
1122
website/install.sh
Executable file
1122
website/install.sh
Executable file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user