Skip to content

feat: CLI v2 Phase 1 — mc alias, short names, playback aliases#12

Merged
luongnv89 merged 1 commit intomainfrom
feat/9-cli-v2-phase1-foundation
Apr 4, 2026
Merged

feat: CLI v2 Phase 1 — mc alias, short names, playback aliases#12
luongnv89 merged 1 commit intomainfrom
feat/9-cli-v2-phase1-foundation

Conversation

@luongnv89
Copy link
Copy Markdown
Owner

Summary

Implements CLI v2 Phase 1 foundation (issue #9):

  • mc entry point: Added as a short alias alongside music-cli — both invoke the same CLI
  • AliasedGroup infrastructure: Custom Click group subclass that supports hidden command aliases (don't appear in --help but fully functional)
  • Group renames: radios -> radio, youtube -> yt, moods -> mood, volume -> vol (old names kept as hidden backward-compatible aliases)
  • Subcommand rename: yt cached -> yt list (old name kept as alias)
  • Playback aliases: s=stop, pp=pause, r=resume, n=next, st=status, h=history
  • Bare invocation: mc with no args now shows playback status
  • -M short flag: Added to both play --mood and ai play --mood

Test plan

  • 45 new tests in tests/test_cli.py covering all acceptance criteria
  • All 97 tests pass (45 new + 52 existing, zero regressions)
  • mc --help shows new names, hides old names and aliases
  • Old names (radios, youtube, moods, volume) still resolve correctly
  • All playback aliases resolve to correct target commands
  • Bare mc invocation triggers status command
  • -M flag appears on both play and ai play help output

Closes #9

… Phase 1)

- Add `mc` as a short entry point alongside `music-cli` in pyproject.toml
- Implement AliasedGroup for hidden command aliases in Click
- Rename groups: radios->radio, youtube->yt, moods->mood, volume->vol
  (old names kept as hidden aliases for backward compatibility)
- Rename `yt cached` subcommand to `yt list` (cached kept as alias)
- Add playback aliases: s=stop, pp=pause, r=resume, n=next, st=status, h=history
- Bare `mc` invocation now shows playback status
- Add -M short flag for --mood on play and ai play commands
- Add 45 tests covering aliases, renames, help output, and bare invocation

Closes #9
@luongnv89 luongnv89 merged commit 4cc66a5 into main Apr 4, 2026
12 of 14 checks passed
@luongnv89 luongnv89 deleted the feat/9-cli-v2-phase1-foundation branch April 4, 2026 22:20
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.

CLI v2 Phase 1: Foundation — mc alias, short names, playback aliases

1 participant