cli-anything-rms 是做什麼的?
用於 Teltonika RMS(遠端管理系統)的命令列工具。透過 RMS REST API 管理路由器、閘道器及 IoT 裝置。
安裝
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