vipcare 0.3.19 → 0.3.21

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 (2) hide show
  1. package/bin/vip.js +24 -7
  2. package/package.json +1 -1
package/bin/vip.js CHANGED
@@ -475,7 +475,7 @@ program.command('youtube-search')
475
475
  // --- card ---
476
476
  program.command('card')
477
477
  .description('Generate and serve H5 baseball card page')
478
- .option('-o, --output <path>', 'Output HTML file', 'web/index.html')
478
+ .option('-o, --output <path>', 'Output HTML file', path.join(os.homedir(), '.vip', 'cards', 'index.html'))
479
479
  .option('-p, --port <port>', 'Server port', '3000')
480
480
  .option('-w, --watch', 'Watch profile files and auto-regenerate')
481
481
  .option('--no-serve', 'Only generate, do not start server')
@@ -816,7 +816,7 @@ program.command('reset')
816
816
  }
817
817
 
818
818
  // Delete generated web files
819
- const webDir = path.join(path.dirname(new URL(import.meta.url).pathname), '..', 'web');
819
+ const webDir = path.join(CONFIG_DIR, 'cards');
820
820
  if (fs.existsSync(webDir)) {
821
821
  const webFiles = fs.readdirSync(webDir).filter(f => f.endsWith('.html'));
822
822
  for (const f of webFiles) fs.unlinkSync(path.join(webDir, f));
@@ -884,9 +884,11 @@ program.command('init')
884
884
  try {
885
885
  console.log(c.bold(c.cyan('\nWelcome to VIPCare!\n')));
886
886
 
887
- const defaultDir = path.join(os.homedir(), '.vip', 'profiles');
888
- const profilesAnswer = await rl.question(`Where should profiles be stored?\n (default: ${defaultDir}) > `);
889
- const profilesDir = profilesAnswer.trim() || defaultDir;
887
+ const defaultHome = path.join(os.homedir(), '.vip');
888
+ const homeAnswer = await rl.question(`VIPCare home directory (all data stored here):\n (default: ${defaultHome}) > `);
889
+ const homeDir = (homeAnswer.trim() || defaultHome).replace(/^~/, os.homedir());
890
+
891
+ const profilesDir = path.join(homeDir, 'profiles');
890
892
 
891
893
  console.log(`\n${c.cyan('AI backend preference:')}`);
892
894
  console.log(' 1. Claude CLI (recommended)');
@@ -927,10 +929,25 @@ program.command('init')
927
929
 
928
930
  const deps = [
929
931
  { name: 'bird', label: 'Bird CLI (Twitter data)', install: 'npm install -g @steipete/bird', check: () => checkTool('bird') },
930
- { name: 'ddgs', label: 'DDGS (web search)', install: 'pip3 install ddgs', check: () => checkTool('ddgs') || fs.existsSync(path.join(os.homedir(), 'Library', 'Python', '3.9', 'bin', 'ddgs')) },
932
+ { name: 'ddgs', label: 'DDGS (web search)', install: 'pip3 install ddgs', check: () => {
933
+ if (checkTool('ddgs')) return true;
934
+ // Check common Python bin paths
935
+ const pyDirs = fs.readdirSync(path.join(os.homedir(), 'Library', 'Python')).catch?.(() => []);
936
+ try {
937
+ for (const d of fs.readdirSync(path.join(os.homedir(), 'Library', 'Python'))) {
938
+ if (fs.existsSync(path.join(os.homedir(), 'Library', 'Python', d, 'bin', 'ddgs'))) return true;
939
+ }
940
+ } catch {}
941
+ try { execFileSync('python3', ['-c', 'import ddgs'], { stdio: 'ignore', timeout: 5000 }); return true; } catch {}
942
+ return false;
943
+ }},
931
944
  { name: 'claude', label: 'Claude Code CLI (AI synthesis)', install: 'npm install -g @anthropic-ai/claude-code', check: () => checkTool('claude') },
932
945
  { name: 'yt-dlp', label: 'yt-dlp (YouTube download)', install: 'pip3 install yt-dlp', check: () => checkTool('yt-dlp') },
933
- { name: 'whisper', label: 'Whisper (YouTube transcription)', install: 'pip3 install openai-whisper', check: () => checkTool('whisper') },
946
+ { name: 'whisper', label: 'Whisper (YouTube transcription)', install: 'pip3 install openai-whisper', check: () => {
947
+ if (checkTool('whisper')) return true;
948
+ try { execFileSync('python3', ['-c', 'import whisper'], { stdio: 'ignore', timeout: 5000 }); return true; } catch {}
949
+ return false;
950
+ }},
934
951
  ];
935
952
 
936
953
  const missing = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vipcare",
3
- "version": "0.3.19",
3
+ "version": "0.3.21",
4
4
  "description": "Auto-build VIP person profiles from Twitter/LinkedIn public data",
5
5
  "type": "module",
6
6
  "bin": {