在 Windows 上安装
通过 PowerShell 下载并解压压缩包,然后将目录加入 PATH。
Windows 支持仍处于实验阶段,使用时自行评估风险。
我们建议使用 Windows Subsystem for Linux(WSL)获得更稳定的体验。
手动安装
下载 CLI 压缩包
可以直接从 GitHub 发布页面下载 Nanocl 压缩包。
也可以用以下命令下载并解压:
$dst = "$env:USERPROFILE\nanocl"
New-Item -ItemType Directory -Force -Path $dst | Out-Null
Invoke-WebRequest -Uri "https://github.com/next-hat/nanocl/releases/download/nanocl-0.18.0/nanocl_0.18.0_windows_amd64.tar.gz" -OutFile "$dst\nanocl.tar.gz"解压后的目录结构:
<extract-dir>
├─ bin\
│ └─ nanocl.exe (the nanocl binary)
└─ share\
└─ man\
└─ man1\ (multiple man pages for nanocl and its subcommands)# Windows 10+ includes tar
& tar -xzf "$dst\nanocl.tar.gz" -C $dst
# The binary is under bin\nanocl.exe
$bin = Join-Path $dst 'bin'
# Add to PATH (current session):
$env:Path = "$env:Path;$bin"
# Or copy to a directory already in PATH (requires admin):
# Copy-Item (Join-Path $bin 'nanocl.exe') "$env:ProgramFiles\nanocl\nanocl.exe" -Force从源码编译
如果使用其他架构,或希望从源码构建:
前提条件:
- 安装 Rust 工具链:https://www.rust-lang.org/tools/install
- Visual Studio Build Tools(C++ 构建工具)或可用的 MSVC 工具链
- 未内置时需要 OpenSSL 和 libpq 开发库;Windows 构建通常会在可用时静态链接这些库。
cargo install nanocl最后更新于