命令参考
完整参数请以 hooknexus <command> --help 为准。本文与当前官方 CLI行为一致。仓库: hooknexus/hooknexus-cli(GitHub) · 包: npm 上的 hooknexus。
全局选项
hooknexus --helphooknexus --versionhooknexus --no-colorhooknexus <command> --json--json 在支持的命令中会输出机器可读格式(例如 listen)。CLI 也识别环境变量 HOOKNEXUS_NO_COLOR、HOOKNEXUS_DEBUG。
认证
hooknexus loginhooknexus logouthooknexus whoamilogin— 浏览器中完成 GitHub OAuth。logout— 清除本地会话。whoami— 已登录时打印当前用户。
若已登录,login 可能会确认是否切换账号。
Endpoint 管理
hooknexus endpointshooknexus endpoints lshooknexus endpoints createhooknexus endpoints create --permanenthooknexus endpoints info <endpoint-id>hooknexus endpoints delete <endpoint-id>说明:
- 单独执行
hooknexus endpoints会打印该命令组的帮助。 --permanent为 Plus 功能。
命令组有别名 hooknexus ep;子命令请用 --help 查看完整参数(如 create 的 --alias、TTL 等)。
监听(实时流)
hooknexus listenhooknexus listen <endpoint-id>hooknexus listen <endpoint-id-1> <endpoint-id-2>hooknexus listen --allhooknexus listen --jsonhooknexus listen --quiet说明:
- 不传 endpoint 时,CLI 会读取账号下的 endpoint。
- 仅有 一个 → 自动选用。
- 多个 → 在交互终端中让你选择。
- 没有 → 会创建一个普通 endpoint 再继续。
转发到本地
hooknexus forward --to http://localhost:PORT/PATHhooknexus forward <endpoint-id> --to http://localhost:PORT/PATHhooknexus forward --to http://localhost:3000 --preserve-pathhooknexus forward --to http://192.168.1.100:8080/webhook --allow-external说明:
--to须为 完整 URL(含本机接收请求的路径);将PORT、PATH换成你的实际值,详见 本地转发。- Free 与 Plus 均可使用。
- 默认仅允许
localhost、127.0.0.1、.local作为目标。 - 其他主机需加
--allow-external(请谨慎使用)。 - 省略 endpoint id 时的选择逻辑与
listen一致。
详细说明见 本地转发。
请求查看与重放
hooknexus requestshooknexus requests ls <endpoint-id>hooknexus requests show <request-id>hooknexus requests body <request-id>hooknexus requests replay <request-id> --to http://localhost:PORT/PATH说明:
- 单独执行
hooknexus requests会打印该组帮助。 requests body在内容为可解析 JSON 时会格式化输出。- request id 不完整 时,CLI 会提示先用
requests ls获取完整 id。 requests replay --to与forward相同,须为 含路径的完整 URL。requests replay仅 Plus 可用。
账户与订阅
hooknexus account infohooknexus account subscriptionhooknexus upgrade配置
hooknexus config lshooknexus config get apiUrlhooknexus config set apiUrl https://api.hooknexus.comhooknexus config set timeout 30000hooknexus config resethooknexus config path可配置项:
| 键 | 作用 |
|---|---|
apiUrl | 业务 API 根地址 |
webUrl | 用于 OAuth 与链接的 Web 地址 |
outputFormat | pretty、json 或 minimal |
color | 是否使用彩色输出 |
timeout | HTTP 超时(毫秒,CLI 会校验允许范围) |
与 CLI 相关的套餐限制
| 能力 | Free | Plus |
|---|---|---|
| 临时 endpoint | 3 个 | 10 个 |
| 永久 endpoint | - | 1 个 |
| WebSocket 监听 | 每 endpoint 2 连接 | 每 endpoint 3 连接 |
| 转发到本地 | 支持 | 支持 |
| 请求重放 | - | 支持 |
| 请求保留 | 48 小时 | 30 天 |
| API Key | - | 支持 |