feat: add Linux support, pnpm build fixes, and website updates
- Add Linux x64 platform support (运行.sh, build script, docs) - Fix pnpm-first build logic across all launcher scripts - Update website: 3→4 platforms, Linux in 3-step guide - Update docs: Qwen free tier, StepFun model, 省钱提示 - Fix .gitignore for build artifacts
This commit is contained in:
@@ -150,10 +150,12 @@ U-Claw 已预装 52 个技能,以下是最实用的:
|
||||
遇到问题?
|
||||
══════════════════════
|
||||
|
||||
1. 插 U 盘,双击「启动菜单」
|
||||
2. 选 [8] 诊断修复
|
||||
3. 如果修不好,选 [11] 重置
|
||||
4. 重置前会自动提醒你备份
|
||||
1. 插 U 盘
|
||||
2. Mac/Windows: 打开「启动菜单」
|
||||
Linux: 运行 `bash ./运行.sh`
|
||||
3. 选 [8] 诊断修复
|
||||
4. 如果修不好,选 [11] 重置
|
||||
5. 重置前会自动提醒你备份
|
||||
|
||||
加入社区:
|
||||
- 官网: u-claw.org
|
||||
|
||||
@@ -21,10 +21,11 @@ U 盘里有什么?
|
||||
═══════════════
|
||||
U-Claw/
|
||||
├── 运行.command <- Mac 用户双击这个
|
||||
├── 运行.sh <- Linux 用户运行: bash ./运行.sh
|
||||
├── 运行.bat <- Windows 用户双击这个
|
||||
├── 安装到电脑.command <- Mac 永久安装
|
||||
├── 安装到电脑.bat <- Windows 永久安装
|
||||
├── runtime/ <- Node.js 运行环境 (Mac/Win)
|
||||
├── runtime/ <- Node.js 运行环境 (Mac/Linux/Win)
|
||||
├── openclaw/ <- OpenClaw 源码 + 依赖
|
||||
├── memory/ <- AI 记忆文件
|
||||
├── persona/ <- AI 人格配置
|
||||
@@ -50,6 +51,12 @@ U-Claw/
|
||||
3. 双击 "运行.bat"
|
||||
4. 等待启动完成
|
||||
|
||||
Linux 用户:
|
||||
1. 插入 U 盘
|
||||
2. 打开 U-Claw 文件夹
|
||||
3. 运行: chmod +x 运行.sh && ./运行.sh
|
||||
4. 等待启动完成
|
||||
|
||||
首次运行可能需要几分钟安装依赖(已预打包,无需联网)
|
||||
|
||||
|
||||
@@ -65,12 +72,17 @@ U-Claw/
|
||||
2. 按提示操作
|
||||
3. 安装后在命令提示符输入 openclaw 即可使用
|
||||
|
||||
Linux 用户:
|
||||
暂不提供一键安装到系统。
|
||||
直接运行 `bash ./运行.sh` 即可使用。
|
||||
|
||||
安装位置: ~/.uclaw/ (Mac) 或 %USERPROFILE%\.uclaw\ (Win)
|
||||
|
||||
|
||||
系统要求
|
||||
═══════════════
|
||||
- macOS 12+ (Intel 或 Apple Silicon)
|
||||
- Linux x64 (glibc 环境,bash)
|
||||
- Windows 10/11 (64位)
|
||||
- 内存: 2GB 以上(推荐 4GB+)
|
||||
- 磁盘: 2GB 可用空间
|
||||
|
||||
@@ -8,8 +8,22 @@ set "OPENCLAW_DIR=%UCLAW_DIR%openclaw"
|
||||
set "NODE_DIR=%UCLAW_DIR%runtime\node-win-x64"
|
||||
set "NODE_BIN=%NODE_DIR%\node.exe"
|
||||
set "NPM_BIN=%NODE_DIR%\npm.cmd"
|
||||
set "PNPM_BIN=%NODE_DIR%\pnpm.cmd"
|
||||
set "PATH=%NODE_DIR%;%PATH%"
|
||||
|
||||
goto MENU
|
||||
|
||||
:ENSURE_PNPM
|
||||
if exist "%PNPM_BIN%" goto :eof
|
||||
echo 缺少 pnpm,正在补充安装...
|
||||
call "%NPM_BIN%" install -g pnpm --registry=https://registry.npmmirror.com
|
||||
if not exist "%PNPM_BIN%" (
|
||||
echo [错误] pnpm 安装失败,无法继续构建
|
||||
pause
|
||||
goto MENU
|
||||
)
|
||||
goto :eof
|
||||
|
||||
:MENU
|
||||
cls
|
||||
echo.
|
||||
@@ -118,7 +132,13 @@ if not exist "%OPENCLAW_DIR%\node_modules" (
|
||||
call "%NPM_BIN%" install --registry=https://registry.npmmirror.com
|
||||
)
|
||||
cd /d "%OPENCLAW_DIR%"
|
||||
call "%NPM_BIN%" run build
|
||||
call :ENSURE_PNPM
|
||||
call "%PNPM_BIN%" run build
|
||||
if not exist "%OPENCLAW_DIR%\dist" (
|
||||
echo [错误] 构建失败,请检查上方错误信息
|
||||
pause
|
||||
goto MENU
|
||||
)
|
||||
echo.
|
||||
echo 构建完成!
|
||||
pause
|
||||
@@ -136,17 +156,24 @@ if not exist "%OPENCLAW_DIR%\node_modules" (
|
||||
if not exist "%OPENCLAW_DIR%\dist" (
|
||||
echo 先构建...
|
||||
cd /d "%OPENCLAW_DIR%"
|
||||
call "%NPM_BIN%" run build 2>nul
|
||||
call :ENSURE_PNPM
|
||||
call "%PNPM_BIN%" run build
|
||||
if not exist "%OPENCLAW_DIR%\dist" (
|
||||
echo [错误] 构建失败,请检查上方错误信息
|
||||
pause
|
||||
goto MENU
|
||||
)
|
||||
)
|
||||
cd /d "%OPENCLAW_DIR%"
|
||||
REM 首次运行走 onboard,之后直接启动
|
||||
if not exist "%USERPROFILE%\.openclaw\openclaw.json" (
|
||||
echo 首次配置...
|
||||
"%NODE_BIN%" openclaw.mjs onboard --install-daemon
|
||||
if errorlevel 1 goto MENU
|
||||
)
|
||||
echo.
|
||||
echo 启动 OpenClaw 服务...
|
||||
"%NODE_BIN%" openclaw.mjs 2>nul || call "%NPM_BIN%" start
|
||||
"%NODE_BIN%" openclaw.mjs || call "%NPM_BIN%" start
|
||||
pause
|
||||
goto MENU
|
||||
|
||||
|
||||
@@ -29,8 +29,23 @@ else
|
||||
fi
|
||||
NODE_BIN="$NODE_DIR/bin/node"
|
||||
NPM_BIN="$NODE_DIR/bin/npm"
|
||||
PNPM_BIN="$NODE_DIR/bin/pnpm"
|
||||
export PATH="$NODE_DIR/bin:$PATH"
|
||||
|
||||
ensure_pnpm() {
|
||||
if [ -x "$PNPM_BIN" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo -e " ${YELLOW}缺少 pnpm,正在补充安装...${NC}"
|
||||
"$NPM_BIN" install -g pnpm --registry=https://registry.npmmirror.com 2>&1
|
||||
|
||||
if [ ! -x "$PNPM_BIN" ]; then
|
||||
echo -e " ${RED}错误: pnpm 安装失败,无法继续构建${NC}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 检查安装状态
|
||||
check_status() {
|
||||
HAS_MODULES="no"
|
||||
@@ -122,7 +137,10 @@ ensure_deps() {
|
||||
if [ ! -d "$OPENCLAW_DIR/dist" ]; then
|
||||
echo -e " ${YELLOW}正在构建...${NC}"
|
||||
cd "$OPENCLAW_DIR"
|
||||
"$NODE_BIN" "$NPM_BIN" run build 2>&1
|
||||
if ! ensure_pnpm; then
|
||||
return 1
|
||||
fi
|
||||
"$PNPM_BIN" run build 2>&1
|
||||
if [ ! -d "$OPENCLAW_DIR/dist" ]; then
|
||||
echo -e " ${RED}构建失败!请检查上方错误信息${NC}"
|
||||
return 1
|
||||
@@ -158,7 +176,14 @@ do_build() {
|
||||
echo ""
|
||||
ensure_deps
|
||||
cd "$OPENCLAW_DIR"
|
||||
"$NODE_BIN" "$NPM_BIN" run build 2>&1
|
||||
if ! ensure_pnpm; then
|
||||
return 1
|
||||
fi
|
||||
"$PNPM_BIN" run build 2>&1
|
||||
if [ ! -d "$OPENCLAW_DIR/dist" ]; then
|
||||
echo -e " ${RED}构建失败!请检查上方错误信息${NC}"
|
||||
return 1
|
||||
fi
|
||||
echo ""
|
||||
echo -e " ${GREEN}构建完成!${NC}"
|
||||
}
|
||||
|
||||
@@ -14,6 +14,22 @@ set "OPENCLAW_DIR=%UCLAW_DIR%openclaw"
|
||||
set "NODE_DIR=%UCLAW_DIR%runtime\node-win-x64"
|
||||
set "NODE_BIN=%NODE_DIR%\node.exe"
|
||||
set "NPM_BIN=%NODE_DIR%\npm.cmd"
|
||||
set "PNPM_BIN=%NODE_DIR%\pnpm.cmd"
|
||||
|
||||
goto MAIN
|
||||
|
||||
:ENSURE_PNPM
|
||||
if exist "%PNPM_BIN%" goto :eof
|
||||
echo 缺少 pnpm,正在补充安装...
|
||||
call "%NPM_BIN%" install -g pnpm --registry=https://registry.npmmirror.com
|
||||
if not exist "%PNPM_BIN%" (
|
||||
echo [错误] pnpm 安装失败,无法继续构建
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
goto :eof
|
||||
|
||||
:MAIN
|
||||
|
||||
if not exist "%NODE_BIN%" (
|
||||
echo [错误] 找不到 Node.js 运行环境
|
||||
@@ -43,7 +59,13 @@ if not exist "%OPENCLAW_DIR%\node_modules" (
|
||||
if not exist "%OPENCLAW_DIR%\dist" (
|
||||
echo 首次运行,正在构建...
|
||||
cd /d "%OPENCLAW_DIR%"
|
||||
call "%NPM_BIN%" run build 2>nul
|
||||
call :ENSURE_PNPM
|
||||
call "%PNPM_BIN%" run build
|
||||
if not exist "%OPENCLAW_DIR%\dist" (
|
||||
echo [错误] 构建失败,请检查上方错误信息
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
echo.
|
||||
)
|
||||
|
||||
@@ -54,10 +76,11 @@ REM 首次运行走 onboard,之后直接启动
|
||||
if not exist "%USERPROFILE%\.openclaw\openclaw.json" (
|
||||
echo 首次配置...
|
||||
"%NODE_BIN%" openclaw.mjs onboard --install-daemon
|
||||
if errorlevel 1 exit /b 1
|
||||
)
|
||||
echo.
|
||||
echo 启动 OpenClaw 服务...
|
||||
"%NODE_BIN%" openclaw.mjs 2>nul || call "%NPM_BIN%" start
|
||||
"%NODE_BIN%" openclaw.mjs || call "%NPM_BIN%" start
|
||||
|
||||
echo.
|
||||
echo OpenClaw 已退出
|
||||
|
||||
@@ -34,6 +34,7 @@ fi
|
||||
|
||||
NODE_BIN="$NODE_DIR/bin/node"
|
||||
NPM_BIN="$NODE_DIR/bin/npm"
|
||||
PNPM_BIN="$NODE_DIR/bin/pnpm"
|
||||
|
||||
if [ ! -f "$NODE_BIN" ]; then
|
||||
echo -e " ${RED}错误: 找不到 Node.js 运行环境${NC}"
|
||||
@@ -49,6 +50,21 @@ echo ""
|
||||
|
||||
export PATH="$NODE_DIR/bin:$PATH"
|
||||
|
||||
ensure_pnpm() {
|
||||
if [ -x "$PNPM_BIN" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo -e " ${YELLOW}缺少 pnpm,正在补充安装...${NC}"
|
||||
"$NPM_BIN" install -g pnpm --registry=https://registry.npmmirror.com 2>&1
|
||||
|
||||
if [ ! -x "$PNPM_BIN" ]; then
|
||||
echo -e " ${RED}错误: pnpm 安装失败,无法继续构建${NC}"
|
||||
read -p " 按回车键退出..."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 检查依赖
|
||||
if [ ! -d "$OPENCLAW_DIR/node_modules" ]; then
|
||||
echo -e " ${YELLOW}首次运行,正在安装依赖...${NC}"
|
||||
@@ -65,7 +81,8 @@ fi
|
||||
if [ ! -d "$OPENCLAW_DIR/dist" ]; then
|
||||
echo -e " ${YELLOW}首次运行,正在构建...${NC}"
|
||||
cd "$OPENCLAW_DIR"
|
||||
"$NODE_BIN" "$NPM_BIN" run build 2>&1
|
||||
ensure_pnpm
|
||||
"$PNPM_BIN" run build 2>&1
|
||||
if [ ! -d "$OPENCLAW_DIR/dist" ]; then
|
||||
echo -e " ${RED}构建失败,请检查错误信息${NC}"
|
||||
read -p " 按回车键退出..."
|
||||
|
||||
82
uclaw-scripts/运行.sh
Normal file
82
uclaw-scripts/运行.sh
Normal file
@@ -0,0 +1,82 @@
|
||||
#!/bin/bash
|
||||
# ============================================================
|
||||
# U-Claw 虾盘 - Linux 一键启动
|
||||
# 用法: bash ./运行.sh
|
||||
# ============================================================
|
||||
|
||||
set -e
|
||||
|
||||
UCLAW_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
OPENCLAW_DIR="$UCLAW_DIR/openclaw"
|
||||
NODE_DIR="$UCLAW_DIR/runtime/node-linux-x64"
|
||||
NODE_BIN="$NODE_DIR/bin/node"
|
||||
NPM_BIN="$NODE_DIR/bin/npm"
|
||||
PNPM_BIN="$NODE_DIR/bin/pnpm"
|
||||
|
||||
GREEN='\033[0;32m'
|
||||
CYAN='\033[0;36m'
|
||||
RED='\033[0;31m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
echo ""
|
||||
echo -e "${CYAN}"
|
||||
echo " ╔══════════════════════════════════════╗"
|
||||
echo " ║ U-Claw 虾盘 v1.0 ║"
|
||||
echo " ║ OpenClaw Linux 启动 ║"
|
||||
echo " ╚══════════════════════════════════════╝"
|
||||
echo -e "${NC}"
|
||||
|
||||
if [ ! -x "$NODE_BIN" ]; then
|
||||
echo -e " ${RED}错误: 找不到 Linux Node.js 运行环境${NC}"
|
||||
echo " 请确保 runtime/node-linux-x64 目录完整"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export PATH="$NODE_DIR/bin:$PATH"
|
||||
|
||||
ensure_pnpm() {
|
||||
if [ -x "$PNPM_BIN" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo -e " ${YELLOW}缺少 pnpm,正在补充安装...${NC}"
|
||||
"$NPM_BIN" install -g pnpm --registry=https://registry.npmmirror.com
|
||||
|
||||
if [ ! -x "$PNPM_BIN" ]; then
|
||||
echo -e " ${RED}错误: pnpm 安装失败,无法继续构建${NC}"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
echo -e " Node.js 版本: ${GREEN}$("$NODE_BIN" --version)${NC}"
|
||||
echo ""
|
||||
|
||||
if [ ! -d "$OPENCLAW_DIR/node_modules" ]; then
|
||||
echo -e " ${YELLOW}首次运行,正在安装依赖...${NC}"
|
||||
cd "$OPENCLAW_DIR"
|
||||
"$NPM_BIN" install --registry=https://registry.npmmirror.com
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if [ ! -d "$OPENCLAW_DIR/dist" ]; then
|
||||
echo -e " ${YELLOW}首次运行,正在构建...${NC}"
|
||||
cd "$OPENCLAW_DIR"
|
||||
ensure_pnpm
|
||||
"$PNPM_BIN" run build
|
||||
if [ ! -d "$OPENCLAW_DIR/dist" ]; then
|
||||
echo -e " ${RED}构建失败,请检查错误信息${NC}"
|
||||
exit 1
|
||||
fi
|
||||
echo ""
|
||||
fi
|
||||
|
||||
cd "$OPENCLAW_DIR"
|
||||
|
||||
if [ ! -f "$HOME/.openclaw/openclaw.json" ]; then
|
||||
echo -e " ${YELLOW}首次配置...${NC}"
|
||||
"$NODE_BIN" openclaw.mjs onboard --install-daemon
|
||||
fi
|
||||
|
||||
echo -e " ${CYAN}启动 OpenClaw 服务...${NC}"
|
||||
"$NODE_BIN" openclaw.mjs || "$NPM_BIN" start
|
||||
Reference in New Issue
Block a user