voicci 1.0.3 → 1.0.6

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.
@@ -111,8 +111,6 @@ class BookFinder {
111
111
  });
112
112
  }
113
113
 
114
- this.ensureDownloadDir();
115
- }
116
114
 
117
115
  ensureDownloadDir() {
118
116
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "voicci",
3
- "version": "1.0.3",
3
+ "version": "1.0.6",
4
4
  "description": "AI-Powered Audiobook Generator for Claude Code, OpenCode & AI Code Editors. Convert books and PDFs to audiobooks using natural language.",
5
5
  "type": "module",
6
6
  "main": "cli/index.js",
@@ -3,31 +3,32 @@
3
3
  import fs from 'fs';
4
4
  import path from 'path';
5
5
  import os from 'os';
6
+ import { fileURLToPath } from 'url';
6
7
 
7
- const skillContent = `#!/bin/bash
8
- # Voicci CLI - AI Audiobook Generator
9
- # Auto-installed via npm package
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
10
 
11
- cat << 'PROMPT_EOF'
12
- <command-name>/voicci</command-name>
11
+ const SKILL_CONTENT = `---
12
+ description: "Voicci CLI - AI audiobook generator"
13
+ argument-hint: "COMMAND_OR_FILE"
14
+ ---
13
15
 
14
- You are helping the user with the **Voicci CLI** - an AI audiobook generator and text summarizer.
16
+ # Voicci CLI - AI Audiobook Generator
15
17
 
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
+ Convert books, PDFs, and documents to audiobooks using AI-powered text-to-speech (XTTS v2).
18
19
 
19
- ## Your Task
20
- Execute voicci CLI commands based on the user's request. The tool is installed locally and runs on this machine.
20
+ ## What is Voicci?
21
+ A command-line tool that converts books and PDFs into natural-sounding audiobooks. Also provides AI text summarization.
21
22
 
22
23
  ## Common Commands
23
24
 
24
- **Search for a book:**
25
+ **Search and convert a book:**
25
26
  \`\`\`bash
26
27
  voicci "Lord of the Rings"
27
28
  voicci "Attention Is All You Need"
28
29
  \`\`\`
29
30
 
30
- **Convert a file:**
31
+ **Convert a local file:**
31
32
  \`\`\`bash
32
33
  voicci mybook.pdf
33
34
  voicci document.txt
@@ -38,13 +39,14 @@ voicci document.txt
38
39
  voicci --search "The Great Gatsby"
39
40
  \`\`\`
40
41
 
41
- **Generate summary:**
42
+ **Generate text summary:**
42
43
  \`\`\`bash
43
44
  voicci summary mybook.pdf
44
45
  voicci --summary "1984"
46
+ voicci --with-summary "book.pdf" # Generate both audiobook + summary
45
47
  \`\`\`
46
48
 
47
- **Check status:**
49
+ **Check job status:**
48
50
  \`\`\`bash
49
51
  voicci -s # All jobs
50
52
  voicci -s <jobId> # Specific job
@@ -55,6 +57,13 @@ voicci -s <jobId> # Specific job
55
57
  voicci -l
56
58
  \`\`\`
57
59
 
60
+ **Manage jobs:**
61
+ \`\`\`bash
62
+ voicci --cancel <jobId> # Cancel running job
63
+ voicci --delete <jobId> # Delete audiobook
64
+ voicci --open <jobId> # Open audiobook folder
65
+ \`\`\`
66
+
58
67
  **Configuration:**
59
68
  \`\`\`bash
60
69
  voicci config show
@@ -63,67 +72,56 @@ voicci config set-quality best
63
72
  voicci memory
64
73
  \`\`\`
65
74
 
66
- **Help:**
67
- \`\`\`bash
68
- voicci --help
69
- voicci config --help
75
+ \`\`\`!
76
+ #!/bin/bash
77
+ # Execute voicci with user-provided arguments
78
+ voicci \$ARGUMENTS
70
79
  \`\`\`
71
80
 
72
81
  ## Important Notes
73
82
  - Book downloads require copyright compliance (public domain, owned books, academic papers)
74
83
  - 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)
84
+ - Audiobooks saved to:
85
+ - macOS: \`~/Library/Application Support/voicci/audiobooks/\`
86
+ - Linux: \`~/.local/share/voicci/audiobooks/\`
76
87
  - Copyright warning will appear before first book search
77
88
 
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
89
+ ## Usage Examples
90
+ - \`/voicci-cli Lord of the Rings\` - Search and convert book
91
+ - \`/voicci-cli ~/Documents/book.pdf\` - Convert local file
92
+ - \`/voicci-cli -s\` - Check all job statuses
93
+ - \`/voicci-cli summary book.pdf\` - Generate summary only
94
+ - \`/voicci-cli --help\` - Show all options
87
95
  `;
88
96
 
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 });
97
+ function installSkill() {
98
+ try {
99
+ const homeDir = os.homedir();
100
+ const skillsDir = path.join(homeDir, '.claude', 'skills');
101
+ const skillFile = path.join(skillsDir, 'voicci-cli.md');
102
+
103
+ // Create .claude/skills directory if it doesn't exist
104
+ if (!fs.existsSync(skillsDir)) {
105
+ fs.mkdirSync(skillsDir, { recursive: true });
106
+ }
107
+
108
+ // Write the skill file
109
+ fs.writeFileSync(skillFile, SKILL_CONTENT, 'utf8');
110
+
111
+ console.log('✅ Voicci CLI installed successfully!');
112
+ console.log('');
113
+ console.log('📦 Command-line tool: voicci');
114
+ console.log('🔧 Claude Code skill: /voicci-cli');
115
+ console.log('');
116
+ console.log('To use in Claude Code:');
117
+ console.log(' 1. Restart your Claude Code session');
118
+ console.log(' 2. Use: /voicci-cli "search query" or /voicci-cli mybook.pdf');
119
+ console.log('');
120
+ console.log('Or use directly: voicci "your search query"');
121
+ } catch (error) {
122
+ console.error('⚠️ Failed to install Claude Code skill:', error.message);
123
+ console.log('You can still use: voicci <command>');
104
124
  }
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
125
  }
126
+
127
+ installSkill();