魔云腾统一命令行工具。一个 myt-cli 命令操作 BMC 集群、设备、安卓云机。
一键安装(推荐):
curl -fsSL https://cnb.cool/openmyt/myt-cli/-/raw/main/install.sh | sh
指定版本:
curl -fsSL https://cnb.cool/openmyt/myt-cli/-/raw/main/install.sh | sh -s v0.2.0
指定安装目录:
curl -fsSL https://cnb.cool/openmyt/myt-cli/-/raw/main/install.sh | sh -s -- -d /usr/local/bin
**手动下载:**从 Release 下载对应平台二进制:
# Linux x64
curl -L -o myt-cli https://cnb.cool/openmyt/myt-cli/-/releases/download/v0.1.0/myt-cli-linux-x64
# Linux arm64
curl -L -o myt-cli https://cnb.cool/openmyt/myt-cli/-/releases/download/v0.1.0/myt-cli-linux-arm64
chmod +x myt-cli && sudo mv myt-cli /usr/local/bin/
从源码构建:
./scripts/build.sh v1.0.0
# 或
go build -ldflags "-s -w -X cnb.cool/openmyt/myt-cli/cmd.version=$(git describe --tags --always)" -o myt-cli .
| 命令 | 端口 | 用途 |
|---|---|---|
myt-cli bmc | 443 | BMC 集群管理 — 板卡电源、串口终端、固件 |
myt-cli device | 8000 | 设备管理 — 云机生命周期、镜像、发现 |
myt-cli android | 9082/9083 | 安卓 API — 剪贴板/代理/短信 + RPA 自动化 |
myt-cli login --username admin --password admin
# BMC
myt-cli bmc info # 系统信息
myt-cli bmc board list # 板卡列表
myt-cli bmc board on 1 2 3 # 上电
myt-cli bmc serial attach 1 # 串口终端
# 设备
myt-cli device discover # 发现设备
myt-cli device info -d 10.10.11.6 # 设备详情
myt-cli device list -d 10.10.11.6 # 列出云机
myt-cli device create -d 10.10.11.6 -n test -i <镜像> --model CQR16
myt-cli device start test -d 10.10.11.6
myt-cli device exec test -d 10.10.11.6 --cmd "ls /sdcard"
# 安卓 API
myt-cli android clipboard get -d 10.10.11.6
myt-cli android proxy status -d 10.10.11.6
myt-cli android screenshot -d 10.10.11.6 -o screen.jpg
# 多容器场景 — 用 --name 指定云机
myt-cli android screenshot -d 10.10.11.6 --name cqr16_cli_t1 --level 1 -o screen.jpg
myt-cli android rpa tap -d 10.10.11.6 --name cqr16_cli_t1 --x 100 --y 200
myt-cli android rpa input -d 10.10.11.6 --name cqr16_cli_t1 --text "hello"
bmc info # 系统信息(版本、运行时间、IP/MAC)
bmc board list [--online] [--quiet] # 板卡列表(1-48 槽位)
bmc board status <pos> # 板卡详情
bmc board on/off/reboot <pos...> # 电源控制
bmc board enable-root <pos...> # 启用 Root
bmc board firmware list # 固件列表
bmc serial monitor <pos> [--baud] # 后台串口监控
bmc serial stop <pos> # 停止监控
bmc serial status # 监控状态
bmc serial log <pos> [--tail N] [-f] # 查看日志
bmc serial attach <pos> [--baud] # 交互式终端(Ctrl+] 退出)
device discover [--timeout] # UDP 广播发现设备
device info -d <ip> # 设备详情
device mirror-list [--json] # 云端镜像仓库列表
device list -d <ip> # 列出云机
device create -d <ip> -n <name> -i <image> [--model] [--dns] [--index] [--no-start]
device start/stop/restart/reset <name> -d <ip>
device delete <name> -d <ip>
device rename <name> -d <ip> --new-name <name>
device exec <name> -d <ip> --cmd <command>
device image list/pull/remove -d <ip> # 镜像管理
# 设备级 API (端口 9082)
android clipboard [get|set --text] -d <ip>
android proxy [status|set --host --port --user --pass|stop] -d <ip>
android sms -d <ip>
android camera [start --path|stop] -d <ip>
android screenshot [-o <file>] [--name/-n <name>] [--level <1|2|3>] -d <ip>
android version -d <ip>
android info -d <ip>
android background [list|add --pkg|remove --pkg] -d <ip>
android keyshield [enable|disable] -d <ip>
android locale --language <lang> --country <cc> -d <ip>
android location -d <ip>
android install-cert -d <ip>
android install-gms -d <ip>
android crashlog -d <ip>
android ip-location -d <ip>
android fingerprint -d <ip>
android sleep [--enable|--disable] -d <ip>
# RPA 自动化 (端口 9083)
android rpa screenshot [-o <file>] [--name/-n <name>] -d <ip>
android rpa tap --x <int> --y <int> [--name/-n <name>] -d <ip>
android rpa swipe --x0 --y0 --x1 --y1 [--duration] [--name/-n <name>] -d <ip>
android rpa input --text <str> [--name/-n <name>] -d <ip>
android rpa shell --cmd <str> [--name/-n <name>] -d <ip>
android rpa open-app/stop-app --pkg <pkg> [--name/-n <name>] -d <ip>
android rpa key --code <int> [--name/-n <name>] -d <ip>
android rpa check [--name/-n <name>] -d <ip> # 连接检查
android rpa dump-ui [--name/-n <name>] -d <ip> # 无障碍节点 XML
android rpa rotate [--name/-n <name>] -d <ip> # 屏幕旋转角度
android rpa touch-down/touch-up/touch-move --x --y [--name/-n <name>] -d <ip>
~/.myt/config.yaml:
bmc_base_url: https://bmc.moyunteng.com
token: eyJhbGciOi...
username: admin
device_port: 8000
android_port: 9082
rpa_port: 9083
| 标志 | 说明 |
|---|---|
--json / -j | JSON 输出(适合 AI/自动化) |
--config / -c | 指定配置文件 |
--version / -v | 版本号 |