安装
git clone https://github.com/pdg-global/rusty.gitcd rustycargo build --release构建产物位于 ./target/release/rusty。将它移动到 PATH 中的某个目录:
# macOS / Linuxsudo cp ./target/release/rusty /usr/local/bin/
# 或者把 target 目录加入 PATHexport PATH="$PWD/target/release:$PATH"预编译二进制文件
Section titled “预编译二进制文件”预编译的二进制文件可在 GitHub releases 页面 获取。下载适合你平台的版本并加入 PATH 即可。
| 平台 | 架构 | 状态 |
|---|---|---|
| macOS | aarch64(Apple Silicon) | 完整支持 |
| macOS | x86_64(Intel) | 完整支持 |
| macOS | 通用(arm64 + x86_64) | 完整支持 |
| Linux | x86_64(GNU libc) | 完整支持 |
| Linux | aarch64(GNU libc) | 完整支持 |
| Linux | armv7(GNU libc) | 完整支持 |
| Linux | x86_64(musl,静态) | 完整支持 |
| Linux | aarch64(musl,静态) | 完整支持 |
| FreeBSD | x86_64 | 完整支持 |
Rusty 编译为单个静态链接的二进制文件,没有运行时依赖。所有原生依赖(OpenSSL 等)都通过 Rust crate 生态内联打包。
- Rust 工具链 1.75+(2021 edition)
- 一个 C 编译器(Linux 上部分内联 C 库需要)
通过 rustup 安装 Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh安装完成后,验证 Rusty 是否可用:
rusty --help这会显示所有可用的 CLI 参数与运行模式。
Shell 补全
Section titled “Shell 补全”Rusty 通过 clap 支持 shell 补全。为你的 shell 生成补全脚本:
# Bashrusty --completions bash > ~/.bash_completion.d/rusty
# Zshrusty --completions zsh > ~/.zfunc/_rusty
# Fishrusty --completions fish > ~/.config/fish/completions/rusty.fish