🚀 部署方式速览

部署方式 适用平台 核心命令/操作 优点
一键脚本 macOS, Linux, Windows `curl … bashpowershell …`
包管理器 各平台对应工具 brew, winget, scoop, pacman 便于后续统一更新和管理
源码编译 全平台 (需 Go 环境) git clone, ./build.shgo build 可自定义,获取最新代码

📥 方式一:一键安装脚本(最推荐)

这是官方提供的最简单的方法,脚本会自动完成下载、解压和路径配置。

macOS 和 Linux
打开终端,直接运行以下命令:

1
bash -c "$(curl -sLo- https://superfile.dev/install.sh)"

如果你比较谨慎,可以先访问 https://superfile.dev/install.sh 查看脚本内容。

Windows
以管理员身份打开 PowerShell,运行:

1
powershell -ExecutionPolicy Bypass -Command "Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://superfile.dev/install.ps1'))"

同样,脚本源码可在 https://superfile.dev/install.ps1 查看。

📦 方式二:使用包管理器

如果你习惯通过系统的包管理器来管理软件,可以选择以下命令。

  • macOS (Homebrew):

    1
    brew install superfile
  • Windows (Winget / Scoop):

    1
    2
    3
    4
    # Winget
    winget install --id yorukot.superfile
    # Scoop
    scoop install superfile
  • Arch Linux:

    1
    sudo pacman -S superfile
  • Nix:

    1
    nix profile install github:yorukot/superfile#superfile

🛠️ 方式三:从源码编译

如果你想体验最新的开发版功能,或者想自行修改代码,可以从源码构建。

1. 环境要求
确保你的系统已经安装了 Go 语言环境

2. 构建步骤

1
2
3
4
5
6
7
8
9
10
# 1. 克隆仓库(--depth=1 可以加快下载速度)
git clone https://github.com/yorukot/superfile.git --depth=1
cd superfile

# 2. 编译
# macOS / Linux
./build.sh

# Windows
go build -o bin/spf.exe

3. 添加到 PATH
为了能在任意目录下直接使用 spf 命令,需要将编译出的二进制文件所在目录加入系统环境变量。

  • macOS / Linux: 可以将文件移动到 /usr/local/bin

    1
    sudo mv ./bin/spf /usr/local/bin
  • Windows: 手动将 superfile\bin 目录添加到系统的 PATH 环境变量中。

💡 开始使用与后续管理

启动
安装完成后,在终端中输入以下命令即可启动:

1
spf

启动后,你可以使用 hjkl 或方向键导航,按 Enter 进入目录,按 ? 查看所有快捷键。

卸载
如果你需要卸载,也可以使用对应的脚本:

  • macOS / Linux:

    1
    bash -c "$(curl -sLo- https://superfile.dev/uninstall.sh)"
  • Windows:

    1
    powershell -ExecutionPolicy Bypass -Command "Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://superfile.dev/uninstall.ps1'))"

配置提示
如果你是 Vim/Neovim 用户,建议在配置中将默认的快捷键方案切换为 Vim 版本,以获得更一致的体验。