Cross-platform Sing-box and Mihomo configuration management and core auto-update tool. Pure Rust CLI implementation.
- sing-box - Direct download from GitHub releases
- mihomo - Direct download from GitHub releases (MetaCubeX/mihomo)
- Stable and prerelease version support
- Auto backup before replacement
- Multiple subscription sources
- Auto-refresh on schedule
- Custom save paths per subscription
- Interactive - Menu-driven CLI interface
- One-time - Single update and exit
- Scheduled - Background auto-update (configurable interval)
- macOS (darwin/amd64, darwin/arm64)
- Linux (linux/amd64, linux/arm64)
- Windows (windows/amd64)
# Build
cargo build --release
# Interactive mode (menu-driven)
./target/release/singbox-manager --interactive
# One-time update (non-interactive)
./target/release/singbox-manager --once
# Custom config file
./target/release/singbox-manager -c /path/to/config.json --once
# Show version
./target/release/singbox-manager --versionCreate config.json:
{
"subscriptions": [
{
"name": "My Subscription",
"url": "https://your-subscription-url",
"save_path": "/path/to/config.json"
}
],
"update_interval_hours": 24,
"singbox_core_update": {
"enabled": true,
"install_path": "/usr/local/bin/sing-box",
"check_prerelease": false
},
"mihomo_core_update": {
"enabled": true,
"install_paths": [
"/usr/local/bin/mihomo",
"/opt/homebrew/bin/mihomo"
],
"check_prerelease": true
}
}| Field | Description |
|---|---|
subscriptions |
List of subscription sources |
subscriptions[].name |
Display name |
subscriptions[].url |
Subscription URL |
subscriptions[].save_path |
Where to save the config |
update_interval_hours |
Auto-update interval (hours) |
singbox_core_update.enabled |
Enable sing-box core updates |
singbox_core_update.install_path |
Installation path |
singbox_core_update.check_prerelease |
Use prerelease versions |
mihomo_core_update.enabled |
Enable mihomo core updates |
mihomo_core_update.install_paths |
List of installation paths |
mihomo_core_update.check_prerelease |
Use prerelease (Alpha) versions |
singbox-manager [OPTIONS]
-i, --interactive Interactive menu mode
-c, --config <FILE> Config file path (default: config.json)
-o, --once Execute update once and exit
-v, --version Show version informationconfig.json contains sensitive subscription URLs - never commit to Git!
# Use example config
cp config.example.json config.json
# Edit with your settings- Check latest version via GitHub redirect (no API rate limit for stable)
- Download platform-specific binary (tar.gz for sing-box, gz for mihomo)
- Extract to temporary directory
- Backup existing binary (if exists)
- Install new binary with correct permissions
- Cleanup temporary files
- Fetch subscription URL
- Parse and validate config
- Save to configured path
- Repeat for all subscriptions
- sing-box - 从 GitHub releases 直接下载
- mihomo - 从 GitHub releases 直接下载 (MetaCubeX/mihomo)
- 支持稳定版和预发布版
- 替换前自动备份
- 多订阅源支持
- 定时自动刷新
- 每个订阅可配置独立保存路径
- 交互式 - 菜单驱动的 CLI 界面
- 一次性 - 单次更新后退出
- 定时 - 后台自动更新(可配置间隔)
- macOS (darwin/amd64, darwin/arm64)
- Linux (linux/amd64, linux/arm64)
- Windows (windows/amd64)
# 编译
cargo build --release
# 交互模式(菜单驱动)
./target/release/singbox-manager --interactive
# 一次性更新(非交互)
./target/release/singbox-manager --once
# 自定义配置文件
./target/release/singbox-manager -c /path/to/config.json --once
# 显示版本
./target/release/singbox-manager --version创建 config.json:
{
"subscriptions": [
{
"name": "我的订阅",
"url": "https://your-subscription-url",
"save_path": "/path/to/config.json"
}
],
"update_interval_hours": 24,
"singbox_core_update": {
"enabled": true,
"install_path": "/usr/local/bin/sing-box",
"check_prerelease": false
},
"mihomo_core_update": {
"enabled": true,
"install_paths": [
"/usr/local/bin/mihomo",
"/opt/homebrew/bin/mihomo"
],
"check_prerelease": true
}
}| 字段 | 说明 |
|---|---|
subscriptions |
订阅源列表 |
subscriptions[].name |
显示名称 |
subscriptions[].url |
订阅 URL |
subscriptions[].save_path |
配置保存路径 |
update_interval_hours |
自动更新间隔(小时) |
singbox_core_update.enabled |
启用 sing-box 核心更新 |
singbox_core_update.install_path |
安装路径 |
singbox_core_update.check_prerelease |
使用预发布版本 |
mihomo_core_update.enabled |
启用 mihomo 核心更新 |
mihomo_core_update.install_paths |
安装路径列表 |
mihomo_core_update.check_prerelease |
使用预发布 (Alpha) 版本 |
config.json 包含敏感的订阅 URL,切勿提交到 Git!
# 使用示例配置
cp config.example.json config.json
# 编辑你的设置MIT License