在 Windows 上安装 Aptos CLI
对于 Windows 系统,安装 Aptos CLI 工具最简单的方式是通过 PowerShell 脚本.如果该方法不可行,您也可以通过预编译二进制文件手动安装.通常不建议使用预编译二进制文件方式,因为更新过程非常手动化.
通过 PowerShell 脚本安装
Section titled “通过 PowerShell 脚本安装”-
在 PowerShell 中运行安装脚本:
Terminal window Set-ExecutionPolicy RemoteSigned -Scope CurrentUser; iwr https://aptos.dev/scripts/install_cli.ps1 | iex -
打开新的终端并运行 aptos help 验证安装是否成功.
- 您应该能看到 CLI 可运行的命令列表.
- 这是未来学习每个命令具体用法的有用资源.
通过包管理器安装(可选)
Section titled “通过包管理器安装(可选)”如果已安装 Scoop,可运行以下命令安装 Aptos CLI:
Section titled “如果已安装 Scoop,可运行以下命令安装 Aptos CLI:”scoop install https://aptos.dev/scoop/aptos.json
如果已安装 Chocolatey,可运行以下命令安装 Aptos CLI:
Section titled “如果已安装 Chocolatey,可运行以下命令安装 Aptos CLI:”choco install aptos
如果已安装 winget,可运行以下命令安装 Aptos CLI:
Section titled “如果已安装 winget,可运行以下命令安装 Aptos CLI:”winget install aptos
通过预编译二进制文件安装(备用方案)
Section titled “通过预编译二进制文件安装(备用方案)”-
访问 .
-
展开 “Assets” 查看预编译二进制文件.
-
下载适用于 Windows 的 zip 文件.
- 文件名格式类似:
aptos-cli-<version>-Windows-x86_64.zip
- 下载时可能需要忽略”可疑文件”警告.
- 文件名格式类似:
-
解压下载的文件.
- 将文件移动至您未来希望调用
aptos
的任意文件夹.
- 将文件移动至您未来希望调用
-
右键点击,然后复制可执行文件路径.
例如
C:\Users\<username>\Downloads\aptos-cli-3.1.0-Windows-x86_64\aptos.exe
. -
通过开始菜单打开 PowerShell.
-
运行 help 命令验证安装.
使用之前复制的路径调用 Aptos CLI. 例如
C:\Users\<username>\Downloads\aptos-cli-3.1.0-Windows-x86_64\aptos.exe help
.