跳转到内容

安装和升级

Tarsail 通过 GitHub Releases 发布预构建二进制文件。

安装脚本会根据你的操作系统和 CPU 架构下载匹配资产,使用该 release 的 SHA256SUMS 校验文件,安装到 PATH 目录,并让 tarsail 命令全局可用。

Windows、macOS 或 Linux 上的 PowerShell:

Terminal window
irm https://tarsail.plystra.com/install.ps1 | iex

Linux 或 macOS 上的 POSIX shell:

Terminal window
curl -fsSL https://tarsail.plystra.com/install.sh | sh

如果没有 curl

Terminal window
wget -qO- https://tarsail.plystra.com/install.sh | sh

如果当前 shell 没有立即识别新的 PATH,打开一个新终端。

Terminal window
tarsail version
tarsail help

Windows 上 PowerShell installer 默认安装到当前用户 PATH 目录:

%LOCALAPPDATA%\Programs\Tarsail\bin

Linux 和 macOS 上两个 installer 都默认安装到:

/usr/local/bin

Unix installer 只会在目标目录不可写时使用 sudo

再次运行同一条安装命令即可升级。

PowerShell:

Terminal window
irm https://tarsail.plystra.com/install.ps1 | iex

POSIX shell:

Terminal window
curl -fsSL https://tarsail.plystra.com/install.sh | sh

脚本会用最新 GitHub Release 资产替换已有 tarsail 二进制文件。

TARSAIL_VERSION 设置为 release ID。

PowerShell:

Terminal window
$env:TARSAIL_VERSION = "20260622-194500-a1b2c3d4e5f6"
irm https://tarsail.plystra.com/install.ps1 | iex

POSIX shell:

Terminal window
curl -fsSL https://tarsail.plystra.com/install.sh | TARSAIL_VERSION=20260622-194500-a1b2c3d4e5f6 sh

Tarsail release ID 会根据被推送 commit 的日期和短 commit hash 生成:

YYYYMMDD-HHMMSS-<12-char-commit>

PowerShell:

Terminal window
$env:TARSAIL_INSTALL_DIR = "C:\Tools\Tarsail"
irm https://tarsail.plystra.com/install.ps1 | iex

POSIX shell:

Terminal window
curl -fsSL https://tarsail.plystra.com/install.sh | TARSAIL_INSTALL_DIR="$HOME/.local/bin" sh

请确认自定义目录已经在 PATH 中。

Release assets 会为以下系统构建:

系统架构资产格式
Linuxamd64, arm64.tar.gz
macOSamd64, arm64.tar.gz
Windowsamd64, arm64.zip

脚本会自动选择资产名称:

tarsail_<version>_<os>_<arch>.tar.gz
tarsail_<version>_<os>_<arch>.zip

示例:

tarsail_20260622-194500-a1b2c3d4e5f6_linux_amd64.tar.gz
tarsail_20260622-194500-a1b2c3d4e5f6_darwin_arm64.tar.gz
tarsail_20260622-194500-a1b2c3d4e5f6_windows_amd64.zip

默认从这里下载:

https://github.com/plystra/tarsail/releases

如果用于 fork 或私有测试,可以覆盖仓库:

Terminal window
curl -fsSL https://tarsail.plystra.com/install.sh | TARSAIL_REPO=owner/repo sh
Terminal window
$env:TARSAIL_REPO = "owner/repo"
irm https://tarsail.plystra.com/install.ps1 | iex

脚本会使用同一个 GitHub Release 下的 SHA256SUMS 校验下载归档。

更严格的环境中,可以先下载并检查脚本:

Terminal window
curl -fsSL https://tarsail.plystra.com/install.sh -o install.sh
less install.sh
sh install.sh
Terminal window
irm https://tarsail.plystra.com/install.ps1 -OutFile install.ps1
notepad .\install.ps1
.\install.ps1

不要运行来自不可信域名的安装脚本。

维护者通过推送到 main 发布二进制文件:

Terminal window
git push origin main

GitHub Actions release workflow 会运行测试,根据被推送 commit 的日期和短 commit hash 生成 release ID,构建 Linux、macOS 和 Windows 的 release assets,写入 SHA256SUMS,为该 release ID 创建 GitHub Release,并把它标记为 GitHub latest release。

也可以在 GitHub Actions 中通过 workflow_dispatch 手动运行 release workflow。手动运行会使用检出的 commit,并采用相同的日期加 hash 的 release ID 格式。

删除已安装二进制文件。

Windows PowerShell:

Terminal window
Remove-Item "$env:LOCALAPPDATA\Programs\Tarsail\bin\tarsail.exe"

Linux 或 macOS:

Terminal window
sudo rm -f /usr/local/bin/tarsail

如果安装到了自定义目录,请删除该目录下的二进制文件。