网淘吧来吧,欢迎您!

roku技能使用说明

2026-04-01 新闻来源:网淘吧 围观:8
电脑广告
手机广告

Roku CLI

通过ECP API控制Roku设备的快速TypeScript CLI。

安装

npm install -g roku-ts-cli@latest

快速开始

# Discover devices and save an alias
roku discover --save livingroom --index 1

# Use the alias
roku --host livingroom device-info
roku --host livingroom apps

命令

命令描述
roku discover在网络中查找Roku设备
roku --host <ip> device-info获取设备信息
roku --host <ip> apps列出已安装的应用
roku --host <ip> command <key>发送遥控器按键
roku --host <ip> literal <text>输入文本
roku --host <ip> search --title <query>搜索内容
roku --host <ip> launch <app>启动应用
roku --host <ip> interactive交互式遥控器模式

交互模式

roku livingroom                    # interactive control
roku --host livingroom interactive # same thing

使用方向键、回车键、退出键进行类似遥控器的控制。

roku

桥接服务

以原生操作系统服务的形式运行一个持久的HTTP桥接:

# Install and start the service
roku bridge install-service --port 19839 --token secret --host livingroom --user
roku bridge start --user

# Service management
roku bridge status --user
roku bridge stop --user
roku bridge uninstall --user

通过HTTP发送命令:

# Send key
curl -X POST http://127.0.0.1:19839/key \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer secret" \
  -d '{"key":"home"}'

# Type text
curl -X POST http://127.0.0.1:19839/text \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer secret" \
  -d '{"text":"hello"}'

# Launch app
curl -X POST http://127.0.0.1:19839/launch \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer secret" \
  -d '{"app":"plex"}'

# Health check
curl http://127.0.0.1:19839/health -H "Authorization: Bearer secret"

桥接端点

端点请求体
POST /key{"key": "home"}
POST /text{"text": "hello"}
POST /search{"title": "Stargate"}
POST /launch{"app": "plex"}
GET /health
GET /health?deep=1深度健康检查(探测Roku设备)

别名

# Save device alias
roku discover --save livingroom --index 1
roku alias set office 192.168.1.20

# Save app alias  
roku alias set plex 13535

# List aliases
roku alias list

# Use aliases
roku --host livingroom launch plex

遥控器按键

主页,返回,选择,上,下,左,右,播放,暂停,快退,快进,重播,信息,电源,音量加,音量减,静音

备注

  • Roku设备必须与CLI处于同一网络
  • 桥接服务以原生launchd(macOS)或systemd(Linux)服务形式运行
  • 使用--user参数可运行用户空间服务(无需sudo权限)
  • 在桥接模式下使用--token参数进行身份验证

来源

https://github.com/gumadeiras/roku-cli

免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏

文章底部电脑广告
手机广告位-内容正文底部

相关文章

您是本站第393746名访客 今日有1篇新文章/评论