一个用 Rust 编写的开发环境探测工具,用于打印机器上的开发环境信息(如 Node、npm、pnpm、Rust、Git、数据库、浏览器等)。
支持直接远程执行脚本。脚本内部会从 GitHub Release 下载对应平台二进制,不会本地编译。
Linux/macOS:
curl -fsSL https://raw.githubusercontent.com/harkerhand/devfetch/master/scripts/install.sh | bashWindows PowerShell:
irm https://raw.githubusercontent.com/harkerhand/devfetch/master/scripts/install.ps1 | iex默认安装位置:
- Linux/macOS:
~/.local/bin/devfetch - Windows:
~/.local/bin/devfetch.exe
可选环境变量:
DEVFETCH_REPO:仓库地址(默认harkerhand/devfetch)DEVFETCH_VERSION:版本号(默认latest,也可传v0.1.2)DEVFETCH_INSTALL_DIR:安装目录
示例(指定版本和目录):
Linux/macOS:
DEVFETCH_INSTALL_DIR="$HOME/bin" \
DEVFETCH_VERSION="v0.1.2" \
curl -fsSL https://raw.githubusercontent.com/harkerhand/devfetch/master/scripts/install.sh | bashWindows PowerShell:
$env:DEVFETCH_INSTALL_DIR = "$HOME\\bin"
$env:DEVFETCH_VERSION = "v0.1.2"
irm https://raw.githubusercontent.com/harkerhand/devfetch/master/scripts/install.ps1 | iex从 crates.io(若已发布):
cargo install devfetch从 GitHub 仓库安装:
cargo install --git https://github.com/harkerhand/devfetch.git --lockedcargo build --release生成二进制:
- Linux/macOS:
target/release/devfetch - Windows:
target/release/devfetch.exe
Linux/macOS(远程执行):
curl -fsSL https://raw.githubusercontent.com/harkerhand/devfetch/master/scripts/uninstall.sh | bashWindows PowerShell(远程执行):
irm https://raw.githubusercontent.com/harkerhand/devfetch/master/scripts/uninstall.ps1 | iex自定义目录时,同样通过 DEVFETCH_INSTALL_DIR 传入相同路径。
# 默认输出(YAML 风格)
devfetch
# JSON 输出
devfetch --json
# TOML 输出
devfetch --toml
# Markdown 输出
devfetch --markdown
# 只看系统 + 二进制工具
devfetch --system --binary
# 单项 helper(强制 JSON)
devfetch --helper Node- 命令找不到:请确认安装目录已加入
PATH。 - 首次运行较慢:工具会调用系统命令探测版本,属于正常行为。