refactor: clean up daemon and CLI duplication

Reduce repeated adapter dispatch, CLI action rendering, and config save
flows while keeping the current Roku behavior and docs aligned with the
known secret-menu limitations.
This commit is contained in:
44r0n7
2026-04-15 15:25:49 -04:00
parent 0095462216
commit 45620b1ab5
9 changed files with 802 additions and 237 deletions
+20 -7
View File
@@ -120,6 +120,13 @@ includes a timestamp so callers know how fresh the data is. Cleared on daemon re
tvctl <resource> <verb> [args] [flags]
```
## Known Issues
- Some Roku secret-menu sequences sent through `tvctl remote send` do not reliably open the expected menu, even when the same sequence works on the physical Roku remote.
- Current Roku input delivery uses ECP `keypress/...` requests only. Roku's official ECP docs also document `keydown/...` and `keyup/...`, which likely need investigation for higher-fidelity secret-menu automation.
- Normal navigation and app control work as expected, but Roku secret-menu automation should currently be treated as experimental.
- Tracking issue: [#1 Investigate Roku secret-menu sequence reliability over ECP](https://git.44r0n.cc/44r0n7/tvctl/issues/1)
Global flags available on every command:
```
@@ -131,12 +138,13 @@ Global flags available on every command:
### daemon
Manage the tvctld background service.
Manage the tvctld background daemon. When the user service is installed, these
commands manage the systemd user service instead of an ad hoc background process.
```
tvctl daemon start Start the daemon
tvctl daemon stop Stop the daemon
tvctl daemon restart Restart the daemon
tvctl daemon start Start the daemon or installed user service
tvctl daemon stop Stop the daemon or installed user service
tvctl daemon restart Restart the daemon or installed user service
tvctl daemon status Show daemon status
tvctl daemon install Generate and enable systemd user service
tvctl daemon uninstall Remove systemd user service
@@ -166,12 +174,16 @@ tvctl app stop Stop the current app
tvctl app refresh Refresh app cache from TV
```
`tvctl app refresh --clear` clears the persisted cache for the current platform
before reloading it from the selected device. Use it when cached app names or IDs
look stale, or when removed apps are still showing up in the cache.
### remote
Send input to the TV.
```
tvctl remote key <key> [key...] Send one or more keypresses
tvctl remote send <key> [key...] Send one or more keypresses
```
**Available keys:**
@@ -426,10 +438,11 @@ roku_password = ""
# Install (once binary releases exist)
# cargo install tvctl
# Start the daemon
# Start the daemon ad hoc
tvctl daemon start
# Or install as a systemd user service
# After install, daemon start/stop/restart manage the service
tvctl daemon install
# Discover TVs on your network
@@ -442,7 +455,7 @@ tvctl device select "Living Room"
tvctl app launch netflix
# Send a keypress
tvctl remote key home
tvctl remote send home
# Query state
tvctl state