voicci 1.0.0

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.
@@ -0,0 +1,69 @@
1
+ name: Publish to npm
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Setup Node.js
17
+ uses: actions/setup-node@v4
18
+ with:
19
+ node-version: '18'
20
+
21
+ - name: Install dependencies
22
+ run: npm ci
23
+
24
+ - name: Run tests
25
+ run: npm test
26
+
27
+ publish:
28
+ needs: test
29
+ runs-on: ubuntu-latest
30
+
31
+ steps:
32
+ - name: Checkout code
33
+ uses: actions/checkout@v4
34
+
35
+ - name: Setup Node.js
36
+ uses: actions/setup-node@v4
37
+ with:
38
+ node-version: '18'
39
+ registry-url: 'https://registry.npmjs.org'
40
+
41
+ - name: Install dependencies
42
+ run: npm ci
43
+
44
+ - name: Publish to npm
45
+ run: npm publish
46
+ env:
47
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
48
+
49
+ - name: Create GitHub Release
50
+ uses: actions/create-release@v1
51
+ env:
52
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53
+ with:
54
+ tag_name: ${{ github.ref }}
55
+ release_name: Release ${{ github.ref }}
56
+ body: |
57
+ ## Installation
58
+ ```bash
59
+ npm install -g voicci
60
+ ```
61
+
62
+ Or via install script:
63
+ ```bash
64
+ curl -fsSL https://voicci.com/voicci-cli/install.sh | bash
65
+ ```
66
+
67
+ See [CHANGELOG.md](https://github.com/voicci/voicci-cli/blob/main/CHANGELOG.md) for details.
68
+ draft: false
69
+ prerelease: false
@@ -0,0 +1,33 @@
1
+ name: Run Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+
13
+ strategy:
14
+ matrix:
15
+ node-version: [18.x, 20.x]
16
+
17
+ steps:
18
+ - name: Checkout code
19
+ uses: actions/checkout@v4
20
+
21
+ - name: Setup Node.js ${{ matrix.node-version }}
22
+ uses: actions/setup-node@v4
23
+ with:
24
+ node-version: ${{ matrix.node-version }}
25
+
26
+ - name: Install dependencies
27
+ run: npm ci
28
+
29
+ - name: Run tests
30
+ run: npm test
31
+
32
+ - name: Check package can be packed
33
+ run: npm pack --dry-run
package/README.md ADDED
@@ -0,0 +1,402 @@
1
+ # 🎧 Voicci CLI - AI Audiobook Generator
2
+
3
+ Command-line tool to transform books, papers, and documents into high-quality audiobooks using XTTS v2 AI.
4
+
5
+ ## Features
6
+
7
+ - **📚 Smart Book Search** - Find and download books by name (no file paths needed)
8
+ - **📝 AI Summarization** - Generate analytical summaries at 2-5% of original length
9
+ - **🎯 Natural Voice** - XTTS v2 generates human-like speech with emotion
10
+ - **📖 PDF & Text Support** - Intelligent text extraction with auto-cleaning
11
+ - **🧹 Smart Cleaning** - Removes page numbers, headers, footers, TOC
12
+ - **📑 Chapter Detection** - Automatically identifies and processes chapters
13
+ - **⚡ Background Processing** - Jobs run independently with persistent queue
14
+ - **📊 Progress Tracking** - Real-time CLI UI shows chapter-by-chapter progress
15
+ - **⚙️ Smart Configuration** - Auto-detects system capabilities and optimizes settings
16
+ - **💾 Memory Management** - Optional monitoring to prevent system instability
17
+ - **🎛️ Quality Presets** - Fast, balanced, or best quality generation
18
+ - **🔄 Concurrent Processing** - Process multiple books simultaneously (based on your system)
19
+ - **🍎 Apple Silicon** - Optimized for Metal acceleration (M1/M2/M3)
20
+ - **🔒 100% Local** - No cloud, no tracking, no data collection
21
+
22
+ ## Installation
23
+
24
+ ### One-Line Install
25
+
26
+ ```bash
27
+ curl -fsSL https://voicci.com/voicci-cli/install.sh | bash
28
+ ```
29
+
30
+ ### Manual Install
31
+
32
+ ```bash
33
+ # Clone or download
34
+ git clone https://github.com/voicci/voicci-cli.git
35
+ cd voicci-cli
36
+
37
+ # Install dependencies
38
+ npm install
39
+ pip3 install TTS torch torchaudio
40
+
41
+ # Install globally
42
+ npm link
43
+
44
+ # Or run directly
45
+ chmod +x cli/index.js
46
+ ./cli/index.js --help
47
+ ```
48
+
49
+ ## Usage
50
+
51
+ ### Convert by Book Name (Recommended)
52
+
53
+ ```bash
54
+ # Just name the book - Voicci finds and downloads it
55
+ voicci "The Great Gatsby"
56
+ voicci "Attention Is All You Need" # Academic papers too!
57
+ voicci "1984 by George Orwell"
58
+ ```
59
+
60
+ ### Convert from File
61
+
62
+ ```bash
63
+ # PDF or TXT file
64
+ voicci mybook.pdf
65
+ voicci story.txt
66
+ ```
67
+
68
+ ### Search Without Downloading
69
+
70
+ ```bash
71
+ # Preview search results before downloading
72
+ voicci --search "The Catcher in the Rye"
73
+ ```
74
+
75
+ ### Generate Summaries
76
+
77
+ ```bash
78
+ # Generate analytical summary only (no audio)
79
+ voicci summary mybook.pdf
80
+ voicci --summary "The Great Gatsby"
81
+
82
+ # Generate both audiobook AND summary
83
+ voicci --with-summary mybook.pdf
84
+ voicci --with-summary "1984"
85
+ ```
86
+
87
+ **Summary Features**:
88
+ - Analytical style with clear, non-specialized vocabulary
89
+ - Retains specificity (key details, names, numbers, facts)
90
+ - Adaptive length: 2-5% of original word count depending on document size
91
+ - Three backends: Ollama (local LLM), Python AI, or extractive fallback
92
+ - Saves summary as text file with statistics
93
+
94
+ ### Monitor Progress
95
+
96
+ ```bash
97
+ # Live progress UI with chapter status
98
+ voicci -s <jobId>
99
+
100
+ # List all jobs
101
+ voicci -s
102
+ ```
103
+
104
+ ### Manage Audiobooks
105
+
106
+ ```bash
107
+ # List completed audiobooks
108
+ voicci -l
109
+
110
+ # Open audiobook folder
111
+ voicci -o <jobId>
112
+
113
+ # Delete audiobook
114
+ voicci -d <jobId>
115
+
116
+ # Cancel running job
117
+ voicci --cancel <jobId>
118
+ ```
119
+
120
+ ### Configuration
121
+
122
+ ```bash
123
+ # View current configuration
124
+ voicci config show
125
+
126
+ # Set memory profile (low, medium, high)
127
+ voicci config set-profile high
128
+
129
+ # Set quality preset (fast, balanced, best)
130
+ voicci config set-quality balanced
131
+
132
+ # Toggle memory monitoring
133
+ voicci config set-monitoring on
134
+
135
+ # View system recommendations
136
+ voicci config recommend
137
+
138
+ # Check memory status
139
+ voicci memory
140
+ ```
141
+
142
+ ## How It Works
143
+
144
+ ### Audiobook Generation
145
+
146
+ 1. **Search & Download** - Finds book from LibGen, Anna's Archive, or other sources
147
+ 2. **Text Extraction** - Extracts clean text from PDF or reads text file
148
+ 3. **Smart Cleaning** - Removes noise (page numbers, headers, footers, TOC)
149
+ 4. **Chapter Detection** - Identifies chapter boundaries automatically
150
+ 5. **Sentence Splitting** - Breaks text into sentences for natural prosody
151
+ 6. **Audio Generation** - XTTS v2 generates high-quality speech
152
+ 7. **Background Processing** - Runs independently with persistent queue
153
+ 8. **Progress Tracking** - Real-time CLI UI shows status
154
+
155
+ ### Summary Generation
156
+
157
+ 1. **Text Extraction** - Same extraction and cleaning as audiobook generation
158
+ 2. **Length Calculation** - Determines target word count (2-5% based on document size)
159
+ 3. **AI Processing** - Uses Ollama (local LLM), Python AI, or extractive summarization
160
+ 4. **Quality Assurance** - Ensures analytical style with clear language
161
+ 5. **Output** - Saves summary as text file with statistics and metadata
162
+
163
+ ## Book Sources
164
+
165
+ Voicci searches multiple sources automatically:
166
+
167
+ 1. **Library Genesis** - Largest collection of academic books
168
+ 2. **Anna's Archive** - Comprehensive shadow library
169
+ 3. **Z-Library** - Alternative source (requires auth)
170
+
171
+ All sources are accessed via scripted HTTP requests (no APIs, no credentials).
172
+
173
+ ## File Locations
174
+
175
+ ### macOS
176
+
177
+ - Audiobooks: `~/Library/Application Support/voicci/audiobooks/`
178
+ - Config: `~/Library/Application Support/voicci/config/`
179
+ - Cache: `~/Library/Caches/voicci/`
180
+ - Logs: `~/Library/Application Support/voicci/logs/`
181
+
182
+ ### Linux
183
+
184
+ - Audiobooks: `~/.local/share/voicci/audiobooks/`
185
+ - Config: `~/.config/voicci/`
186
+ - Cache: `~/.cache/voicci/`
187
+ - Logs: `~/.local/share/voicci/logs/`
188
+
189
+ ## System Requirements
190
+
191
+ Voicci automatically detects your system capabilities and configures itself optimally.
192
+
193
+ ### Minimum (Low Profile)
194
+ - **RAM**: 2GB
195
+ - **Storage**: 1GB free space
196
+ - **CPU**: 2 cores
197
+ - Max file size: 50MB, 1 job at a time
198
+
199
+ ### Recommended (Medium Profile)
200
+ - **RAM**: 4-8GB (auto-detected)
201
+ - **Storage**: 5GB free space
202
+ - **CPU**: 4 cores
203
+ - Max file size: 100MB, 2 jobs simultaneously
204
+
205
+ ### Optimal (High Profile)
206
+ - **RAM**: 8GB+ (auto-detected)
207
+ - **Storage**: 10GB+ free space
208
+ - **CPU**: 8+ cores
209
+ - Max file size: 500MB, 5 jobs simultaneously
210
+
211
+ ### Dependencies
212
+
213
+ - Node.js 18+
214
+ - Python 3.9+
215
+ - pdftotext (from Poppler) - optional for PDF support
216
+
217
+ ## Performance
218
+
219
+ XTTS v2 prioritizes quality over speed:
220
+
221
+ - **Average**: ~150-200 words/minute
222
+ - **Novel** (80k words): 2-4 hours on Apple Silicon
223
+ - **Paper** (10k words): 30-60 minutes
224
+
225
+ Jobs run in the background so you can continue working.
226
+
227
+ ## Configuration System
228
+
229
+ Voicci features a smart configuration system that automatically optimizes settings based on your hardware.
230
+
231
+ ### Memory Profiles
232
+
233
+ | Profile | RAM | Max File | Jobs | Monitoring | Best For |
234
+ |---------|-----|----------|------|------------|----------|
235
+ | **low** | 2-4GB | 50MB | 1 | Enabled | Budget laptops, older machines |
236
+ | **medium** | 4-8GB | 100MB | 2 | Enabled | Typical consumer laptops |
237
+ | **high** | 8GB+ | 500MB | 5 | Disabled | Modern machines, workstations |
238
+
239
+ ```bash
240
+ # View available profiles
241
+ voicci config profiles
242
+
243
+ # Switch profile
244
+ voicci config set-profile medium
245
+ ```
246
+
247
+ ### Quality Presets
248
+
249
+ | Preset | Speed | Quality | Best For |
250
+ |--------|-------|---------|----------|
251
+ | **fast** | Fastest | Good | Testing, drafts |
252
+ | **balanced** | Medium | Very Good | Recommended (default) |
253
+ | **best** | Slower | Excellent | Final audiobooks |
254
+
255
+ ```bash
256
+ # View available presets
257
+ voicci config presets
258
+
259
+ # Switch preset
260
+ voicci config set-quality best
261
+ ```
262
+
263
+ ### Memory Monitoring
264
+
265
+ Optional monitoring that warns when memory usage is high:
266
+
267
+ - **Auto-enabled**: On low/medium profiles (systems with <8GB RAM)
268
+ - **Auto-disabled**: On high profile (systems with 8GB+ RAM)
269
+
270
+ ```bash
271
+ # Enable monitoring
272
+ voicci config set-monitoring on
273
+
274
+ # Disable monitoring
275
+ voicci config set-monitoring off
276
+
277
+ # Check current status
278
+ voicci memory
279
+ ```
280
+
281
+ ### Configuration File
282
+
283
+ Settings are stored in `~/.config/voicci/settings.json` (XDG Base Directory compliant):
284
+
285
+ ```json
286
+ {
287
+ "version": "1.0.0",
288
+ "memoryProfile": "high",
289
+ "qualityPreset": "balanced",
290
+ "autoDetectProfile": true,
291
+ "enableMemoryMonitoring": null,
292
+ "profileManuallySet": false,
293
+ "customSettings": {}
294
+ }
295
+ ```
296
+
297
+ ## Troubleshooting
298
+
299
+ ### Python version error
300
+
301
+ Ensure Python 3.9+ is installed:
302
+
303
+ ```bash
304
+ python3 --version
305
+ ```
306
+
307
+ ### Model download fails
308
+
309
+ Check internet connection during installation. Model (~450MB) is downloaded once.
310
+
311
+ ### PDF not extracting
312
+
313
+ Install poppler-utils for pdftotext:
314
+
315
+ ```bash
316
+ # macOS
317
+ brew install poppler
318
+
319
+ # Linux
320
+ sudo apt-get install poppler-utils
321
+ ```
322
+
323
+ ### Metal not available
324
+
325
+ Requires macOS 12+ on Apple Silicon. Falls back to CPU if unavailable.
326
+
327
+ ### Book search failing
328
+
329
+ Sources may be temporarily unavailable. Try:
330
+
331
+ 1. Different book title or author name
332
+ 2. Using file path directly: `voicci mybook.pdf`
333
+ 3. Checking internet connection
334
+
335
+ ## Development
336
+
337
+ ```bash
338
+ # Run tests
339
+ npm test
340
+
341
+ # Start worker manually
342
+ npm run worker
343
+
344
+ # Test text cleaner
345
+ node tests/test-cleaner.js
346
+
347
+ # Check queue status
348
+ sqlite3 ~/Library/Application\ Support/voicci/queue.db "SELECT * FROM jobs;"
349
+ ```
350
+
351
+ ## Architecture
352
+
353
+ ```
354
+ voicci/
355
+ ├── cli/ # Command-line interface
356
+ │ ├── index.js # Main CLI commands
357
+ │ └── progress-ui.js # React Ink progress UI
358
+ ├── lib/ # Core libraries
359
+ │ ├── config.js # Configuration & paths
360
+ │ ├── config-manager.js # Smart configuration system
361
+ │ ├── text-cleaner.js # PDF/text extraction & cleaning
362
+ │ ├── summarizer.js # AI text summarization
363
+ │ ├── tts-engine.py # XTTS v2 wrapper
364
+ │ ├── queue.js # SQLite job queue
365
+ │ ├── book-finder.js # Multi-source book search
366
+ │ ├── path-validator.js # Security: path validation
367
+ │ └── memory-monitor.js # Optional memory monitoring
368
+ ├── backend/ # Background processing
369
+ │ └── worker.js # Job processor with retry logic
370
+ └── tests/ # Test files
371
+ ├── test-security.js # Security validation
372
+ └── test-cleaner.js # Text cleaning tests
373
+ ```
374
+
375
+ ## Privacy & Security
376
+
377
+ - **100% Local Processing** - No cloud services, no API keys
378
+ - **No Data Collection** - Your files never leave your machine
379
+ - **No Tracking** - No analytics, no telemetry
380
+ - **Open Source** - Fully auditable code
381
+
382
+ ## License
383
+
384
+ MIT License - Free to use, modify, and distribute.
385
+
386
+ ## Credits
387
+
388
+ - **XTTS v2** by Coqui AI
389
+ - **PyTorch** for deep learning framework
390
+ - **Book Sources**: LibGen, Anna's Archive, Z-Library
391
+
392
+ ## Support
393
+
394
+ For issues, questions, or feature requests:
395
+
396
+ - GitHub: https://github.com/voicci/voicci-cli
397
+ - Website: https://voicci.com/voicci-cli
398
+ - Email: support@voicci.com
399
+
400
+ ---
401
+
402
+ Made with ❤️ by [Voicci](https://voicci.com)