coder-music-cli 0.8.14__tar.gz → 0.9.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. coder_music_cli-0.9.1/PKG-INFO +597 -0
  2. coder_music_cli-0.9.1/README.md +544 -0
  3. coder_music_cli-0.9.1/coder_music_cli.egg-info/PKG-INFO +597 -0
  4. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/coder_music_cli.egg-info/SOURCES.txt +4 -1
  5. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/coder_music_cli.egg-info/entry_points.txt +1 -0
  6. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/__init__.py +1 -1
  7. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/cli.py +389 -105
  8. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/client.py +1 -1
  9. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/config.py +10 -0
  10. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/hf_cache.py +5 -5
  11. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/sources/local.py +8 -2
  12. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/pyproject.toml +6 -1
  13. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/tests/test_ai_tracks.py +5 -3
  14. coder_music_cli-0.9.1/tests/test_cli.py +1017 -0
  15. coder_music_cli-0.9.1/tests/test_e2e.py +740 -0
  16. coder_music_cli-0.9.1/tests/test_local_source.py +88 -0
  17. coder_music_cli-0.8.14/PKG-INFO +0 -448
  18. coder_music_cli-0.8.14/README.md +0 -395
  19. coder_music_cli-0.8.14/coder_music_cli.egg-info/PKG-INFO +0 -448
  20. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/LICENSE +0 -0
  21. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/coder_music_cli.egg-info/dependency_links.txt +0 -0
  22. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/coder_music_cli.egg-info/requires.txt +0 -0
  23. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/coder_music_cli.egg-info/top_level.txt +0 -0
  24. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/__main__.py +0 -0
  25. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/ai_tracks.py +0 -0
  26. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/context/__init__.py +0 -0
  27. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/context/mood.py +0 -0
  28. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/context/temporal.py +0 -0
  29. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/daemon.py +0 -0
  30. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/history.py +0 -0
  31. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/model_manager.py +0 -0
  32. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/platform/__init__.py +0 -0
  33. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/platform/ipc.py +0 -0
  34. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/platform/paths.py +0 -0
  35. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/platform/player_control.py +0 -0
  36. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/player/__init__.py +0 -0
  37. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/player/base.py +0 -0
  38. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/player/ffplay.py +0 -0
  39. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/sources/__init__.py +0 -0
  40. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/sources/ai_generator.py +0 -0
  41. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/sources/ai_models/__init__.py +0 -0
  42. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/sources/ai_models/audioldm_strategy.py +0 -0
  43. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/sources/ai_models/bark_strategy.py +0 -0
  44. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/sources/ai_models/model_config.py +0 -0
  45. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/sources/ai_models/model_registry.py +0 -0
  46. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/sources/ai_models/model_strategy.py +0 -0
  47. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/sources/ai_models/musicgen_strategy.py +0 -0
  48. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/sources/ai_models/progress_callback.py +0 -0
  49. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/sources/ai_models/strategy_cache.py +0 -0
  50. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/sources/radio.py +0 -0
  51. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/sources/youtube.py +0 -0
  52. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/music_cli/youtube_history.py +0 -0
  53. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/setup.cfg +0 -0
  54. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/tests/test_config.py +0 -0
  55. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/tests/test_context.py +0 -0
  56. {coder_music_cli-0.8.14 → coder_music_cli-0.9.1}/tests/test_history.py +0 -0
