$NodeDir = "C:\Users\wyc\AppData\Roaming\JetBrains\CLion2026.1\node\versions\24.14.1" $ProjectDir = "D:\ae\tools\tizi" $NodeExe = Join-Path $NodeDir "node.exe" if (!(Test-Path -LiteralPath $NodeExe -PathType Leaf)) { throw "Node.js 不存在:$NodeExe" } if (!(Test-Path -LiteralPath $ProjectDir -PathType Container)) { throw "项目目录不存在:$ProjectDir" } $env:Path = "$NodeDir;$env:Path" $CodexProCommand = Get-Command "codexpro" -CommandType Application -ErrorAction SilentlyContinue | Select-Object -First 1 if ($null -eq $CodexProCommand) { throw "PATH 中找不到 codexpro 命令。请先执行:Get-Command codexpro -All" } Write-Host "Node.js:$(& $NodeExe --version)" Write-Host "CodexPro:$($CodexProCommand.Source)" Write-Host "项目目录:$ProjectDir" Set-Location -LiteralPath $ProjectDir & $CodexProCommand.Source start --root $ProjectDir exit $LASTEXITCODE