diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 9609411..54ae7d5 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -24,4 +24,4 @@ rtk gain --history # Per-command savings history rtk discover # Find missed rtk opportunities rtk proxy # Run raw (no filtering) but track usage ``` - + \ No newline at end of file diff --git a/claude-dev-stack/.env b/claude-dev-stack/.env new file mode 100644 index 0000000..6632a6f --- /dev/null +++ b/claude-dev-stack/.env @@ -0,0 +1,43 @@ +# ============================================================= +# Claude Dev Stack 配置文件 +# 复制为 .env 并按需填写 +# ============================================================= + +# ── Claude / API 配置 ──────────────────────────────────────── +# 推荐:灵眸 AI(国内直连,无需代理)https://docs.lmuai.com/docs/tools/claude-code +ANTHROPIC_AUTH_TOKEN=sk-ccaf8169bce7c735dfa1f021ec326b3904842dfd50e1ae817c3417017e0d8ee0 +ANTHROPIC_BASE_URL=https://api.lmuai.com + +# 备选:Anthropic 官方 API Key(海外直连) +# ANTHROPIC_API_KEY= +# ANTHROPIC_BASE_URL=https://api.anthropic.com + +# 备选:DeepSeek 兼容接口 +# ANTHROPIC_API_KEY= +# ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic + +# 默认使用的模型 +# 灵眸可选:claude-opus-4-7 | claude-sonnet-4-6 | claude-sonnet-4-5 | claude-haiku-4-5 +# DeepSeek可选:deepseek-v4-pro +CLAUDE_MODEL=claude-sonnet-4-6 + +# ── WSL2 ──────────────────────────────────────────────────── +# WSL2 发行版名称(wsl --list 查看已安装发行版) +WSL_DISTRO=Ubuntu + +# 设为 true 可跳过 WSL2 安装步骤(已安装时使用) +SKIP_WSL_INSTALL=false + +# ── Unity MCP ─────────────────────────────────────────────── +# unity-mcp-server 自动克隆至 WSL2 ~/.mcp-servers/unity-mcp-server/ +# Unity Plugin 需手动通过 Package Manager 安装: +# https://github.com/AnkleBreaker-Studio/unity-mcp-plugin.git +# (无需额外配置) + +# ── Rust / Token Killer ────────────────────────────────────── +# (暂无需配置,预留扩展用) +# CARGO_REGISTRY_MIRROR=https://rsproxy.cn/ + +# ── Docker 镜像加速(可选)────────────────────────────────── +# 若 WSL2 内需要 Docker,可配置国内加速镜像(逗号分隔) +# DOCKER_REGISTRY_MIRRORS=https://docker.m.daocloud.io,https://hub-mirror.c.163.com diff --git a/windows-dev-stack/deploy.ps1 b/windows-dev-stack/deploy.ps1 index 8a0efb5..95ab49a 100644 --- a/windows-dev-stack/deploy.ps1 +++ b/windows-dev-stack/deploy.ps1 @@ -103,13 +103,18 @@ function Refresh-Path { # ────────────────────────────────────────────────────────────── function Install-Winget { param([string]$Id, [string]$DisplayName) - $wg = Get-Command winget -ErrorAction SilentlyContinue - if (-not $wg) { + # pwsh (Core) 里 winget 不在 PATH,尝试固定路径 + $wgPath = (Get-Command winget -ErrorAction SilentlyContinue)?.Source + if (-not $wgPath) { + $wgPath = "$env:LOCALAPPDATA\Microsoft\WindowsApps\winget.exe" + if (-not (Test-Path $wgPath)) { $wgPath = $null } + } + if (-not $wgPath) { Write-Warn "未找到 winget,请手动安装 $DisplayName" return $false } Write-Info "winget install $Id ..." - winget install --id $Id --silent --accept-source-agreements --accept-package-agreements 2>&1 | Out-Null + & $wgPath install --id $Id --silent --accept-source-agreements --accept-package-agreements 2>&1 | Out-Null Refresh-Path return $true } @@ -576,7 +581,12 @@ if ($cargoCmd) { Write-OK "Rust 已安装: $($rustcVer.Trim())" } else { # 检查 winget 是否已记录安装(避免重复安装时阻塞) - $wgList = winget list --id Rustlang.Rustup --accept-source-agreements 2>&1 | Out-String + $wgPath = (Get-Command winget -ErrorAction SilentlyContinue)?.Source + if (-not $wgPath) { + $fallback = "$env:LOCALAPPDATA\Microsoft\WindowsApps\winget.exe" + if (Test-Path $fallback) { $wgPath = $fallback } + } + $wgList = if ($wgPath) { & $wgPath list --id Rustlang.Rustup --accept-source-agreements 2>&1 | Out-String } else { "" } if ($wgList -match "Rustlang.Rustup") { Write-Info "rustup 已安装,但当前会话 PATH 未更新。已将 $cargoBin 加入 PATH" # rustup 首次运行会初始化 stable 工具链 @@ -586,14 +596,16 @@ if ($cargoCmd) { } else { Write-Info "通过 winget 安装 Rust (rustup)..." $ok = Install-Winget "Rustlang.Rustup" "Rustup" - if (Test-Path $cargoBin) { $env:Path = "$cargoBin;$env:Path" } - Refresh-Path - $cargoCmd = Get-Command cargo -ErrorAction SilentlyContinue - if ($cargoCmd) { - Write-OK "Rust 安装完成: $(& rustc --version 2>&1)" - } else { - Write-Warn "Rust 安装后未找到 cargo,请关闭并重开终端后继续" - Write-Warn " 或手动安装:https://rustup.rs" + if ($ok) { + if (Test-Path $cargoBin) { $env:Path = "$cargoBin;$env:Path" } + Refresh-Path + $cargoCmd = Get-Command cargo -ErrorAction SilentlyContinue + if ($cargoCmd) { + Write-OK "Rust 安装完成: $(& rustc --version 2>&1)" + } else { + Write-Warn "Rust 安装后未找到 cargo,请关闭并重开终端后继续" + Write-Warn " 或手动安装:https://rustup.rs" + } } } }