@@ -0,0 +1,597 @@
1
+ Metadata-Version: 2.4
2
+ Name: coder-music-cli
3
+ Version: 0.9.1
4
+ Summary: A command-line music application for coders with daemon support, radio streaming, and AI-generated music
5
+ Author-email: Luong Nguyen <luongnv89@gmail.com>
6
+ Maintainer-email: Luong Nguyen <luongnv89@gmail.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/luongnv89/music-cli
9
+ Project-URL: Repository, https://github.com/luongnv89/music-cli
10
+ Project-URL: Documentation, https://github.com/luongnv89/music-cli#readme
11
+ Project-URL: Issues, https://github.com/luongnv89/music-cli/issues
12
+ Project-URL: Changelog, https://github.com/luongnv89/music-cli/releases
13
+ Keywords: music,cli,daemon,radio,ai-music,focus,coding,background-music,lofi,productivity,media-keys,mpris,now-playing
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Operating System :: MacOS
19
+ Classifier: Operating System :: Microsoft :: Windows
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Players
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: click>=8.0
29
+ Requires-Dist: tomli>=2.0; python_version < "3.11"
30
+ Requires-Dist: tomli-w>=1.0
31
+ Requires-Dist: pyobjc-framework-MediaPlayer>=10.0; sys_platform == "darwin"
32
+ Requires-Dist: dbus-next>=0.2.3; sys_platform == "linux"
33
+ Requires-Dist: winrt-Windows.Media.Playback>=2.0.0; sys_platform == "win32"
34
+ Provides-Extra: ai
35
+ Requires-Dist: torch>=2.0; extra == "ai"
36
+ Requires-Dist: transformers<4.51,>=4.31; extra == "ai"
37
+ Requires-Dist: diffusers>=0.15.0; extra == "ai"
38
+ Requires-Dist: scipy>=1.10; extra == "ai"
39
+ Requires-Dist: tqdm>=4.64; extra == "ai"
40
+ Requires-Dist: accelerate>=0.20; extra == "ai"
41
+ Provides-Extra: youtube
42
+ Requires-Dist: yt-dlp>=2023.1.0; extra == "youtube"
43
+ Provides-Extra: dev
44
+ Requires-Dist: pytest>=7.0; extra == "dev"
45
+ Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
46
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
47
+ Requires-Dist: black>=23.0; extra == "dev"
48
+ Requires-Dist: ruff>=0.1; extra == "dev"
49
+ Requires-Dist: mypy>=1.0; extra == "dev"
50
+ Requires-Dist: bandit>=1.7; extra == "dev"
51
+ Requires-Dist: pre-commit>=3.0; extra == "dev"
52
+ Dynamic: license-file
53
+
54
+ <p align="center">
55
+ <img src="assets/logo/logo-full.svg" alt="music-cli logo" width="340">
56
+ </p>
57
+
58
+ <p align="center">
59
+ <a href="https://pypi.org/project/coder-music-cli/"><img src="https://img.shields.io/pypi/v/coder-music-cli.svg" alt="PyPI version"></a>
60
+ <a href="https://pepy.tech/project/coder-music-cli"><img src="https://static.pepy.tech/badge/coder-music-cli" alt="PyPI Downloads"></a>
61
+ <a href="https://github.com/luongnv89/music-cli/stargazers"><img src="https://img.shields.io/github/stars/luongnv89/music-cli?style=social" alt="GitHub Stars"></a>
62
+ <a href="https://github.com/luongnv89/music-cli/network/members"><img src="https://img.shields.io/github/forks/luongnv89/music-cli?style=social" alt="GitHub Forks"></a>
63
+ <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.10+-blue.svg" alt="Python 3.10+"></a>
64
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
65
+ </p>
66
+
67
+ <h1 align="center">Your Coding Soundtrack, Without Leaving the Terminal</h1>
68
+
69
+ <p align="center">
70
+ <strong>mc</strong> (music-cli) is a background music daemon for developers. Radio streams, local MP3s, YouTube audio, and AI-generated music — all from one command. Stay in flow, skip the browser tab.
71
+ </p>
72
+
73
+ <p align="center">
74
+ <a href="#get-started-in-30-seconds"><strong>Get Started in 30 Seconds →</strong></a>
75
+ </p>
76
+
77
+ <p align="center">
78
+ <img src="music-cli-ai.gif" alt="music-cli AI demo" width="600">
79
+ </p>
80
+
81
+ ---
82
+
83
+ ## Sound Familiar?
84
+
85
+ - You open Spotify or YouTube to play focus music. Twenty minutes later you're watching a video essay about fonts. Your flow state is gone.
86
+ - You want background music while coding, but you don't want *another* app eating RAM and competing for your audio output.
87
+ - You finally find the right playlist... and it ends. Or an ad plays. Or the stream dies. Now you're debugging your music instead of your code.
88
+
89
+ Developers deserve a music player that respects the way they work: in the terminal, in the background, uninterrupted.
90
+
91
+ ## How mc Fixes This
92
+
93
+ - **Zero context-switching.** Start, pause, and skip tracks without leaving your terminal. Four keystrokes, not four clicks.
94
+ - **Always playing.** A persistent background daemon means your music survives terminal closes, SSH sessions, and IDE restarts.
95
+ - **40+ curated radio stations.** Lo-fi, synthwave, deep house, jazz — ready out of the box. No account required.
96
+ - **AI-generated music.** Generate unique focus tracks with MusicGen, AudioLDM, or Bark. Your music, your mood, no subscription.
97
+ - **YouTube audio streaming.** Paste a URL, get audio. Tracks are cached automatically for offline replay.
98
+
99
+ ```bash
100
+ mc play -M focus # Start focus music
101
+ mc pause # Pause for a meeting
102
+ mc resume # Back to coding
103
+ mc status # What's playing + an inspirational quote
104
+ ```
105
+
106
+ ## How It Works
107
+
108
+ 1. **Install** — one command, no config files to write.
109
+ ```bash
110
+ curl -sSL https://raw.githubusercontent.com/luongnv89/music-cli/main/install.sh | bash
111
+ ```
112
+ 2. **Play** — pick a mode: radio, local files, YouTube, or AI.
113
+ ```bash
114
+ mc play -M focus
115
+ ```
116
+ 3. **Forget about it** — the daemon runs in the background. Control it whenever you need.
117
+ ```bash
118
+ mc pause # meeting time
119
+ mc resume # back to work
120
+ ```
121
+ 4. **Explore** — discover 40+ stations, generate AI tracks, or stream from YouTube.
122
+ ```bash
123
+ mc radio # Browse stations
124
+ mc ai play -p "jazz piano" # Generate a track
125
+ mc yt play URL # Stream YouTube audio
126
+ ```
127
+
128
+ <p align="center">
129
+ <a href="#get-started-in-30-seconds"><strong>Start Playing Now →</strong></a>
130
+ </p>
131
+
132
+ ## What You Get
133
+
134
+ | Feature | Details |
135
+ |---------|---------|
136
+ | **Background daemon** | Music survives terminal closes and IDE restarts |
137
+ | **40+ radio stations** | Lo-fi, synthwave, deep house, jazz, French, Spanish, Italian stations — no account needed |
138
+ | **AI music generation** | MusicGen, AudioLDM, Bark — generate unique tracks from text prompts |
139
+ | **YouTube audio** | Paste a URL, stream audio. Automatic offline caching (2GB LRU) |
140
+ | **Context-aware** | Auto-selects music based on time of day and your mood |
141
+ | **Local MP3 playback** | Shuffle your own library with `--auto` |
142
+ | **Inspirational quotes** | Every `status` check comes with a random music quote |
143
+ | **Cross-platform** | Linux, macOS, Windows 10+ |
144
+
145
+ ## Get Started in 30 Seconds
146
+
147
+ ### Quick Install (recommended)
148
+
149
+ ```bash
150
+ curl -sSL https://raw.githubusercontent.com/luongnv89/music-cli/main/install.sh | bash
151
+ ```
152
+
153
+ Or with wget:
154
+
155
+ ```bash
156
+ wget -qO- https://raw.githubusercontent.com/luongnv89/music-cli/main/install.sh | bash
157
+ ```
158
+
159
+ ### Install from PyPI
160
+
161
+ ```bash
162
+ pip install coder-music-cli
163
+
164
+ # FFmpeg is required
165
+ brew install ffmpeg # macOS
166
+ sudo apt install ffmpeg # Ubuntu/Debian
167
+ choco install ffmpeg # Windows
168
+ ```
169
+
170
+ ### Optional Extras
171
+
172
+ ```bash
173
+ # YouTube streaming support (~10MB)
174
+ pip install 'coder-music-cli[youtube]'
175
+
176
+ # AI music generation (~5GB — PyTorch + Transformers + Diffusers)
177
+ pip install 'coder-music-cli[ai]'
178
+
179
+ # Both
180
+ pip install 'coder-music-cli[youtube,ai]'
181
+ ```
182
+
183
+ Prefer to inspect the install script first?
184
+
185
+ ```bash
186
+ curl -sSL https://raw.githubusercontent.com/luongnv89/music-cli/main/install.sh -o install.sh
187
+ less install.sh # review
188
+ bash install.sh
189
+ ```
190
+
191
+ ## FAQ
192
+
193
+ **Is it free?**
194
+ Yes, 100%. music-cli is MIT licensed, open source, and always will be. No accounts, no subscriptions, no ads.
195
+
196
+ **Does it work on my OS?**
197
+ Linux, macOS, and Windows 10+ are all supported. You need Python 3.10+ and FFmpeg.
198
+
199
+ **How much disk space does AI music need?**
200
+ The base install is tiny. The `[ai]` extra downloads ~5GB (PyTorch + HuggingFace models). Models download on first use, not at install time.
201
+
202
+ **How does it compare to Spotify/YouTube Music?**
203
+ music-cli is not a replacement for your music library. It's a lightweight, terminal-native player for background music while coding. No browser tabs, no electron apps, no accounts.
204
+
205
+ **Is it actively maintained?**
206
+ Yes. The latest release is v0.9.1. Check the [changelog](CHANGELOG.md) for recent updates.
207
+
208
+ **Can I add my own radio stations?**
209
+ Absolutely. Run `mc radio add` or edit `~/.config/music-cli/radios.txt` directly. Format: `Station Name|stream-url`.
210
+
211
+ **What AI models are supported?**
212
+ MusicGen (small/medium/large/melody), AudioLDM (small/large), and Bark (standard/small). See the [AI Playbook](docs/AI_PLAYBOOK.md) for examples and tips.
213
+
214
+ ## Start Coding with Music
215
+
216
+ You're one command away from a focus soundtrack that never interrupts you. No signups, no ads, no browser tabs. MIT licensed, open source, and built for developers who live in the terminal.
217
+
218
+ ```bash
219
+ curl -sSL https://raw.githubusercontent.com/luongnv89/music-cli/main/install.sh | bash && mc play -M focus
220
+ ```
221
+
222
+ [**Install music-cli →**](#get-started-in-30-seconds)
223
+
224
+ ---
225
+
226
+ ## Documentation
227
+
228
+ | Document | Description |
229
+ |----------|-------------|
230
+ | [User Guide](docs/user-guide.md) | Complete usage instructions |
231
+ | [AI Playbook](docs/AI_PLAYBOOK.md) | AI music generation guide with examples |
232
+ | [Architecture](docs/architecture.md) | System design and diagrams |
233
+ | [Development](docs/development.md) | Contributing guide |
234
+ | [Changelog](CHANGELOG.md) | Version history and release notes |
235
+
236
+ <details>
237
+ <summary><strong>Command Reference</strong></summary>
238
+
239
+ ```
240
+ mc # show status
241
+ mc play [SOURCE] # smart play (auto-detects file/URL/station)
242
+ mc play -M focus # mood-based radio
243
+ mc stop / mc s # stop
244
+ mc pause / mc pp # pause
245
+ mc resume / mc r # resume
246
+ mc next / mc n # next track
247
+ mc vol [0-100] # get/set volume
248
+ mc status / mc st # full status
249
+
250
+ mc radio # list stations
251
+ mc radio play N # play station #N
252
+ mc radio add # add station
253
+ mc radio remove N # remove station
254
+ mc radio update # update station list
255
+
256
+ mc yt play URL # stream YouTube audio
257
+ mc yt / mc yt list # list cached tracks
258
+ mc yt play N # replay cached track
259
+ mc yt remove N / clear # manage cache
260
+
261
+ mc ai play [-p PROMPT] # generate AI music
262
+ mc ai / mc ai list # list generated tracks
263
+ mc ai replay N # replay generated track
264
+ mc ai model # list/download/delete/default models
265
+
266
+ mc history / mc h # show play history
267
+ mc history play N # replay from history
268
+ mc mood [MOOD] # list moods or play mood radio
269
+
270
+ mc config # show config paths
271
+ mc daemon start|stop|status # manage daemon
272
+ ```
273
+
274
+ > **Note:** `music-cli` still works as the full command name for all commands.
275
+
276
+ Use `-h` or `--help` at any level for details (e.g. `mc -h`, `mc play -h`, `mc radio -h`).
277
+
278
+ </details>
279
+
280
+ <details>
281
+ <summary><strong>Migration Guide (from music-cli v1)</strong></summary>
282
+
283
+ | Old command | New command |
284
+ |---|---|
285
+ | `music-cli play -m local -s file.mp3` | `mc play file.mp3` |
286
+ | `music-cli play -m youtube -s URL` | `mc yt play URL` |
287
+ | `music-cli play -m history -i 3` | `mc history play 3` |
288
+ | `music-cli play -m ai` | `mc ai play` |
289
+ | `music-cli radios` | `mc radio` |
290
+ | `music-cli update-radios` | `mc radio update` |
291
+ | `music-cli volume 50` | `mc vol 50` |
292
+
293
+ All old command names continue to work as hidden aliases; they are simply no longer shown in `--help`.
294
+
295
+ </details>
296
+
297
+ <details>
298
+ <summary><strong>Play Modes</strong></summary>
299
+
300
+ ```bash
301
+ # Smart play (auto-detects source)
302
+ mc play # Context-aware radio
303
+ mc play ~/song.mp3 # Local file
304
+ mc play "https://youtube.com/..." # YouTube URL
305
+ mc play "deep house" # Station name
306
+
307
+ # Mood-based
308
+ mc play -M focus # By mood
309
+
310
+ # Local shuffle
311
+ mc play -m local --auto # Shuffle local files
312
+
313
+ # AI (requires [ai] extras)
314
+ mc ai play -p "happy jazz" -d 60 # Generate a 60s track
315
+
316
+ # YouTube
317
+ mc yt play URL # Stream YouTube audio
318
+
319
+ # History
320
+ mc history play 3 # Replay item #3
321
+ ```
322
+
323
+ </details>
324
+
325
+ <details>
326
+ <summary><strong>Radio Station Management</strong></summary>
327
+
328
+ ```bash
329
+ # List all stations with numbers
330
+ mc radio
331
+ mc radio list
332
+
333
+ # Play by station number
334
+ mc radio play 5
335
+
336
+ # Add a new station interactively
337
+ mc radio add
338
+
339
+ # Remove a station
340
+ mc radio remove 10
341
+ ```
342
+
343
+ ### Pre-configured Stations
344
+
345
+ 40 stations across multiple genres and languages:
346
+
347
+ - **Chill/Lo-fi**: ChillHop, SomaFM (Groove Salad, Drone Zone, Space Station)
348
+ - **Electronic**: Deep House, DEF CON Radio, Beat Blender
349
+ - **Synthwave**: Nightride FM, Chillsynth FM, Darksynth FM, Datawave FM, Spacesynth FM
350
+ - **French**: FIP Radio, France Inter, France Musique, Mouv
351
+ - **Spanish**: Salsa Radio, Tropical 100, Los 40 Principales, Cadena SER
352
+ - **Italian**: Radio Italia, RTL 102.5, Radio 105, Virgin Radio Italy
353
+
354
+ </details>
355
+
356
+ <details>
357
+ <summary><strong>AI Music Generation</strong></summary>
358
+
359
+ Generate unique audio with multiple AI models via HuggingFace:
360
+
361
+ ```bash
362
+ # Install AI dependencies (~5GB: PyTorch + Transformers + Diffusers)
363
+ pip install 'coder-music-cli[ai]'
364
+
365
+ # Generate and manage AI music
366
+ mc ai play # Context-aware (default: musicgen-small)
367
+ mc ai play -p "jazz piano" # Custom prompt
368
+ mc ai play -m audioldm-s-full-v2 # Use AudioLDM model
369
+ mc ai play -m bark-small -p "Hello!" # Use Bark for speech
370
+ mc ai play -M focus -d 30 # 30-second focus track
371
+ mc ai model # List available models
372
+ mc ai list # List all generated tracks
373
+ mc ai replay 1 # Replay track #1
374
+ mc ai remove 2 # Delete track #2
375
+ ```
376
+
377
+ ### Available AI Models
378
+
379
+ | Model ID | Type | Best For | Size |
380
+ |----------|------|----------|------|
381
+ | `musicgen-small` | MusicGen | Music generation (default) | ~1.5GB |
382
+ | `musicgen-medium` | MusicGen | Higher quality music | ~3GB |
383
+ | `musicgen-large` | MusicGen | Best quality music | ~6GB |
384
+ | `musicgen-melody` | MusicGen | Melody-conditioned music | ~3GB |
385
+ | `audioldm-s-full-v2` | AudioLDM | Sound effects, ambient audio | ~1GB |
386
+ | `audioldm-l-full` | AudioLDM | High-quality audio generation | ~2GB |
387
+ | `bark` | Bark | Speech synthesis, audio with voice | ~5GB |
388
+ | `bark-small` | Bark | Faster speech synthesis | ~1.5GB |
389
+
390
+ ### AI Command Suite
391
+
392
+ | Command | Description |
393
+ |---------|-------------|
394
+ | `mc ai model` | List all available AI models |
395
+ | `mc ai list` | Show all AI-generated tracks with prompts |
396
+ | `mc ai play` | Generate music from current context |
397
+ | `mc ai play -m <model>` | Generate with specific model |
398
+ | `mc ai play -p "prompt"` | Generate with custom prompt |
399
+ | `mc ai play -M focus` | Generate with specific mood |
400
+ | `mc ai play -d 30` | Generate 30-second track (default: 15s) |
401
+ | `mc ai replay <num>` | Replay track by number (regenerates if file missing) |
402
+ | `mc ai remove <num>` | Delete track and audio file |
403
+
404
+ ### AI Features
405
+ - **Multiple models** — MusicGen, AudioLDM, and Bark model families
406
+ - **Smart caching** — LRU cache keeps up to 2 models in memory (configurable)
407
+ - **Download progress** — Progress bar shown during model downloads
408
+ - **GPU memory management** — Automatic cleanup when switching models
409
+ - **Context-aware** — Uses time of day, day of week, and session mood
410
+ - **Custom prompts** — Generate exactly what you want with `-p`
411
+ - **Seamless looping** — All tracks engineered for infinite playback
412
+ - **Track management** — List, replay, and remove generated tracks
413
+ - **Regeneration** — Missing files can be regenerated with original prompt
414
+
415
+ ### AI Requirements
416
+ - ~5GB disk space minimum (PyTorch + Transformers + Diffusers)
417
+ - ~8GB RAM minimum for generation (16GB recommended for larger models)
418
+ - Models are downloaded on first use
419
+
420
+ ### AI Configuration
421
+
422
+ Configure in `~/.config/music-cli/config.toml`:
423
+
424
+ ```toml
425
+ [ai]
426
+ default_model = "musicgen-small" # Default model for generation
427
+
428
+ [ai.cache]
429
+ max_models = 2 # Max models to keep in memory (LRU eviction)
430
+
431
+ [ai.models.audioldm-s-full-v2.extra_params]
432
+ num_inference_steps = 10 # More = better quality, slower
433
+ guidance_scale = 2.5 # How closely to follow prompt
434
+ ```
435
+
436
+ </details>
437
+
438
+ <details>
439
+ <summary><strong>YouTube Audio Streaming & Cache</strong></summary>
440
+
441
+ Stream audio directly from YouTube URLs with automatic offline caching:
442
+
443
+ ```bash
444
+ # Play YouTube audio (automatically cached)
445
+ mc play "https://youtube.com/watch?v=..."
446
+ mc play "https://youtu.be/..."
447
+
448
+ # Manage cached tracks
449
+ mc yt # List all cached tracks
450
+ mc yt list # Same as above
451
+ mc yt play 3 # Play cached track #3 (works offline)
452
+ mc yt remove 1 # Remove cached track #1
453
+ mc yt clear # Clear entire cache
454
+ ```
455
+
456
+ ### YouTube Command Suite
457
+
458
+ | Command | Description |
459
+ |---------|-------------|
460
+ | `mc yt` | List all cached tracks (default) |
461
+ | `mc yt list` | List cached tracks with cache statistics |
462
+ | `mc yt play <num>` | Play cached track by number (offline) |
463
+ | `mc yt remove <num>` | Remove a cached track |
464
+ | `mc yt clear` | Clear all cached tracks |
465
+
466
+ ### YouTube Features
467
+ - **Automatic caching** — Audio cached in background while streaming
468
+ - **Offline playback** — Play cached tracks without internet
469
+ - **LRU eviction** — 2GB cache limit with automatic cleanup of oldest tracks
470
+ - **M4A format** — 192kbps quality for good balance of size and quality
471
+ - **Instant replay** — Cached tracks play immediately
472
+
473
+ ### YouTube Configuration
474
+
475
+ Configure in `~/.config/music-cli/config.toml`:
476
+
477
+ ```toml
478
+ [youtube.cache]
479
+ enabled = true # Enable/disable automatic caching
480
+ max_size_gb = 2.0 # Maximum cache size in GB
481
+ ```
482
+
483
+ ### Cache Location
484
+
485
+ - **Linux/macOS**: `~/.config/music-cli/youtube_cache/`
486
+ - **Windows**: `%LOCALAPPDATA%\music-cli\youtube_cache\`
487
+
488
+ </details>
489
+
490
+ <details>
491
+ <summary><strong>Moods</strong></summary>
492
+
493
+ `focus` `happy` `sad` `excited` `relaxed` `energetic` `melancholic` `peaceful`
494
+
495
+ </details>
496
+
497
+ <details>
498
+ <summary><strong>Configuration</strong></summary>
499
+
500
+ Configuration files location:
501
+ - **Linux/macOS**: `~/.config/music-cli/`
502
+ - **Windows**: `%LOCALAPPDATA%\music-cli\`
503
+
504
+ | File | Purpose |
505
+ |------|---------|
506
+ | `config.toml` | Settings (volume, mood mappings, version) |
507
+ | `radios.txt` | Station URLs (name\|url format) |
508
+ | `history.jsonl` | Play history |
509
+ | `ai_tracks.json` | AI track metadata (prompts, durations) |
510
+ | `ai_music/` | AI-generated audio files |
511
+ | `youtube_cache.json` | YouTube cache metadata |
512
+ | `youtube_cache/` | Cached YouTube audio files |
513
+
514
+ ### Version Updates
515
+
516
+ When you update music-cli, you'll be notified if new radio stations are available:
517
+
518
+ ```bash
519
+ # Check and update stations
520
+ mc radio update
521
+
522
+ # Options:
523
+ # [M] Merge - Add new stations to your list (recommended)
524
+ # [O] Overwrite - Replace with new defaults (backs up old file)
525
+ # [K] Keep - Keep your current stations unchanged
526
+ ```
527
+
528
+ ### Add Custom Stations
529
+
530
+ ```bash
531
+ # Interactive
532
+ mc radio add
533
+
534
+ # Or edit directly: ~/.config/music-cli/radios.txt
535
+ ChillHop|https://streams.example.com/chillhop.mp3
536
+ Jazz FM|https://streams.example.com/jazz.mp3
537
+ ```
538
+
539
+ </details>
540
+
541
+ <details>
542
+ <summary><strong>Status & Quotes</strong></summary>
543
+
544
+ The `status` command shows playback info plus a random inspirational quote:
545
+
546
+ ```bash
547
+ $ mc status
548
+ Status: ▶ playing
549
+ Track: Groove Salad [radio]
550
+ Volume: 80%
551
+ Context: morning / weekday
552
+
553
+ "Music gives a soul to the universe, wings to the mind, flight to the imagination." - Plato
554
+
555
+ Version: 0.9.1
556
+ GitHub: https://github.com/luongnv89/music-cli
557
+ ```
558
+
559
+ </details>
560
+
561
+ ---
562
+
563
+ ## Requirements
564
+
565
+ - Python 3.10+
566
+ - FFmpeg
567
+ - **Supported Platforms**: Linux, macOS, Windows 10+
568
+
569
+ ## Contributors
570
+
571
+ Thanks to all contributors who have helped improve music-cli!
572
+
573
+ | Contributor | PR | Contribution |
574
+ |-------------|-----|--------------|
575
+ | [kylephillipsau](https://github.com/kylephillipsau) | [#5](https://github.com/luongnv89/music-cli/pull/5) | Improved YouTube livestream playback for radio stations by piping yt-dlp to ffplay for reliable HLS buffering and reconnections |
576
+
577
+ ## Acknowledgements
578
+
579
+ music-cli is built with these excellent open-source libraries:
580
+
581
+ | Library | Maintainer | Purpose |
582
+ |---------|------------|---------|
583
+ | [Click](https://github.com/pallets/click) | [Pallets](https://github.com/pallets) | CLI framework for building commands and argument parsing |
584
+ | [tomli](https://github.com/hukkin/tomli) | [hukkin](https://github.com/hukkin) | TOML parser for reading configuration files |
585
+ | [tomli-w](https://github.com/hukkin/tomli-w) | [hukkin](https://github.com/hukkin) | TOML writer for saving configuration files |
586
+ | [pyobjc](https://github.com/ronaldoussoren/pyobjc) | [Ronald Oussoren](https://github.com/ronaldoussoren) | macOS framework bindings for media key support |
587
+ | [dbus-next](https://github.com/altdesktop/python-dbus-next) | [altdesktop](https://github.com/altdesktop) | D-Bus client for Linux MPRIS media controls |
588
+ | [PyTorch](https://github.com/pytorch/pytorch) | [PyTorch Team](https://github.com/pytorch) | Deep learning framework powering AI music generation |
589
+ | [Transformers](https://github.com/huggingface/transformers) | [Hugging Face](https://github.com/huggingface) | Pre-trained models for MusicGen and Bark |
590
+ | [Diffusers](https://github.com/huggingface/diffusers) | [Hugging Face](https://github.com/huggingface) | Diffusion models for AudioLDM audio generation |
591
+ | [SciPy](https://github.com/scipy/scipy) | [SciPy Community](https://github.com/scipy) | Scientific computing for audio signal processing |
592
+ | [tqdm](https://github.com/tqdm/tqdm) | [tqdm developers](https://github.com/tqdm) | Progress bars for model downloads and generation |
593
+ | [yt-dlp](https://github.com/yt-dlp/yt-dlp) | [yt-dlp Team](https://github.com/yt-dlp) | YouTube audio extraction and streaming |
594
+
595
+ ## License
596
+
597
+ MIT