coder-music-cli 0.4.0__tar.gz → 0.5.0__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 (47) hide show
  1. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/PKG-INFO +102 -20
  2. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/README.md +97 -19
  3. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/coder_music_cli.egg-info/PKG-INFO +102 -20
  4. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/coder_music_cli.egg-info/SOURCES.txt +13 -0
  5. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/coder_music_cli.egg-info/requires.txt +3 -0
  6. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/__init__.py +1 -1
  7. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/cli.py +151 -21
  8. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/client.py +19 -13
  9. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/config.py +182 -6
  10. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/daemon.py +66 -36
  11. coder_music_cli-0.5.0/music_cli/platform/__init__.py +140 -0
  12. coder_music_cli-0.5.0/music_cli/platform/ipc.py +315 -0
  13. coder_music_cli-0.5.0/music_cli/platform/paths.py +149 -0
  14. coder_music_cli-0.5.0/music_cli/platform/player_control.py +197 -0
  15. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/player/ffplay.py +34 -13
  16. coder_music_cli-0.5.0/music_cli/sources/ai_generator.py +342 -0
  17. coder_music_cli-0.5.0/music_cli/sources/ai_models/__init__.py +54 -0
  18. coder_music_cli-0.5.0/music_cli/sources/ai_models/audioldm_strategy.py +149 -0
  19. coder_music_cli-0.5.0/music_cli/sources/ai_models/bark_strategy.py +157 -0
  20. coder_music_cli-0.5.0/music_cli/sources/ai_models/model_config.py +306 -0
  21. coder_music_cli-0.5.0/music_cli/sources/ai_models/model_registry.py +124 -0
  22. coder_music_cli-0.5.0/music_cli/sources/ai_models/model_strategy.py +147 -0
  23. coder_music_cli-0.5.0/music_cli/sources/ai_models/musicgen_strategy.py +170 -0
  24. coder_music_cli-0.5.0/music_cli/sources/ai_models/progress_callback.py +202 -0
  25. coder_music_cli-0.5.0/music_cli/sources/ai_models/strategy_cache.py +229 -0
  26. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/pyproject.toml +5 -1
  27. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/tests/test_ai_tracks.py +1 -4
  28. coder_music_cli-0.4.0/music_cli/sources/ai_generator.py +0 -258
  29. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/LICENSE +0 -0
  30. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/coder_music_cli.egg-info/dependency_links.txt +0 -0
  31. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/coder_music_cli.egg-info/entry_points.txt +0 -0
  32. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/coder_music_cli.egg-info/top_level.txt +0 -0
  33. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/__main__.py +0 -0
  34. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/ai_tracks.py +0 -0
  35. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/context/__init__.py +0 -0
  36. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/context/mood.py +0 -0
  37. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/context/temporal.py +0 -0
  38. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/history.py +0 -0
  39. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/player/__init__.py +0 -0
  40. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/player/base.py +0 -0
  41. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/sources/__init__.py +0 -0
  42. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/sources/local.py +0 -0
  43. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/music_cli/sources/radio.py +0 -0
  44. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/setup.cfg +0 -0
  45. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/tests/test_config.py +0 -0
  46. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/tests/test_context.py +0 -0
  47. {coder_music_cli-0.4.0 → coder_music_cli-0.5.0}/tests/test_history.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: coder-music-cli
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: A command-line music application for coders with daemon support, radio streaming, and AI-generated music
5
5
  Author-email: Luong Nguyen <luongnv89@gmail.com>
6
6
  Maintainer-email: Luong Nguyen <luongnv89@gmail.com>
@@ -16,6 +16,7 @@ Classifier: Environment :: Console
16
16
  Classifier: Intended Audience :: Developers
17
17
  Classifier: Operating System :: POSIX :: Linux
18
18
  Classifier: Operating System :: MacOS
19
+ Classifier: Operating System :: Microsoft :: Windows
19
20
  Classifier: Programming Language :: Python :: 3
20
21
  Classifier: Programming Language :: Python :: 3.9
21
22
  Classifier: Programming Language :: Python :: 3.10
@@ -31,7 +32,10 @@ Requires-Dist: tomli-w>=1.0
31
32
  Provides-Extra: ai
32
33
  Requires-Dist: torch>=2.0; extra == "ai"
33
34
  Requires-Dist: transformers<4.51,>=4.31; extra == "ai"
35
+ Requires-Dist: diffusers>=0.15.0; extra == "ai"
34
36
  Requires-Dist: scipy>=1.10; extra == "ai"
37
+ Requires-Dist: tqdm>=4.64; extra == "ai"
38
+ Requires-Dist: accelerate>=0.20; extra == "ai"
35
39
  Provides-Extra: dev
