par-cli-tts 0.2.2__tar.gz → 0.4.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 (26) hide show
  1. par_cli_tts-0.4.1/.claude/output-styles/tts-summary.md +78 -0
  2. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/.gitignore +1 -0
  3. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/PKG-INFO +232 -10
  4. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/README.md +230 -8
  5. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/pyproject.toml +10 -1
  6. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/src/__init__.py +1 -1
  7. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/src/config_file.py +1 -2
  8. par_cli_tts-0.4.1/src/console.py +13 -0
  9. par_cli_tts-0.4.1/src/defaults.py +33 -0
  10. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/src/errors.py +1 -3
  11. par_cli_tts-0.4.1/src/http_client.py +21 -0
  12. par_cli_tts-0.4.1/src/install_claude_style.py +219 -0
  13. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/src/kokoro_cli.py +1 -2
  14. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/src/model_downloader.py +1 -2
  15. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/src/providers/elevenlabs.py +11 -10
  16. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/src/providers/kokoro_onnx.py +4 -40
  17. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/src/providers/openai.py +37 -57
  18. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/src/tts_cli.py +529 -304
  19. par_cli_tts-0.4.1/src/utils.py +331 -0
  20. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/src/voice_cache.py +3 -3
  21. par_cli_tts-0.2.2/src/utils.py +0 -101
  22. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/LICENSE +0 -0
  23. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/src/config.py +0 -0
  24. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/src/providers/__init__.py +0 -0
  25. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/src/providers/base.py +0 -0
  26. {par_cli_tts-0.2.2 → par_cli_tts-0.4.1}/src/py.typed +0 -0
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: TTS Summary
3
+ description: Audio task completion announcements with TTS
4
+ ---
5
+
6
+ # TTS Summary Output Style
7
+
8
+ You are Claude Code with an experimental TTS announcement feature designed to communicate directly with the user about what you've accomplished.
9
+
10
+ ## Variables
11
+ - **USER_NAME**: Paul
12
+
13
+ ## Standard Behavior
14
+ Respond normally to all user requests, using your full capabilities for:
15
+ - Code generation and editing
16
+ - File operations
17
+ - Running commands
18
+ - Analysis and explanations
19
+ - All standard Claude Code features
20
+
21
+ ## Critical Addition: Audio Task Summary
22
+
23
+ **At the very END of EVERY response**, you MUST provide an audio summary for the user:
24
+
25
+ 1. Write a clear separator: `---`
26
+ 2. Add the heading: `## Audio Summary for Paul`
27
+ 3. Craft a message that speaks DIRECTLY to Paul about what you did for them
28
+ 4. **IMMEDIATELY execute the TTS command using the Bash tool** - do NOT just display it in a code block
29
+
30
+ ### How to Execute the TTS Command
31
+
32
+ You MUST use the Bash tool to actually run the command. Do NOT wrap it in a markdown code block.
33
+
34
+ **CORRECT** - Execute with Bash tool:
35
+ ```
36
+ [Bash tool call with command: par-tts "Paul, I've completed the task."]
37
+ ```
38
+
39
+ **WRONG** - Just displaying (DO NOT DO THIS):
40
+ ```markdown
41
+ ```bash
42
+ par-tts "Paul, I've completed the task."
43
+ ```
44
+ ```
45
+
46
+ The user should hear the audio playback, not just see the command text.
47
+
48
+ ## Communication Guidelines
49
+
50
+ - **Address Paul directly** when appropriate: "Paul, I've updated your..." or "Fixed the bug in..."
51
+ - **Focus on outcomes** for the user: what they can now do, what's been improved
52
+ - **Be conversational** - speak as if telling Paul what you just did
53
+ - **Highlight value** - emphasize what's useful about the change
54
+ - **Keep it concise** - one clear sentence (under 20 words)
55
+
56
+ ## Example Response Pattern
57
+
58
+ [Your normal response content here...]
59
+
60
+ ---
61
+
62
+ ## Audio Summary for Paul
63
+
64
+ Paul, I've created three new output styles to customize how you receive information.
65
+
66
+ [Bash tool call: par-tts "Paul, I've created three new output styles to customize how you receive information."]
67
+
68
+ ## Important Rules
69
+
70
+ - ALWAYS include the audio summary, even for simple queries
71
+ - Speak TO the user, not about abstract tasks
72
+ - Use natural, conversational language
73
+ - Focus on the user benefit or outcome
74
+ - Make it feel like a helpful assistant reporting completion
75
+ - **EXECUTE the command with the Bash tool - do NOT just display it in a code block**
76
+ - The user should HEAR the audio, not just see the command text
77
+
78
+ This experimental feature provides personalized audio feedback about task completion.
@@ -269,3 +269,4 @@ junit.xml
269
269
  # Documentation builds
