voicci 1.0.0 → 1.0.2
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.
- package/cli/index.js +5 -1
- package/package.json +8 -3
- package/scripts/postinstall.js +129 -0
package/cli/index.js
CHANGED
|
@@ -13,6 +13,10 @@ import Queue from '../lib/queue.js';
|
|
|
13
13
|
import pathValidator from '../lib/path-validator.js';
|
|
14
14
|
import { exec, execFile } from 'child_process';
|
|
15
15
|
import { promisify } from 'util';
|
|
16
|
+
import { createRequire } from 'module';
|
|
17
|
+
|
|
18
|
+
const require = createRequire(import.meta.url);
|
|
19
|
+
const pkg = require('../package.json');
|
|
16
20
|
|
|
17
21
|
const execAsync = promisify(exec);
|
|
18
22
|
const execFileAsync = promisify(execFile);
|
|
@@ -22,7 +26,7 @@ const program = new Command();
|
|
|
22
26
|
program
|
|
23
27
|
.name('voicci')
|
|
24
28
|
.description('AI Audiobook Generator using XTTS v2')
|
|
25
|
-
.version(
|
|
29
|
+
.version(pkg.version);
|
|
26
30
|
|
|
27
31
|
program
|
|
28
32
|
.argument('[input]', 'PDF/TXT file or book/paper name to convert')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "voicci",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Voicci CLI - AI Audiobook Generator and Text Summarizer using XTTS v2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "cli/index.js",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"start": "node cli/index.js",
|
|
12
12
|
"worker": "node backend/worker.js",
|
|
13
|
-
"test": "node tests/test-cleaner.js"
|
|
13
|
+
"test": "node tests/test-cleaner.js",
|
|
14
|
+
"postinstall": "node scripts/postinstall.js"
|
|
14
15
|
},
|
|
15
16
|
"keywords": [
|
|
16
17
|
"audiobook",
|
|
@@ -22,7 +23,11 @@
|
|
|
22
23
|
"cli",
|
|
23
24
|
"pdf",
|
|
24
25
|
"epub",
|
|
25
|
-
"summarization"
|
|
26
|
+
"summarization",
|
|
27
|
+
"claude-code",
|
|
28
|
+
"claude-skill",
|
|
29
|
+
"claude",
|
|
30
|
+
"anthropic"
|
|
26
31
|
],
|
|
27
32
|
"author": "Voicci",
|
|
28
33
|
"license": "MIT",
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import os from 'os';
|
|
6
|
+
|
|
7
|
+
const skillContent = `#!/bin/bash
|
|
8
|
+
# Voicci CLI - AI Audiobook Generator
|
|
9
|
+
# Auto-installed via npm package
|
|
10
|
+
|
|
11
|
+
cat << 'PROMPT_EOF'
|
|
12
|
+
<command-name>/voicci</command-name>
|
|
13
|
+
|
|
14
|
+
You are helping the user with the **Voicci CLI** - an AI audiobook generator and text summarizer.
|
|
15
|
+
|
|
16
|
+
## What is Voicci CLI?
|
|
17
|
+
A command-line tool that converts books and PDFs into audiobooks using XTTS v2 AI voice synthesis. It also provides AI text summarization.
|
|
18
|
+
|
|
19
|
+
## Your Task
|
|
20
|
+
Execute voicci CLI commands based on the user's request. The tool is installed locally and runs on this machine.
|
|
21
|
+
|
|
22
|
+
## Common Commands
|
|
23
|
+
|
|
24
|
+
**Search for a book:**
|
|
25
|
+
\`\`\`bash
|
|
26
|
+
voicci "Lord of the Rings"
|
|
27
|
+
voicci "Attention Is All You Need"
|
|
28
|
+
\`\`\`
|
|
29
|
+
|
|
30
|
+
**Convert a file:**
|
|
31
|
+
\`\`\`bash
|
|
32
|
+
voicci mybook.pdf
|
|
33
|
+
voicci document.txt
|
|
34
|
+
\`\`\`
|
|
35
|
+
|
|
36
|
+
**Search only (no download):**
|
|
37
|
+
\`\`\`bash
|
|
38
|
+
voicci --search "The Great Gatsby"
|
|
39
|
+
\`\`\`
|
|
40
|
+
|
|
41
|
+
**Generate summary:**
|
|
42
|
+
\`\`\`bash
|
|
43
|
+
voicci summary mybook.pdf
|
|
44
|
+
voicci --summary "1984"
|
|
45
|
+
\`\`\`
|
|
46
|
+
|
|
47
|
+
**Check status:**
|
|
48
|
+
\`\`\`bash
|
|
49
|
+
voicci -s # All jobs
|
|
50
|
+
voicci -s <jobId> # Specific job
|
|
51
|
+
\`\`\`
|
|
52
|
+
|
|
53
|
+
**List audiobooks:**
|
|
54
|
+
\`\`\`bash
|
|
55
|
+
voicci -l
|
|
56
|
+
\`\`\`
|
|
57
|
+
|
|
58
|
+
**Configuration:**
|
|
59
|
+
\`\`\`bash
|
|
60
|
+
voicci config show
|
|
61
|
+
voicci config set-profile high
|
|
62
|
+
voicci config set-quality best
|
|
63
|
+
voicci memory
|
|
64
|
+
\`\`\`
|
|
65
|
+
|
|
66
|
+
**Help:**
|
|
67
|
+
\`\`\`bash
|
|
68
|
+
voicci --help
|
|
69
|
+
voicci config --help
|
|
70
|
+
\`\`\`
|
|
71
|
+
|
|
72
|
+
## Important Notes
|
|
73
|
+
- Book downloads require copyright compliance (public domain, owned books, academic papers)
|
|
74
|
+
- Processing runs in background - check status with \`voicci -s\`
|
|
75
|
+
- Audiobooks saved to \`~/Library/Application Support/voicci/audiobooks/\` (macOS) or \`~/.local/share/voicci/audiobooks/\` (Linux)
|
|
76
|
+
- Copyright warning will appear before first book search
|
|
77
|
+
|
|
78
|
+
## When User Says
|
|
79
|
+
- "find/search/download [book name]" → Run \`voicci "[book name]"\`
|
|
80
|
+
- "convert [file]" → Run \`voicci [file]\`
|
|
81
|
+
- "summarize [file]" → Run \`voicci summary [file]\`
|
|
82
|
+
- "check status" → Run \`voicci -s\`
|
|
83
|
+
- "list audiobooks" → Run \`voicci -l\`
|
|
84
|
+
|
|
85
|
+
Execute the appropriate command now based on the user's request.
|
|
86
|
+
PROMPT_EOF
|
|
87
|
+
`;
|
|
88
|
+
|
|
89
|
+
try {
|
|
90
|
+
const homeDir = os.homedir();
|
|
91
|
+
const claudeSkillsDir = path.join(homeDir, '.claude', 'skills', 'shorthand');
|
|
92
|
+
|
|
93
|
+
// Check if .claude directory exists
|
|
94
|
+
if (!fs.existsSync(path.join(homeDir, '.claude'))) {
|
|
95
|
+
console.log('⚠️ Claude Code not detected (~/.claude directory not found)');
|
|
96
|
+
console.log(' The voicci CLI tool is installed, but the Claude Code skill was not installed.');
|
|
97
|
+
console.log(' Install Claude Code to use /voicci as a skill.');
|
|
98
|
+
process.exit(0);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Create skills directory if it doesn't exist
|
|
102
|
+
if (!fs.existsSync(claudeSkillsDir)) {
|
|
103
|
+
fs.mkdirSync(claudeSkillsDir, { recursive: true });
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Write skill file
|
|
107
|
+
const skillPath = path.join(claudeSkillsDir, 'voicci.sh');
|
|
108
|
+
fs.writeFileSync(skillPath, skillContent, { mode: 0o755 });
|
|
109
|
+
|
|
110
|
+
console.log('✅ Voicci CLI installed successfully!');
|
|
111
|
+
console.log('');
|
|
112
|
+
console.log('📦 Command-line tool: voicci');
|
|
113
|
+
console.log('🎯 Claude Code skill: /voicci');
|
|
114
|
+
console.log('');
|
|
115
|
+
console.log('Try it:');
|
|
116
|
+
console.log(' $ voicci --help');
|
|
117
|
+
console.log(' $ claude');
|
|
118
|
+
console.log(' ❯ /voicci Lord of the Rings');
|
|
119
|
+
console.log('');
|
|
120
|
+
console.log('Docs: https://voicci.com/voicci-cli');
|
|
121
|
+
|
|
122
|
+
} catch (error) {
|
|
123
|
+
console.error('⚠️ Warning: Could not install Claude Code skill');
|
|
124
|
+
console.error(' Error:', error.message);
|
|
125
|
+
console.log('');
|
|
126
|
+
console.log('✅ Voicci CLI tool installed successfully!');
|
|
127
|
+
console.log(' Run: voicci --help');
|
|
128
|
+
process.exit(0);
|
|
129
|
+
}
|