本專案提供 pm CLI,用 Go 重寫既有的 v2ray/sing-box/xray 管理腳本,集中管理安裝、設定、更新、移除與運行維護,並支援 supervisord 監控。
本專案為以下三個庫的改寫與整合:
- 單一 CLI 管理多核心(v2ray/xray/sing-box)。
- 設定檔可透過命令與互動式選單建立/修改/刪除。
- 支援 Caddy 自動 TLS 與反向代理設定。
- 支援 supervisord 監控與自動重啟。
/etc/
v2ray/
bin/
conf/
config.json
xray/
bin/
conf/
config.json
sing-box/
bin/
conf/
config.json
/etc/caddy/
Caddyfile
233boy/
sites/
/etc/supervisor/
supervisord.conf
conf.d/
v2ray.conf
xray.conf
sing-box.conf
~/.proxy-manager/
client/ # 客戶端設定檔
core/ # 客戶端核心程式 (v2ray/xray/sing-box)
logs/ # 客戶端日誌
/var/log/
v2ray/
access.log
error.log
xray/
access.log
error.log
sing-box/
access.log
error.log
/var/log/supervisor/
supervisord.log
v2ray.log
v2ray.err.log
xray.log
xray.err.log
sing-box.log
sing-box.err.log
/var/run/
supervisord.pid
supervisor.sock
make build產物會在 bin/pm。
go test ./...pm install
pm update core
pm update dat
pm update caddy
pm uninstallpm xray install
pm xray update core
pm xray update dat
pm xray update caddy
pm xray uninstallpm add vmess-tcp
pm add vmess-ws-tls --host example.com
pm change <config.json>
pm del <config.json>
pm info <config.json>
pm url <config.json>
pm qr <config.json>pm sing-box add vless-reality
pm sing-box add vmess-ws-tls --host example.com
pm sing-box change <config.json>
pm sing-box del <config.json>
pm sing-box info <config.json>
pm sing-box url <config.json>
pm sing-box qr <config.json>pm xray add vless-reality
pm xray add vless-xhttp-tls --host example.com
pm xray change <config.json>
pm xray del <config.json>
pm xray info <config.json>
pm xray url <config.json>
pm xray qr <config.json>pm dns
pm fix <config.json>
pm fix-all
pm fix-config.json
pm fix-caddyfile
pm bbrpm sing-box dns
pm sing-box fix <config.json>
pm sing-box fix-all
pm sing-box fix-config.json
pm sing-box fix-caddyfilepm xray dns
pm xray fix <config.json>
pm xray fix-all
pm xray fix-config.json
pm xray fix-caddyfile
pm xray bbrpm start
pm stop
pm restart
pm status
pm test
pm log
pm logerrpm sing-box start
pm sing-box stop
pm sing-box restart
pm sing-box status
pm sing-box test
pm sing-box log
pm sing-box logerrpm xray start
pm xray stop
pm xray restart
pm xray status
pm xray test
pm xray log
pm xray logerr# 設定管理
pm client add <proxy-url> [--name <name>]
pm client list
pm client info <name>
pm client delete <name>
# 核心管理
pm client install <v2ray|xray|singbox>
pm client update <v2ray|xray|singbox>
pm client uninstall <v2ray|xray|singbox>
# 連線管理
pm client connect <name> [--core <core>] [--socks-port <port>] [--http-port <port>] [--daemon]pm supervisor install
pm supervisor configure
pm supervisor start
pm supervisor status
pm supervisor stop
pm supervisor restartpm sing-box supervisor install
pm sing-box supervisor configure
pm sing-box supervisor start
pm sing-box supervisor status
pm sing-box supervisor stop
pm sing-box supervisor restartpm xray supervisor install
pm xray supervisor configure
pm xray supervisor start
pm xray supervisor status
pm xray supervisor stop
pm xray supervisor restartpm會使用系統路徑寫入 v2ray/xray 與 Caddy 的檔案(例如/etc/v2ray、/etc/xray、/etc/sing-box、/etc/caddy)。- supervisord 設定檔位於
/etc/supervisor/。 - 核心日誌位於
/var/log/{core}/。 - supervisord 日誌位於
/var/log/supervisor/。
- v2ray 核心與設定檔位於
/etc/v2ray/。
- TLS 的 ws/h2/grpc/xhttp 會透過 Caddy 反代,xray inbound 監聽
127.0.0.1。 - xray 核心與設定檔位於
/etc/xray/。
- 當使用帶 TLS 的 ws/h2/httpupgrade,且提供 host 且未指定
--no-auto-tls時,會自動走 Caddy 反代,sing-box inbound 監聽127.0.0.1。 - tuic/hysteria2/trojan 或非 Caddy 情境下會自動生成
tls.key/tls.cer(透過sing-box generate tls-keypair),Reality 會自動生成 keypair。 - sing-box 核心與設定檔位於
/etc/sing-box/。