Skip to content

feat(cast): headless CLI flags (-stop, -cast-list, -cast-to, -cast-stop) - #78

Open
susamn wants to merge 1 commit into
feature/cast-uifrom
feature/cast-cli-flags
Open

feat(cast): headless CLI flags (-stop, -cast-list, -cast-to, -cast-stop)#78
susamn wants to merge 1 commit into
feature/cast-uifrom
feature/cast-cli-flags

Conversation

@susamn

@susamn susamn commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Stacked on #77.

One-shot headless actions in cmd/mpdtui, same style as -i/-p:

flag action
-stop stop MPD playback
-cast-list list discovered cast targets
-cast-to NAME start casting to the named/id'd target
-cast-stop tear down the active cast (stop device, restore outputs) — works with no TUI running, via the persisted session file or discovery fallback

Delegate to the existing cast.List/Start/Stop. Mutually exclusive with each other and the UI modes, checked separately so the existing exclusivity message + its tests stay untouched. Manager built once, shared with the full UI; metaDB not opened for these.

Also documents the cast config keys in the first-run config template.

Tests: cli_internal_test.go + 3 new main_test.go cases. No new deps.

After this: only README + the HA/DLNA providers remain.

@susamn
susamn force-pushed the feature/cast-cli-flags branch from 3beef62 to 5b71664 Compare August 28, 2026 02:54
@susamn
susamn force-pushed the feature/cast-cli-flags branch from 5b71664 to c9eaaa7 Compare August 28, 2026 03:06
Adds one-shot headless actions to cmd/mpdtui, in the same style as -i/-p:

- -stop           stop MPD playback and exit
- -cast-list      list discovered cast targets and exit
- -cast-to NAME   start casting to the named/id'd target and exit
- -cast-stop      tear down the active cast (stop device, restore outputs)
                  and exit -- works with no TUI running, via the persisted
                  session file or a discovery fallback

These delegate to the existing cast.List / cast.Start / cast.Stop
entrypoints. They are mutually exclusive with each other and with the UI
modes, checked separately so the existing exclusivity message (and its
tests) is untouched. The cast Manager is built once and shared with the
full UI; metaDB is not opened for these actions.

Also documents the cast config keys in the first-run config template.

Tests: cli_internal_test.go (List/Start/Stop against fake providers),
plus three new main_test.go flag-validation cases.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JBJdG8Qenand5i16WT6BHG
@susamn
susamn force-pushed the feature/cast-cli-flags branch from c9eaaa7 to cccad70 Compare August 28, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant