cli-anything-rms - Teltonika RMS CLI 工具 是做什么的?
Teltonika RMS(远程管理系统)的 CLI 工具。通过 RMS REST API 管理路由器、网关和物联网设备。
安装
pip install git+https://github.com/HKUDS/CLI-Anything.git#subdirectory=rms/agent-harness
身份验证
设置 RMS_API_TOKEN 环境变量,或运行 cli-anything-rms config set api_token <token>。
命令组
devices
devices list [--status online|offline] [--tag TAG] [--limit N] [--offset N] [--sort FIELD]— 列出设备devices get <device_id>— 获取设备详情devices update <device_id> [--name NAME] [--tag TAG]— 更新设备devices delete <device_id>— 删除设备
companies
companies list [--limit N] [--offset N]— 列出公司companies get <company_id>— 获取公司详情companies create --name NAME— 创建公司companies update <company_id> [--name NAME]— 更新公司companies delete <company_id>— 删除公司
users
users list [--limit N] [--offset N]— 列出用户users get <user_id>— 获取用户详情users invite --email EMAIL [--role ROLE]— 邀请用户users update <user_id> [--role ROLE]— 更新用户users delete <user_id>— 删除用户
tags
tags list [--limit N] [--offset N]— 列出标签tags get <tag_id>— 获取标签详情tags create --name NAME— 创建标签tags update <tag_id> [--name NAME]— 更新标签tags delete <tag_id>— 删除标签
alerts
alerts list [--device DEVICE_ID] [--limit N] [--offset N]— 列出警报alerts get <alert_id>— 获取警报详情alerts delete <alert_id>— 删除警报alerts configs list— 列出警报配置alerts configs get <config_id>— 获取警报配置alerts configs create --data JSON— 创建警报配置alerts configs update <config_id> --data JSON— 更新警报配置alerts configs delete <config_id>— 删除警报配置
configs
configs list [--device DEVICE_ID] [--limit N] [--offset N]— 列出设备配置configs get <config_id>— 获取配置configs update <config_id> --data JSON— 更新配置
remote-access
remote-access list [--device DEVICE_ID] [--limit N]— 列出会话remote-access get <session_id>— 获取会话详情remote-access create --device DEVICE_ID [--protocol PROTO] [--port PORT]— 创建会话remote-access delete <session_id>— 删除会话
logs
logs list [--device DEVICE_ID] [--limit N] [--offset N]— 列出日志logs get <log_id>— 获取日志详情logs delete <log_id>— 删除日志
location
location get <device_id>— 获取设备当前位置location history <device_id> [--limit N] [--offset N]— 位置历史
credits
credits list [--limit N] [--offset N]— 列出信用credits transfer --code CODE— 转移信用credits codes [--limit N]— 列出转移码
files
files list [--limit N] [--offset N]— 列出文件files get <file_id>— 获取文件详情files upload <file_path>— 上传文件files delete <file_id>— 删除文件
reports
reports list [--limit N] [--offset N]— 列出报告reports get <report_id>— 获取报告reports create --template TEMPLATE_ID [--name NAME]— 创建报告reports delete <report_id>— 删除报告reports templates list— 列出报告模板
hotspots
hotspots list [--device DEVICE_ID] [--limit N]— 列出热点hotspots get <hotspot_id>— 获取热点详情hotspots create --device DEVICE_ID --name NAME— 创建热点hotspots update <hotspot_id> [--name NAME]— 更新热点hotspots delete <hotspot_id>— 删除热点
passwords
passwords get <device_id>— 获取设备密码passwords update <device_id> --password PASSWORD— 更新密码passwords update <device_id> --password-stdin— 更新密码(从标准输入读取,更安全)
smtp
smtp list [--limit N] [--offset N]— 列出 SMTP 配置smtp get <config_id>— 获取 SMTP 配置smtp create --host HOST [--port PORT] [--username USER] [--password PASS]— 创建 SMTP 配置smtp update <config_id> [--host HOST] [--port PORT]— 更新 SMTP 配置smtp delete <config_id>— 删除 SMTP 配置
auth
auth test— 测试 API 连接auth status— 显示当前身份验证信息
config
config set <key> <value>— 设置配置(api_token, default_limit)config get [key]— 显示配置config delete <key>— 删除配置config path— 显示配置文件路径
示例
# 列出所有在线设备
cli-anything-rms devices list --status online
# 以 JSON 格式获取设备详情
cli-anything-rms --json devices get 12345
# 检查特定设备的警报
cli-anything-rms alerts list --device 12345
# 交互模式
cli-anything-rms