Ater.Free.EscapeHole 0.2.2

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global Ater.Free.EscapeHole --version 0.2.2
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local Ater.Free.EscapeHole --version 0.2.2
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Ater.Free.EscapeHole&version=0.2.2
                    
nuke :add-package Ater.Free.EscapeHole --version 0.2.2
                    

Ater.Free.EscapeHole

NuGet

Ater.Free.EscapeHole 是一个基于 Mihomo (Clash Meta) 代理核心的 dotnet tool工具。它让你无需打开图形界面即可管理代理订阅、测试节点延迟、启动和停止本地代理。

当前版本已提供 Windows x64 与 Linux x64 的本地代理运行时;Linux 端会使用内置的 winnet.gz 压缩包进行部署。

运行要求

  • 操作系统:Windows 10/11 或 Linux x64
  • .NET 10 Runtime

escape connect 的本地代理模式已覆盖 Windows 与 Linux;--global 仍依赖 Windows 系统代理设置,因此目前主要在 Windows 上生效。

安装

安装 .NET 工具

dotnet tool install --global Ater.Free.EscapeHole

安装后,全局命令为 escape

快速开始

1. 添加订阅

escape sub add mysub https://example.com/subscribe

也可以把带用户名和密码的 HTTPS Proxy 地址作为单节点订阅添加:

escape sub add freeway https://proxy-user:proxy-password@proxy.example.com:8080

此格式会被转换为 Mihomo HTTPS HTTP Proxy 节点,不会向该 URL 下载订阅内容。

2. 查看订阅

escape sub list

3. 查看节点

escape node list mysub

4. 连接代理

escape connect mysub

工具会自动测试所有节点的延迟,然后让你交互式选择一个节点启动本地代理。

5. 使用系统全局代理模式

escape connect mysub --global

代理启动后会自动设置 Windows 系统代理;退出时自动恢复原始设置。

6. 查看/停止代理

查看当前运行的代理:

escape status

停止当前代理:

escape stop

可以使用escape connect命令直接连接上次的节点,无需指定订阅名称。

命令参考

escape sub add <名称> <URL>

添加一个新的订阅。

  • <名称> — 订阅的名称,用于后续管理。
  • <URL> — Clash/Base64 订阅链接,或 https://用户名:密码@服务器:端口 格式的 HTTPS Proxy。

HTTPS Proxy 的凭据会保存在本地配置中;sub list 会隐藏密码。

escape sub refresh <名称>

重新下载并刷新订阅的节点列表。

escape sub list

列出所有已添加的订阅(名称、URL、节点数、最后更新时间)。

escape sub delete <名称>

删除指定的订阅。

escape node list <名称>

列出指定订阅中的所有代理节点。

escape connect [名称] [--global]

连接代理。

  • [名称] — 可选。不指定时尝试恢复上次的连接。
  • --global — 可选。启用系统全局代理模式(设置 Windows 系统代理)。

执行流程:

  1. 启动临时 Mihomo 实例。
  2. 测试所有节点的连接延迟。
  3. 列出可达节点,让用户交互选择。
  4. 保存会话并启动正式代理。

escape stop

停止当前 CLI 管理的 Mihomo 代理进程。

  • 如果之前使用了 --global,会自动恢复 Windows 系统代理设置。
  • 如果 Mihomo 进程意外退出,则仅清理会话记录。

escape config proxy_port <端口号>

配置本地代理端口(默认:7890)。

所有连接统一使用 Mihomo 规则分流:自定义 rules 优先,其次局域网和国内域名/IP 直连,然后继续匹配订阅自带规则,最后使用订阅的兜底策略。智能分流依赖工具内置的 geosite.datgeoip.dat

数据文件

所有配置和会话数据存储在:

%LOCALAPPDATA%\EscapeService\
文件 说明
config.json 订阅配置和应用设置
escape-session.json CLI 活动代理会话记录
winnet\ Winnet 可执行文件、GeoIP 数据、运行时配置

日志

如果需要排查问题,可以使用 .NET 工具的诊断日志:

export DOTNET_CLI_TELEMETRY_OPTOUT=1
dotnet tool run escape -- --help

或者直接运行 escape 命令,错误信息会打印到终端。

许可证

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.2.3 110 7/21/2026
0.2.2 108 7/6/2026
0.2.1 122 6/16/2026
0.2.0 129 5/27/2026
0.1.4 116 5/15/2026
0.1.2 117 5/11/2026
0.1.1 116 5/9/2026
0.1.0 113 5/9/2026

1. Support credentialed HTTPS Proxy URLs through sub add.
2. Remove the connect-http command.