36
40
  Requires-Dist: pytest>=7.0; extra == "dev"
37
41
  Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
@@ -43,11 +47,21 @@ Requires-Dist: bandit>=1.7; extra == "dev"
43
47
  Requires-Dist: pre-commit>=3.0; extra == "dev"
44
48
  Dynamic: license-file
45
49
 
46
- # music-cli
50
+ <p align="center">
51
+ <img src="assets/logo/logo-mark.svg" alt="music-cli logo" width="80" height="80">
52
+ </p>
47
53
 
48
- [![PyPI version](https://img.shields.io/pypi/v/coder-music-cli.svg)](https://pypi.org/project/coder-music-cli/)
49
- [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
50
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
54
+ <h1 align="center">music-cli</h1>
55
+
56
+ <p align="center">
57
+ <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>
58
+ <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.9+-blue.svg" alt="Python 3.9+"></a>
59
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
60
+ </p>
61
+
62
+ <p align="center">
63
+ <img src="music-cli-ai.gif" alt="music-cli AI demo" width="600">
64
+ </p>
51
65
 
52
66
  A command-line music player for coders. Background daemon with radio streaming, local MP3s, and AI-generated music.
53
67
 
@@ -68,23 +82,26 @@ pip install coder-music-cli
68
82
  uv pip install coder-music-cli
69
83
 
70
84
  # Install FFmpeg (required)
71
- brew install ffmpeg # macOS
72
- sudo apt install ffmpeg # Ubuntu/Debian
85
+ brew install ffmpeg # macOS
86
+ sudo apt install ffmpeg # Ubuntu/Debian
87
+ choco install ffmpeg # Windows (or: winget install ffmpeg)
73
88
  ```
74
89
 
75
90
  ### Optional: AI Music Generation
76
91
 
77
92
  ```bash
78
- pip install 'coder-music-cli[ai]' # ~5GB (PyTorch + MusicGen via Transformers)
93
+ pip install 'coder-music-cli[ai]' # ~5GB (PyTorch + Transformers + Diffusers)
79
94
  ```
80
95
 
96
+ Supports multiple AI models via HuggingFace: MusicGen, AudioLDM, and Bark.
97
+
81
98
  ## Features
82
99
 
83
100
  - **Daemon-based** - Persistent background playback
84
101
  - **Multiple sources** - Local files, radio streams, AI generation
85
102
  - **Context-aware** - Selects music based on time of day and mood
86
103
  - **35+ Radio Stations** - Curated stations in English, French, Spanish, and Italian
87
- - **AI Music Generation** - Generate music with MusicGen (saved for replay)
104
+ - **AI Music Generation** - Generate music with MusicGen, AudioLDM, or Bark models
88
105
  - **Version-aware Updates** - Automatic notification when new stations are available
89
106
  - **Inspirational Quotes** - Random music quotes with every status check
90
107
  - **Simple config** - Human-readable text files
@@ -170,41 +187,84 @@ music-cli play -m history -i 3 # Replay item #3
170
187
 
171
188
  ## AI Music Generation
172
189
 
173
- Generate unique music with Meta's MusicGen model:
190
+ Generate unique audio with multiple AI models via HuggingFace:
174
191
 
175
192
  ```bash
176
- # Install AI dependencies
193
+ # Install AI dependencies (~5GB: PyTorch + Transformers + Diffusers)
177
194
  pip install 'coder-music-cli[ai]'
178
195
 
179
196
  # Generate and manage AI music
180
- music-cli ai play # Context-aware generation
181
- music-cli ai play -p "jazz piano" # Custom prompt
182
- music-cli ai play --mood focus -d 30 # 30-second focus track
183
- music-cli ai list # List all generated tracks
184
- music-cli ai replay 1 # Replay track #1
185
- music-cli ai remove 2 # Delete track #2
197
+ music-cli ai play # Context-aware (default: musicgen-small)
198
+ music-cli ai play -p "jazz piano" # Custom prompt
199
+ music-cli ai play -m audioldm-s-full-v2 # Use AudioLDM model
200
+ music-cli ai play -m bark-small -p "Hello!" # Use Bark for speech
201
+ music-cli ai play --mood focus -d 30 # 30-second focus track
202
+ music-cli ai models # List available models
203
+ music-cli ai list # List all generated tracks
204
+ music-cli ai replay 1 # Replay track #1
205
+ music-cli ai remove 2 # Delete track #2
186
206
  ```
187
207
 
208
+ ### Available AI Models
209
+
210
+ | Model ID | Type | Best For | Size |
211
+ |----------|------|----------|------|
212
+ | `musicgen-small` | MusicGen | Music generation (default) | ~1.5GB |
213
+ | `musicgen-medium` | MusicGen | Higher quality music | ~3GB |
214
+ | `musicgen-large` | MusicGen | Best quality music | ~6GB |
215
+ | `musicgen-melody` | MusicGen | Melody-conditioned music | ~3GB |
216
+ | `audioldm-s-full-v2` | AudioLDM | Sound effects, ambient audio | ~1GB |
217
+ | `audioldm-l-full` | AudioLDM | High-quality audio generation | ~2GB |
218
+ | `bark` | Bark | Speech synthesis, audio with voice | ~5GB |
219
+ | `bark-small` | Bark | Faster speech synthesis | ~1.5GB |
220
+
188
221
  ### AI Command Suite
189
222
 
190
223
  | Command | Description |
191
224
  |---------|-------------|
225
+ | `ai models` | List all available AI models |
192
226
  | `ai list` | Show all AI-generated tracks with prompts |
193
227
  | `ai play` | Generate music from current context |
228
+ | `ai play -m <model>` | Generate with specific model |
194
229
  | `ai play -p "prompt"` | Generate with custom prompt |
195
230
  | `ai play --mood focus` | Generate with specific mood |
196
231
  | `ai play -d 30` | Generate 30-second track (default: 5s) |
197
232
  | `ai replay <num>` | Replay track by number (regenerates if file missing) |
198
233
  | `ai remove <num>` | Delete track and audio file |
199
234
 
200
- Features:
235
+ ### Features
236
+ - **Multiple models** - MusicGen, AudioLDM, and Bark model families
237
+ - **Smart caching** - LRU cache keeps up to 2 models in memory (configurable)
238
+ - **Download progress** - Progress bar shown during model downloads
239
+ - **GPU memory management** - Automatic cleanup when switching models
201
240
  - **Context-aware** - Uses time of day, day of week, and session mood
202
241
  - **Custom prompts** - Generate exactly what you want with `-p`
203
242
  - **Seamless looping** - All tracks engineered for infinite playback
204
243
  - **Track management** - List, replay, and remove generated tracks
205
244
  - **Regeneration** - Missing files can be regenerated with original prompt
206
245
  - **Animated feedback** - "composing..." animation while generating
207
- - **Persistent storage** - Tracks saved to `~/.config/music-cli/ai_music/`
246
+ - **Persistent storage** - Tracks saved to config directory
247
+
248
+ ### Requirements
249
+ - ~5GB disk space minimum (PyTorch + Transformers + Diffusers)
250
+ - ~8GB RAM minimum for generation (16GB recommended for larger models)
251
+ - Models are downloaded on first use
252
+
253
+ ### Configuration
254
+
255
+ Configure AI settings in `~/.config/music-cli/config.toml`:
256
+
257
+ ```toml
258
+ [ai]
259
+ default_model = "musicgen-small" # Default model for generation
260
+
261
+ [ai.cache]
262
+ max_models = 2 # Max models to keep in memory (LRU eviction)
263
+
264
+ [ai.models.audioldm-s-full-v2.extra_params]
265
+ num_inference_steps = 10 # More = better quality, slower
266
+ guidance_scale = 2.5 # How closely to follow prompt
267
+ ```
208
268
 
209
269
  ## Moods
210
270
 
@@ -212,7 +272,9 @@ Features:
212
272
 
213
273
  ## Configuration
214
274
 
215
- Files in `~/.config/music-cli/`:
275
+ Configuration files location:
276
+ - **Linux/macOS**: `~/.config/music-cli/`
277
+ - **Windows**: `%LOCALAPPDATA%\music-cli\`
216
278
 
217
279
  | File | Purpose |
218
280
  |------|---------|
@@ -276,9 +338,29 @@ GitHub: https://github.com/luongnv89/music-cli
276
338
 
277
339
  - Python 3.9+
278
340
  - FFmpeg
341
+ - **Supported Platforms**: Linux, macOS, Windows 10+
279
342
 
280
343
  ## Changelog
281
344
 
345
+ ### v0.5.0
346
+ - Add multiple AI model support:
347
+ - **AudioLDM models**: `audioldm-s-full-v2`, `audioldm-l-full` for sound effects and ambient audio
348
+ - **Bark models**: `bark`, `bark-small` for speech synthesis
349
+ - **MusicGen models**: All existing models continue to work
350
+ - Add `ai models` command to list all available AI models
351
+ - Add LRU cache for AI models with configurable size (default: 2 models)
352
+ - Add download progress bar during model downloads
353
+ - Add GPU memory management with automatic cleanup on model eviction
354
+ - Default model: `musicgen-small`
355
+
356
+ ### v0.4.1
357
+ - Add Windows 10+ support
358
+ - Platform abstraction layer for cross-platform compatibility
359
+ - TCP localhost IPC on Windows (Unix sockets on Linux/macOS)
360
+ - stdin-based pause/resume on Windows (signals on Linux/macOS)
361
+ - Windows-specific config directory (`%LOCALAPPDATA%\music-cli\`)
362
+ - Add Windows to CI test matrix
363
+
282
364
  ### v0.4.0
283
365
  - Add `music-cli ai` command suite for AI track management
284
366
  - `ai list` - Display all AI tracks with prompts
@@ -1,8 +1,18 @@
1
- # music-cli
1
+ <p align="center">
2
+ <img src="assets/logo/logo-mark.svg" alt="music-cli logo" width="80" height="80">
3
+ </p>
2
4
 
3
- [![PyPI version](https://img.shields.io/pypi/v/coder-music-cli.svg)](https://pypi.org/project/coder-music-cli/)
4
- [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ <h1 align="center">music-cli</h1>
6
+
7
+ <p align="center">
8
+ <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>
9
+ <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.9+-blue.svg" alt="Python 3.9+"></a>
10
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
11
+ </p>
12
+
13
+ <p align="center">
14
+ <img src="music-cli-ai.gif" alt="music-cli AI demo" width="600">
15
+ </p>
6
16
 
7
17
  A command-line music player for coders. Background daemon with radio streaming, local MP3s, and AI-generated music.
8
18
 
@@ -23,23 +33,26 @@ pip install coder-music-cli
23
33
  uv pip install coder-music-cli
24
34
 
25
35
  # Install FFmpeg (required)
26
- brew install ffmpeg # macOS
27
- sudo apt install ffmpeg # Ubuntu/Debian
36
+ brew install ffmpeg # macOS
37
+ sudo apt install ffmpeg # Ubuntu/Debian
38
+ choco install ffmpeg # Windows (or: winget install ffmpeg)
28
39
  ```
29
40
 
30
41
  ### Optional: AI Music Generation
31
42
 
32
43
  ```bash
33
- pip install 'coder-music-cli[ai]' # ~5GB (PyTorch + MusicGen via Transformers)
44
+ pip install 'coder-music-cli[ai]' # ~5GB (PyTorch + Transformers + Diffusers)
34
45
  ```
35
46
 
47
+ Supports multiple AI models via HuggingFace: MusicGen, AudioLDM, and Bark.
48
+
36
49
  ## Features
37
50
 
38
51
  - **Daemon-based** - Persistent background playback
39
52
  - **Multiple sources** - Local files, radio streams, AI generation
40
53
  - **Context-aware** - Selects music based on time of day and mood
41
54
  - **35+ Radio Stations** - Curated stations in English, French, Spanish, and Italian
42
- - **AI Music Generation** - Generate music with MusicGen (saved for replay)
55
+ - **AI Music Generation** - Generate music with MusicGen, AudioLDM, or Bark models
43
56
  - **Version-aware Updates** - Automatic notification when new stations are available
44
57
  - **Inspirational Quotes** - Random music quotes with every status check
45
58
  - **Simple config** - Human-readable text files
@@ -125,41 +138,84 @@ music-cli play -m history -i 3 # Replay item #3
125
138
 
126
139
  ## AI Music Generation
127
140
 
128
- Generate unique music with Meta's MusicGen model:
141
+ Generate unique audio with multiple AI models via HuggingFace:
129
142
 
130
143
  ```bash
131
- # Install AI dependencies
144
+ # Install AI dependencies (~5GB: PyTorch + Transformers + Diffusers)
132
145
  pip install 'coder-music-cli[ai]'
133
146
 
134
147
  # Generate and manage AI music
135
- music-cli ai play # Context-aware generation
136
- music-cli ai play -p "jazz piano" # Custom prompt
137
- music-cli ai play --mood focus -d 30 # 30-second focus track
138
- music-cli ai list # List all generated tracks
139
- music-cli ai replay 1 # Replay track #1
140
- music-cli ai remove 2 # Delete track #2
148
+ music-cli ai play # Context-aware (default: musicgen-small)
149
+ music-cli ai play -p "jazz piano" # Custom prompt
150
+ music-cli ai play -m audioldm-s-full-v2 # Use AudioLDM model
151
+ music-cli ai play -m bark-small -p "Hello!" # Use Bark for speech
152
+ music-cli ai play --mood focus -d 30 # 30-second focus track
153
+ music-cli ai models # List available models
154
+ music-cli ai list # List all generated tracks
155
+ music-cli ai replay 1 # Replay track #1
156
+ music-cli ai remove 2 # Delete track #2
141
157
  ```
142
158
 
159
+ ### Available AI Models
160
+
161
+ | Model ID | Type | Best For | Size |
162
+ |----------|------|----------|------|
163
+ | `musicgen-small` | MusicGen | Music generation (default) | ~1.5GB |
164
+ | `musicgen-medium` | MusicGen | Higher quality music | ~3GB |
165
+ | `musicgen-large` | MusicGen | Best quality music | ~6GB |
166
+ | `musicgen-melody` | MusicGen | Melody-conditioned music | ~3GB |
167
+ | `audioldm-s-full-v2` | AudioLDM | Sound effects, ambient audio | ~1GB |
168
+ | `audioldm-l-full` | AudioLDM | High-quality audio generation | ~2GB |
169
+ | `bark` | Bark | Speech synthesis, audio with voice | ~5GB |
170
+ | `bark-small` | Bark | Faster speech synthesis | ~1.5GB |
171
+
143
172
  ### AI Command Suite
144
173
 
145
174
  | Command | Description |
146
175
  |---------|-------------|
176
+ | `ai models` | List all available AI models |
147
177
  | `ai list` | Show all AI-generated tracks with prompts |
148
178
  | `ai play` | Generate music from current context |
179
+ | `ai play -m <model>` | Generate with specific model |
149
180
  | `ai play -p "prompt"` | Generate with custom prompt |
150
181
  | `ai play --mood focus` | Generate with specific mood |
151
182
  | `ai play -d 30` | Generate 30-second track (default: 5s) |
152
183
  | `ai replay <num>` | Replay track by number (regenerates if file missing) |
153
184
  | `ai remove <num>` | Delete track and audio file |
154
185
 
155
- Features:
186
+ ### Features
187
+ - **Multiple models** - MusicGen, AudioLDM, and Bark model families
188
+ - **Smart caching** - LRU cache keeps up to 2 models in memory (configurable)
189
+ - **Download progress** - Progress bar shown during model downloads
190
+ - **GPU memory management** - Automatic cleanup when switching models
156
191
  - **Context-aware** - Uses time of day, day of week, and session mood
157
192
  - **Custom prompts** - Generate exactly what you want with `-p`
158
193
  - **Seamless looping** - All tracks engineered for infinite playback
159
194
  - **Track management** - List, replay, and remove generated tracks
160
195
  - **Regeneration** - Missing files can be regenerated with original prompt
161
196
  - **Animated feedback** - "composing..." animation while generating
162
- - **Persistent storage** - Tracks saved to `~/.config/music-cli/ai_music/`
197
+ - **Persistent storage** - Tracks saved to config directory
198
+
199
+ ### Requirements
200
+ - ~5GB disk space minimum (PyTorch + Transformers + Diffusers)
201
+ - ~8GB RAM minimum for generation (16GB recommended for larger models)
202
+ - Models are downloaded on first use
203
+
204
+ ### Configuration
205
+
206
+ Configure AI settings in `~/.config/music-cli/config.toml`:
207
+
208
+ ```toml
209
+ [ai]
210
+ default_model = "musicgen-small" # Default model for generation
211
+
212
+ [ai.cache]
213
+ max_models = 2 # Max models to keep in memory (LRU eviction)
214
+
215
+ [ai.models.audioldm-s-full-v2.extra_params]
216
+ num_inference_steps = 10 # More = better quality, slower
217
+ guidance_scale = 2.5 # How closely to follow prompt
218
+ ```
163
219
 
164
220
  ## Moods
165
221
 
@@ -167,7 +223,9 @@ Features:
167
223
 
168
224
  ## Configuration
169
225
 
170
- Files in `~/.config/music-cli/`:
226
+ Configuration files location:
227
+ - **Linux/macOS**: `~/.config/music-cli/`
228
+ - **Windows**: `%LOCALAPPDATA%\music-cli\`
171
229
 
172
230
  | File | Purpose |
173
231
  |------|---------|
@@ -231,9 +289,29 @@ GitHub: https://github.com/luongnv89/music-cli
231
289
 
232
290
  - Python 3.9+
233
291
  - FFmpeg
292
+ - **Supported Platforms**: Linux, macOS, Windows 10+
234
293
 
235
294
  ## Changelog
236
295
 
296
+ ### v0.5.0
297
+ - Add multiple AI model support:
298
+ - **AudioLDM models**: `audioldm-s-full-v2`, `audioldm-l-full` for sound effects and ambient audio
299
+ - **Bark models**: `bark`, `bark-small` for speech synthesis
300
+ - **MusicGen models**: All existing models continue to work
301
+ - Add `ai models` command to list all available AI models
302
+ - Add LRU cache for AI models with configurable size (default: 2 models)
303
+ - Add download progress bar during model downloads
304
+ - Add GPU memory management with automatic cleanup on model eviction
305
+ - Default model: `musicgen-small`
306
+
307
+ ### v0.4.1
308
+ - Add Windows 10+ support
309
+ - Platform abstraction layer for cross-platform compatibility
310
+ - TCP localhost IPC on Windows (Unix sockets on Linux/macOS)
311
+ - stdin-based pause/resume on Windows (signals on Linux/macOS)
312
+ - Windows-specific config directory (`%LOCALAPPDATA%\music-cli\`)
313
+ - Add Windows to CI test matrix
314
+
237
315
  ### v0.4.0
238
316
  - Add `music-cli ai` command suite for AI track management
239
317
  - `ai list` - Display all AI tracks with prompts
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: coder-music-cli
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: A command-line music application for coders with daemon support, radio streaming, and AI-generated music
5
5
  Author-email: Luong Nguyen <luongnv89@gmail.com>
6
6
  Maintainer-email: Luong Nguyen <luongnv89@gmail.com>
@@ -16,6 +16,7 @@ Classifier: Environment :: Console
16
16
  Classifier: Intended Audience :: Developers
17
17
  Classifier: Operating System :: POSIX :: Linux
18
18
  Classifier: Operating System :: MacOS
19
+ Classifier: Operating System :: Microsoft :: Windows
19
20
  Classifier: Programming Language :: Python :: 3
20
21
  Classifier: Programming Language :: Python :: 3.9
21
22
  Classifier: Programming Language :: Python :: 3.10
@@ -31,7 +32,10 @@ Requires-Dist: tomli-w>=1.0
31
32
  Provides-Extra: ai
32
33
  Requires-Dist: torch>=2.0; extra == "ai"
33
34
  Requires-Dist: transformers<4.51,>=4.31; extra == "ai"
35
+ Requires-Dist: diffusers>=0.15.0; extra == "ai"
34
36
  Requires-Dist: scipy>=1.10; extra == "ai"
37
+ Requires-Dist: tqdm>=4.64; extra == "ai"
38
+ Requires-Dist: accelerate>=0.20; extra == "ai"
35
39
  Provides-Extra: dev
36
40
  Requires-Dist: pytest>=7.0; extra == "dev"
37
41
  Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
@@ -43,11 +47,21 @@ Requires-Dist: bandit>=1.7; extra == "dev"
43
47
  Requires-Dist: pre-commit>=3.0; extra == "dev"
44
48
  Dynamic: license-file
45
49
 
46
- # music-cli
50
+ <p align="center">
51
+ <img src="assets/logo/logo-mark.svg" alt="music-cli logo" width="80" height="80">
52
+ </p>
47
53
 
48
- [![PyPI version](https://img.shields.io/pypi/v/coder-music-cli.svg)](https://pypi.org/project/coder-music-cli/)
49
- [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
50
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
54
+ <h1 align="center">music-cli</h1>
55
+
56
+ <p align="center">
57
+ <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>
58
+ <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.9+-blue.svg" alt="Python 3.9+"></a>
59
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
60
+ </p>
61
+
62
+ <p align="center">
63
+ <img src="music-cli-ai.gif" alt="music-cli AI demo" width="600">
64
+ </p>
51
65
 
52
66
  A command-line music player for coders. Background daemon with radio streaming, local MP3s, and AI-generated music.
53
67
 
@@ -68,23 +82,26 @@ pip install coder-music-cli
68
82
  uv pip install coder-music-cli
69
83
 
70
84
  # Install FFmpeg (required)
71
- brew install ffmpeg # macOS
72
- sudo apt install ffmpeg # Ubuntu/Debian
85
+ brew install ffmpeg # macOS
86
+ sudo apt install ffmpeg # Ubuntu/Debian
87
+ choco install ffmpeg # Windows (or: winget install ffmpeg)
73
88
  ```
74
89
 
75
90
  ### Optional: AI Music Generation
76
91
 
77
92
  ```bash
78
- pip install 'coder-music-cli[ai]' # ~5GB (PyTorch + MusicGen via Transformers)
93
+ pip install 'coder-music-cli[ai]' # ~5GB (PyTorch + Transformers + Diffusers)
79
94
  ```
80
95
 
96
+ Supports multiple AI models via HuggingFace: MusicGen, AudioLDM, and Bark.
97
+
81
98
  ## Features
82
99
 
83
100
  - **Daemon-based** - Persistent background playback
84
101
  - **Multiple sources** - Local files, radio streams, AI generation
85
102
  - **Context-aware** - Selects music based on time of day and mood
86
103
  - **35+ Radio Stations** - Curated stations in English, French, Spanish, and Italian
87
- - **AI Music Generation** - Generate music with MusicGen (saved for replay)
104
+ - **AI Music Generation** - Generate music with MusicGen, AudioLDM, or Bark models
88
105
  - **Version-aware Updates** - Automatic notification when new stations are available
89
106
  - **Inspirational Quotes** - Random music quotes with every status check
90
107
  - **Simple config** - Human-readable text files
@@ -170,41 +187,84 @@ music-cli play -m history -i 3 # Replay item #3
170
187
 
171
188
  ## AI Music Generation
172
189
 
173
- Generate unique music with Meta's MusicGen model:
190
+ Generate unique audio with multiple AI models via HuggingFace:
174
191
 
175
192
  ```bash
176
- # Install AI dependencies
193
+ # Install AI dependencies (~5GB: PyTorch + Transformers + Diffusers)
177
194
  pip install 'coder-music-cli[ai]'
178
195
 
179
196
  # Generate and manage AI music
180
- music-cli ai play # Context-aware generation
181
- music-cli ai play -p "jazz piano" # Custom prompt
182
- music-cli ai play --mood focus -d 30 # 30-second focus track
183
- music-cli ai list # List all generated tracks
184
- music-cli ai replay 1 # Replay track #1
185
- music-cli ai remove 2 # Delete track #2
197
+ music-cli ai play # Context-aware (default: musicgen-small)
198
+ music-cli ai play -p "jazz piano" # Custom prompt
199
+ music-cli ai play -m audioldm-s-full-v2 # Use AudioLDM model
200
+ music-cli ai play -m bark-small -p "Hello!" # Use Bark for speech
201
+ music-cli ai play --mood focus -d 30 # 30-second focus track
202
+ music-cli ai models # List available models
203
+ music-cli ai list # List all generated tracks
204
+ music-cli ai replay 1 # Replay track #1
205
+ music-cli ai remove 2 # Delete track #2
186
206
  ```
187
207
 
208
+ ### Available AI Models
209
+
210
+ | Model ID | Type | Best For | Size |
211
+ |----------|------|----------|------|
212
+ | `musicgen-small` | MusicGen | Music generation (default) | ~1.5GB |
213
+ | `musicgen-medium` | MusicGen | Higher quality music | ~3GB |
214
+ | `musicgen-large` | MusicGen | Best quality music | ~6GB |
215
+ | `musicgen-melody` | MusicGen | Melody-conditioned music | ~3GB |
216
+ | `audioldm-s-full-v2` | AudioLDM | Sound effects, ambient audio | ~1GB |
217
+ | `audioldm-l-full` | AudioLDM | High-quality audio generation | ~2GB |
218
+ | `bark` | Bark | Speech synthesis, audio with voice | ~5GB |
219
+ | `bark-small` | Bark | Faster speech synthesis | ~1.5GB |
220
+
188
221
  ### AI Command Suite
189
222
 
190
223
  | Command | Description |
191
224
  |---------|-------------|
225
+ | `ai models` | List all available AI models |
192
226
  | `ai list` | Show all AI-generated tracks with prompts |
193
227
  | `ai play` | Generate music from current context |
228
+ | `ai play -m <model>` | Generate with specific model |
194
229
  | `ai play -p "prompt"` | Generate with custom prompt |
195
230
  | `ai play --mood focus` | Generate with specific mood |
196
231
  | `ai play -d 30` | Generate 30-second track (default: 5s) |
197
232
  | `ai replay <num>` | Replay track by number (regenerates if file missing) |
198
233
  | `ai remove <num>` | Delete track and audio file |
199
234
 
200
- Features:
235
+ ### Features
236
+ - **Multiple models** - MusicGen, AudioLDM, and Bark model families
237
+ - **Smart caching** - LRU cache keeps up to 2 models in memory (configurable)
238
+ - **Download progress** - Progress bar shown during model downloads
239
+ - **GPU memory management** - Automatic cleanup when switching models
201
240
  - **Context-aware** - Uses time of day, day of week, and session mood
202
241
  - **Custom prompts** - Generate exactly what you want with `-p`
203
242
  - **Seamless looping** - All tracks engineered for infinite playback
204
243
  - **Track management** - List, replay, and remove generated tracks
205
244
  - **Regeneration** - Missing files can be regenerated with original prompt
206
245
  - **Animated feedback** - "composing..." animation while generating
207
- - **Persistent storage** - Tracks saved to `~/.config/music-cli/ai_music/`
246
+ - **Persistent storage** - Tracks saved to config directory
247
+
248
+ ### Requirements
249
+ - ~5GB disk space minimum (PyTorch + Transformers + Diffusers)
250
+ - ~8GB RAM minimum for generation (16GB recommended for larger models)
251
+ - Models are downloaded on first use
252
+
253
+ ### Configuration
254
+
255
+ Configure AI settings in `~/.config/music-cli/config.toml`:
256
+
257
+ ```toml
258
+ [ai]
259
+ default_model = "musicgen-small" # Default model for generation
260
+
261
+ [ai.cache]
262
+ max_models = 2 # Max models to keep in memory (LRU eviction)
263
+
264
+ [ai.models.audioldm-s-full-v2.extra_params]
265
+ num_inference_steps = 10 # More = better quality, slower
266
+ guidance_scale = 2.5 # How closely to follow prompt
267
+ ```
208
268
 
209
269
  ## Moods
210
270
 
@@ -212,7 +272,9 @@ Features:
212
272
 
213
273
  ## Configuration
214
274
 
215
- Files in `~/.config/music-cli/`:
275
+ Configuration files location:
276
+ - **Linux/macOS**: `~/.config/music-cli/`
277
+ - **Windows**: `%LOCALAPPDATA%\music-cli\`
216
278
 
217
279
  | File | Purpose |
218
280
  |------|---------|
@@ -276,9 +338,29 @@ GitHub: https://github.com/luongnv89/music-cli
276
338
 
277
339
  - Python 3.9+
278
340
  - FFmpeg
341
+ - **Supported Platforms**: Linux, macOS, Windows 10+
279
342
 
280
343
  ## Changelog
281
344
 
345
+ ### v0.5.0
346
+ - Add multiple AI model support:
347
+ - **AudioLDM models**: `audioldm-s-full-v2`, `audioldm-l-full` for sound effects and ambient audio
348
+ - **Bark models**: `bark`, `bark-small` for speech synthesis
349
+ - **MusicGen models**: All existing models continue to work
350
+ - Add `ai models` command to list all available AI models
351
+ - Add LRU cache for AI models with configurable size (default: 2 models)
352
+ - Add download progress bar during model downloads
353
+ - Add GPU memory management with automatic cleanup on model eviction
354
+ - Default model: `musicgen-small`
355
+
356
+ ### v0.4.1
357
+ - Add Windows 10+ support
358
+ - Platform abstraction layer for cross-platform compatibility
359
+ - TCP localhost IPC on Windows (Unix sockets on Linux/macOS)
360
+ - stdin-based pause/resume on Windows (signals on Linux/macOS)
361
+ - Windows-specific config directory (`%LOCALAPPDATA%\music-cli\`)
362
+ - Add Windows to CI test matrix
363
+
282
364
  ### v0.4.0
283
365
  - Add `music-cli ai` command suite for AI track management
284
366
  - `ai list` - Display all AI tracks with prompts
@@ -18,6 +18,10 @@ music_cli/history.py
18
18
  music_cli/context/__init__.py
19
19
  music_cli/context/mood.py
20
20
  music_cli/context/temporal.py
21
+ music_cli/platform/__init__.py
22
+ music_cli/platform/ipc.py
23
+ music_cli/platform/paths.py
24
+ music_cli/platform/player_control.py
21
25
  music_cli/player/__init__.py
22
26
  music_cli/player/base.py
23
27
  music_cli/player/ffplay.py
@@ -25,6 +29,15 @@ music_cli/sources/__init__.py
25
29
  music_cli/sources/ai_generator.py
26
30
  music_cli/sources/local.py
27
31
  music_cli/sources/radio.py
32
+ music_cli/sources/ai_models/__init__.py
33
+ music_cli/sources/ai_models/audioldm_strategy.py
34
+ music_cli/sources/ai_models/bark_strategy.py
35
+ music_cli/sources/ai_models/model_config.py
36
+ music_cli/sources/ai_models/model_registry.py
37
+ music_cli/sources/ai_models/model_strategy.py
38
+ music_cli/sources/ai_models/musicgen_strategy.py
39
+ music_cli/sources/ai_models/progress_callback.py
40
+ music_cli/sources/ai_models/strategy_cache.py
28
41
  tests/test_ai_tracks.py
29
42
  tests/test_config.py
30
43
  tests/test_context.py
@@ -7,7 +7,10 @@ tomli>=2.0
7
7
  [ai]
8
8
  torch>=2.0
9
9
  transformers<4.51,>=4.31
10
+ diffusers>=0.15.0
10
11
  scipy>=1.10
12
+ tqdm>=4.64
13
+ accelerate>=0.20
11
14
 
12
15
  [dev]
13
16
  pytest>=7.0
@@ -1,4 +1,4 @@
1
1
  """music-cli: A command-line music application for coders."""
2
2
 
3
- __version__ = "0.4.0"
3
+ __version__ = "0.5.0"
4
4
  __github_url__ = "https://github.com/luongnv89/music-cli"