| Crates.io | chml |
| lib.rs | chml |
| version | 0.4.0 |
| created_at | 2026-01-13 01:44:25.758664+00 |
| updated_at | 2026-01-19 04:15:06.198151+00 |
| description | A CLI tool for chml |
| homepage | |
| repository | https://github.com/fb0sh/chml |
| max_upload_size | |
| id | 2039150 |
| size | 90,459 |
一个用于 Chmlfrp 的命令行工具,让你可以轻松管理隧道、域名和节点。
确保你已经安装了 Rust,然后运行:
cargo install chml
git clone https://github.com/fb0sh/chml.git
cd chml
cargo install --path .
在使用之前,需要设置环境变量:
export CHML_API_BASE_URL="https://panel.chmlfrp.net"
export CHML_API_TOKEN="your_api_token_here"
你可以将这些环境变量添加到你的 shell 配置文件中(如 ~/.zshrc 或 ~/.bashrc)。
chml --help
列出所有隧道和域名(默认):
chml ls
仅列出隧道:
chml ls -t
仅列出域名:
chml ls -d
仅列出节点:
chml ls -n
列出所有配置文件:
chml ls -c
创建 TCP 隧道:
chml tcp 4444
创建 UDP 隧道:
chml udp 4444
创建 HTTP 隧道:
chml http 8080
添加一个 TCP 隧道:
chml add tunnel --type tcp --lport 4444 --name my-tunnel
添加一个 HTTP 隧道:
chml add tunnel --type http --lport 8080 --name my-http
指定节点和远程端口:
chml add tunnel --type tcp --lport 4444 --node "节点名称" --rport 88888
指定本地主机:
chml add tunnel --type tcp --lport 4444 --lhost 127.0.0.1
通过隧道名称连接:
chml connect -t my-tunnel
通过隧道 ID 连接:
chml connect -i 12345
后台运行(守护进程模式):
chml connect -t my-tunnel --daemon
获取指定隧道的配置:
chml get -t my-tunnel
通过隧道名称删除:
chml rm -t my-tunnel
通过隧道 ID 删除:
chml rm --tunnel-id 12345
所有命令都支持 -q/--quiet 选项,用于减少输出信息:
chml -q ls
chml -q connect -t my-tunnel
| 命令 | 说明 |
|---|---|
chml ls |
列出隧道和域名 |
chml ls -t |
仅列出隧道 |
chml ls -d |
仅列出域名 |
chml ls -n |
仅列出节点 |
chml ls -c |
列出配置文件 |
chml tcp <port> |
快速创建 TCP 隧道 |
chml udp <port> |
快速创建 UDP 隧道 |
chml http <port> |
快速创建 HTTP 隧道 |
chml add tunnel |
添加隧道 |
chml connect -t <name> |
连接隧道 |
chml get -t <name> |
获取隧道配置 |
chml rm -t <name> |
删除隧道 |
chml 会在你的系统目录下创建工作目录:
~/.chml/%USERPROFILE%\.chml\目录结构:
~/.chml/
├── bin/ # frpc 二进制文件
└── conf/ # frpc 配置文件
# 克隆仓库
git clone https://github.com/fb0sh/chml.git
cd chml
# 运行
cargo run -- --help
# 构建
cargo build --release
MIT License
欢迎提交 Issue 和 Pull Request!