Catalog npm
PACKAGE EXPLORERView in registry

@0xsnx/subbridge

npm

SubBridge: Clash / Clash.Meta YAML to sing-box node injector — extract nodes, auto group by country, inject into template

clashclash-metaclash-subscriptionclash-to-sing-boxcountry-groupnode-injectorproxysing-boxsing-box-configsubscription-convertertemplate
Versions collected1
Direct dependencies12From release 0.3.0
Last observed21 Oct, 11:30 UTC

README

Current package documentation

SubBridge

你的 sing-box 模板,你说了算。把 Clash 订阅的节点注进去,仅此而已。

Clash / Clash.Meta YAML → sing-box 节点注入器 · Clash 转 sing-box · Clash 订阅转换 · 生成完整可运行的 sing-box 配置

Stars Version npm npm downloads Node Bun License


占位符

模板中用这些 JSON 友好的占位符标记注入位置,IDE 语法高亮不受影响:

占位符位置展开结果
{ "$subbridge": "nodes" }outbounds 数组所有节点的 outbound 对象
{ "$subbridge": "country_groups" }outbounds 数组每个国家的 selector + urltest 对象组
"$nodes"字符串数组所有节点的 tag 列表
"$nodes:HK"字符串数组香港节点的 tag 列表(支持 23+ 地区代码)

支持协议:Shadowsocks、VMess、VLESS、Trojan、Hysteria2、HTTP,含 TLS / uTLS / Reality / WebSocket / gRPC。

CLI

# 零配置:使用内置默认模板(TUN 全局代理 + geo 规则 + 国家分组)
subbridge build -i clash.yaml -o config.json

# 远程订阅
subbridge build -i https://example.com/sub -o config.json

# 多源合并
subbridge build -i clash.yaml -i https://example.com/sub -o config.json

# 取得内置模板副本,按需修改后用 -t 覆写
subbridge init -o my-template.json
subbridge build -i clash.yaml -t my-template.json -o config.json

# 本地 Web UI(浏览器粘贴订阅,自动转换)
subbridge serve

安装

npm install -g @0xsnx/subbridge

或从源码安装(需要 Bun 1.3.5+):

git clone https://github.com/zzf2333/SubBridge.git
cd SubBridge
bun install && bun run build && bun run install:local-cli

需要 Node.js 18+ 或 Bun 1.3.5+。

内置默认模板

不传 -t 时工具使用内置默认模板,特点:

配置项内容
入站TUN 全局代理,支持 IPv4/IPv6
DNS国内域名 → 223.5.5.5;其余 → 8.8.8.8 走代理
路由规则广告 → block;国内域名/IP → direct;其余 → 代理
rule_set 来源MetaCubeX/meta-rules-dat(GitHub,可替换为镜像)
国家分组自动展开(有节点的国家各生成一个 selector + urltest)

运行 subbridge init -o my-template.json 可取得副本,自由修改每一行。

文档

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.3.0Registry latest7 Apr 202612

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
zzf2333/subbridge

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 11:30 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:60c3ef25962bcc98d859435c1a419aa4b94fe6ebf3fd27b059cd0c0c27d7bd31