270
270
  docs/_build/
271
271
  docs/.doctrees/
272
+ settings.local.json
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: par-cli-tts
3
- Version: 0.2.2
3
+ Version: 0.4.1
4
4
  Summary: PAR CLI TTS - Command line text-to-speech tool using ElevenLabs with voice caching and name resolution
5
5
  Project-URL: Homepage, https://github.com/paulrobello/par-cli-tts
6
6
  Project-URL: Documentation, https://github.com/paulrobello/par-cli-tts/blob/main/README.md
@@ -51,7 +51,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
51
51
  Classifier: Typing :: Typed
52
52
  Requires-Python: >=3.11
53
53
  Requires-Dist: elevenlabs>=1.0.0
54
- Requires-Dist: kokoro-onnx>=0.4.9
54
+ Requires-Dist: kokoro-onnx>=0.5.0
55
55
  Requires-Dist: openai>=1.100.1
56
56
  Requires-Dist: platformdirs>=4.3.0
57
57
  Requires-Dist: python-dotenv>=1.0.0
@@ -68,15 +68,57 @@ Description-Content-Type: text/markdown
68
68
  ![Arch x86-63 | ARM | AppleSilicon](https://img.shields.io/badge/arch-x86--64%20%7C%20ARM%20%7C%20AppleSilicon-blue)
69
69
 
70
70
  ![MIT License](https://img.shields.io/badge/license-MIT-green.svg)
71
- ![Version](https://img.shields.io/badge/version-0.2.2-green.svg)
71
+ ![Version](https://img.shields.io/badge/version-0.4.1-green.svg)
72
72
  ![Development Status](https://img.shields.io/badge/status-stable-green.svg)
73
73
 
74
74
  A powerful command-line text-to-speech tool supporting multiple TTS providers (ElevenLabs, OpenAI, and Kokoro ONNX) with intelligent voice caching, name resolution, and flexible output options.
75
75
 
76
76
  [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/probello3)
77
77
 
78
+ ## Table of Contents
79
+
80
+ - [What's New](#whats-new)
81
+ - [Features](#features)
82
+ - [Technology Stack](#technology-stack)
83
+ - [Prerequisites](#prerequisites)
84
+ - [Installation](#installation)
85
+ - [From PyPI](#installation-from-pypi-recommended)
86
+ - [From Source](#installation-from-source)
87
+ - [Kokoro ONNX Setup](#kokoro-onnx-setup)
88
+ - [Using with AI Agents](#using-with-ai-agents)
89
+ - [Claude Code Setup](#claude-code-setup)
90
+ - [Claude Code Output Style](#claude-code-output-style)
91
+ - [Configuration](#configuration)
92
+ - [Usage](#usage)
93
+ - [Command Line Options](#command-line-options)
94
+ - [Providers](#providers)
95
+ - [Cache Locations](#cache-locations)
96
+ - [Development](#development)
97
+ - [Troubleshooting](#troubleshooting)
98
+ - [Contributing](#contributing)
99
+ - [License](#license)
100
+ - [Author](#author)
101
+ - [Acknowledgments](#acknowledgments)
102
+ - [Support](#support)
103
+
78
104
  ## What's New
79
105
 
106
+ ### v0.4.1
107
+ - **Claude Code output style installer** - New `install-claude-style` command to automatically set up TTS audio summaries
108
+ - **Bundled output style** - TTS Summary output style included with the package
109
+
110
+ ### v0.4.0
111
+ - **OpenAI gpt-4o-mini-tts** - New steerable TTS model with `--instructions` option
112
+ - **7 new OpenAI voices** - ash, ballad, coral, sage, verse, marin, cedar (13 total)
113
+ - **ElevenLabs model updated** - Changed from deprecated `eleven_monolingual_v1` to `eleven_multilingual_v2`
114
+ - **Kokoro ONNX 0.5.0** - Updated to latest version
115
+
116
+ ### v0.3.0
117
+ - Major code refactoring with better modularity and code organization
118
+ - New utility modules for shared console, defaults, and HTTP client
119
+ - Test suite with 46 tests for better reliability
120
+ - Documentation synced to match current implementation
121
+
80
122
  ### v0.2.2
81
123
  - Updated all HTTP requests and downloaders to ignore SSL certificate errors
82
124
  - Improves compatibility with corporate proxies and development environments
@@ -94,7 +136,7 @@ A powerful command-line text-to-speech tool supporting multiple TTS providers (E
94
136
  - **Smarter Voice Cache** - Change detection, manual refresh, and voice sample caching
95
137
  - **Consistent Error Handling** - Clear error messages with proper exit codes
96
138
  - **Multiple Input Methods** - Direct text, stdin piping, and file input (`@filename`)
97
- - **Volume Control** - Adjust playback volume (0.0 to 5.0) with platform-specific support
139
+ - **Volume Control** - Adjust playback volume (0.0 to 5.0) across all platforms (macOS, Linux, Windows)
98
140
  - **Voice Preview** - Test voices with sample text before using
99
141
 
100
142
  ### Improvements
@@ -110,7 +152,7 @@ A powerful command-line text-to-speech tool supporting multiple TTS providers (E
110
152
  - **Configuration File** - Set default preferences in YAML config file (`~/.config/par-tts/config.yaml`)
111
153
  - **Flexible Input Methods** - Accept text from command line, stdin pipe, or files (`@filename`)
112
154
  - **Voice Name Support** - Use voice names like "Juniper" or "nova" instead of cryptic IDs
113
- - **Volume Control** - Adjust playback volume (0.0 to 5.0) with platform-specific support
155
+ - **Volume Control** - Adjust playback volume (0.0 to 5.0) across all platforms (macOS, Linux, Windows)
114
156
  - **Voice Preview** - Test voices with sample text using `--preview-voice`
115
157
  - **Smart Voice Caching** - Change detection, auto-refresh, and voice sample caching
116
158
  - **Partial Name Matching** - Type "char" to match "Charlotte" (ElevenLabs)
@@ -151,6 +193,43 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
151
193
  powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
152
194
  ```
153
195
 
196
+ ### Windows Audio Requirements
197
+
198
+ For the best audio playback experience on Windows with volume control, install one of these audio players:
199
+
200
+ #### ffplay (Recommended)
201
+ ```powershell
202
+ # Using Chocolatey
203
+ choco install ffmpeg
204
+
205
+ # Using Scoop
206
+ scoop install ffmpeg
207
+
208
+ # Using winget
209
+ winget install ffmpeg
210
+ ```
211
+
212
+ #### VLC Media Player (Alternative)
213
+ Download from [videolan.org](https://www.videolan.org/vlc/) or:
214
+ ```powershell
215
+ # Using Chocolatey
216
+ choco install vlc
217
+
218
+ # Using winget
219
+ winget install VideoLAN.VLC
220
+ ```
221
+
222
+ #### mpg123 (Lightweight Option)
223
+ ```powershell
224
+ # Using Chocolatey
225
+ choco install mpg123
226
+
227
+ # Using Scoop
228
+ scoop install mpg123
229
+ ```
230
+
231
+ **Note**: If no external player is installed, PAR CLI TTS will use Windows PowerShell's built-in MediaPlayer COM object as a fallback. This provides basic playback with volume control (capped at 1.0/100%). For full volume control up to 5.0x, install ffplay, VLC, or mpg123.
232
+
154
233
  ## Installation
155
234
 
156
235
  ### Installation from PyPI (Recommended)
@@ -246,6 +325,121 @@ export KOKORO_VOICE_PATH=/path/to/voices-v1.0.bin
246
325
 
247
326
  When these environment variables are set, automatic download is disabled.
248
327
 
328
+ ## Using with AI Agents
329
+
330
+ PAR CLI TTS works great with AI agents like [Claude Code](https://claude.ai/code). When using it in an agent, you'll need to grant permission for the agent to run the `par-tts` command.
331
+
332
+ ### Claude Code Setup
333
+
334
+ The easiest way to allow Claude Code to use `par-tts` is to add the following to your `~/.claude/settings.json`:
335
+
336
+ ```json
337
+ {
338
+ "permissions": {
339
+ "allow": [
340
+ "Bash(par-tts:*)"
341
+ ]
342
+ }
343
+ }
344
+ ```
345
+
346
+ This grants Claude Code permission to run any `par-tts` command without prompting for approval each time.
347
+
348
+ ### Example Agent Usage
349
+
350
+ Once configured, your AI agent can easily generate speech:
351
+
352
+ ```bash
353
+ # Agent can run TTS commands directly
354
+ par-tts "Task completed successfully!"
355
+
356
+ # Save audio for notifications
357
+ par-tts "Build finished" --output /tmp/notify.mp3 --no-play
358
+ ```
359
+
360
+ ### Claude Code Output Style
361
+
362
+ This project includes a **TTS Summary** output style for Claude Code that provides audio announcements when tasks are completed. This creates a personalized audio feedback experience where Claude announces what it has accomplished.
363
+
364
+ #### Features
365
+
366
+ - Automatic audio summary at the end of every Claude Code response
367
+ - Personalized messages addressing you by name
368
+ - Focus on outcomes and user benefits
369
+ - Natural, conversational language
370
+
371
+ #### Installation
372
+
373
+ The easiest way to install the output style is using the built-in CLI command:
374
+
375
+ ```bash
376
+ # Interactive installation (prompts for your name)
377
+ par-tts-install-style
378
+
379
+ # Non-interactive with name specified
380
+ par-tts-install-style --name "YourName"
381
+
382
+ # Force overwrite if already installed
383
+ par-tts-install-style --name "YourName" --force
384
+ ```
385
+
386
+ This command will:
387
+ 1. Copy the TTS Summary output style to `~/.claude/output-styles/tts-summary.md`
388
+ 2. Update `~/.claude/settings.json` with the required `Bash(par-tts:*)` permission
389
+ 3. Personalize the output style with your name
390
+
391
+ #### Prerequisites
392
+
393
+ **Important**: Before using this output style, ensure:
394
+
395
+ 1. `par-cli-tts` is installed (see [Installation](#installation))
396
+ 2. The `install-claude-style` command has been run (automatically grants permissions)
397
+
398
+ If you prefer manual installation, you can:
399
+ 1. Copy `.claude/output-styles/tts-summary.md` to `~/.claude/output-styles/`
400
+ 2. Add the following to `~/.claude/settings.json`:
401
+ ```json
402
+ {
403
+ "permissions": {
404
+ "allow": [
405
+ "Bash(par-tts:*)"
406
+ ]
407
+ }
408
+ }
409
+ ```
410
+
411
+ #### Usage
412
+
413
+ Activate the output style using the `/output-style` command in Claude Code:
414
+
415
+ ```
416
+ /output-style tts-summary
417
+ ```
418
+
419
+ Once activated, Claude will automatically announce completed tasks with audio feedback.
420
+
421
+ #### Customization
422
+
423
+ Edit `~/.claude/output-styles/tts-summary.md` to personalize the experience:
424
+
425
+ 1. **Change your name** - Find the `USER_NAME` variable and update it:
426
+ ```markdown
427
+ ## Variables
428
+ - **USER_NAME**: YourNameHere
429
+ ```
430
+
431
+ 2. **Update the heading** - Search for "Paul" and replace with your name:
432
+ ```markdown
433
+ ## Audio Summary for YourNameHere
434
+ ```
435
+
436
+ 3. **Customize the TTS command** - Use a different voice or provider:
437
+ ```markdown
438
+ par-tts "YourNameHere, task completed." --voice nova --provider openai
439
+ ```
440
+
441
+ 4. **Adjust message style** - Modify the Communication Guidelines section to change how Claude speaks to you
442
+
249
443
  ## Configuration
250
444
 
251
445
  ### Configuration File (Recommended)
@@ -404,6 +598,10 @@ par-tts "Stable voice" --stability 0.8 --similarity 0.7
404
598
  # Adjust OpenAI speech speed
405
599
  par-tts "Fast speech" --provider openai --speed 1.5
406
600
 
601
+ # Use OpenAI with voice instructions (gpt-4o-mini-tts only)
602
+ par-tts "Hello there!" --provider openai --instructions "Speak in a cheerful and positive tone"
603
+ par-tts "Good morning" -P openai -i "Speak like a pirate"
604
+
407
605
  # Keep temp files after playback
408
606
  par-tts "Keep this" --keep-temp
409
607
 
@@ -510,6 +708,7 @@ make clear-cache # Clear voice cache including samples
510
708
  |--------|-------|-------------|---------|
511
709
  | `--speed` | `-r` | Speech speed (0.25 to 4.0) | 1.0 |
512
710
  | `--format` | `-f` | Audio format (mp3, opus, aac, flac, wav) | mp3 |
711
+ | `--instructions` | `-i` | Voice instructions for gpt-4o-mini-tts (e.g., "Speak cheerfully") | None |
513
712
 
514
713
  ### Kokoro ONNX Options
515
714
 
@@ -543,7 +742,12 @@ make clear-cache # Clear voice cache including samples
543
742
 
544
743
  ### ElevenLabs
545
744
 
546
- - **Models**: eleven_monolingual_v1, eleven_multilingual_v1, eleven_multilingual_v2
745
+ - **Models**:
746
+ - `eleven_multilingual_v2` (default) - Most lifelike, 29 languages
747
+ - `eleven_v3` - Most expressive, 70+ languages
748
+ - `eleven_flash_v2.5` - Ultra-low latency (~75ms), 32 languages
749
+ - `eleven_turbo_v2.5` - Balanced quality/speed, 32 languages
750
+ - ~~`eleven_monolingual_v1`~~ - Deprecated, will be removed
547
751
  - **Voices**: 25+ voices with different accents and styles
548
752
  - **Features**: Voice cloning, stability control, similarity boost
549
753
  - **Smart Caching**:
@@ -555,15 +759,28 @@ make clear-cache # Clear voice cache including samples
555
759
 
556
760
  ### OpenAI
557
761
 
558
- - **Models**: tts-1 (optimized for speed), tts-1-hd (optimized for quality)
559
- - **Voices**:
762
+ - **Models**:
763
+ - `gpt-4o-mini-tts` (default) - Steerable TTS with instructions
764
+ - `tts-1` - Optimized for speed
765
+ - `tts-1-hd` - Optimized for quality
766
+ - **Voices** (13 total):
560
767
  - alloy - Neutral and balanced
768
+ - ash - Enthusiastic and energetic
769
+ - ballad - Warm and soulful
770
+ - coral - Friendly and approachable
561
771
  - echo - Smooth and articulate
562
772
  - fable - Expressive and animated
563
- - onyx - Deep and authoritative
564
773
  - nova - Warm and friendly (default)
774
+ - onyx - Deep and authoritative
775
+ - sage - Calm and wise
565
776
  - shimmer - Soft and gentle
566
- - **Features**: Speed control (0.25x to 4x), multiple output formats
777
+ - verse - Clear and melodic
778
+ - marin - Gentle and soothing
779
+ - cedar - Rich and resonant
780
+ - **Features**:
781
+ - Speed control (0.25x to 4x)
782
+ - Multiple output formats
783
+ - Voice instructions for gpt-4o-mini-tts (steer emotion, accent, tone)
567
784
  - **Output Formats**: mp3, opus, aac, flac, wav, pcm
568
785
  - **API Key**: Set `OPENAI_API_KEY` in your .env file
569
786
 
@@ -666,6 +883,9 @@ par-cli-tts/
666
883
  ├── docs/
667
884
  │ ├── ARCHITECTURE.md # System architecture documentation
668
885
  │ └── CLAUDE.md # Development guidelines
886
+ ├── .claude/
887
+ │ └── output-styles/
888
+ │ └── tts-summary.md # Claude Code TTS output style
669
889
  ├── .env.example # Example environment file
670
890
  ├── pyproject.toml # Project configuration
671
891
  ├── Makefile # Development commands
@@ -704,6 +924,8 @@ par-cli-tts/
704
924
  - Check system volume settings
705
925
  - Try adjusting `--volume` flag
706
926
  - On Linux, verify audio subsystem (ALSA/PulseAudio) is working
927
+ - On Windows, install ffplay (`choco install ffmpeg`) for best results
928
+ - On Windows without external players, the PowerShell fallback will be used
707
929
 
708
930
  6. **Slow Response Times**
709
931
  - Voice previews are cached after first use