vipcare 0.3.15 → 0.3.17

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 +55 -8
  2. package/package.json +1 -1
package/bin/vip.js CHANGED
@@ -762,6 +762,53 @@ program.command('tags')
762
762
  }
763
763
  });
764
764
 
765
+ // --- reset ---
766
+ program.command('reset')
767
+ .description('Delete all profiles, config, and changelog data')
768
+ .option('-y, --yes', 'Skip confirmation')
769
+ .action(async (opts) => {
770
+ if (!opts.yes) {
771
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
772
+ try {
773
+ const answer = await rl.question(c.red('This will delete ALL profiles, config, and changelog. Are you sure? (type "yes") > '));
774
+ if (answer.trim().toLowerCase() !== 'yes') {
775
+ console.log('Aborted.');
776
+ return;
777
+ }
778
+ } finally { rl.close(); }
779
+ }
780
+
781
+ const { CONFIG_DIR } = await import('../lib/config.js');
782
+ const profilesDir = getProfilesDir();
783
+
784
+ // Delete profiles
785
+ if (fs.existsSync(profilesDir)) {
786
+ const files = fs.readdirSync(profilesDir).filter(f => f.endsWith('.md'));
787
+ for (const f of files) fs.unlinkSync(path.join(profilesDir, f));
788
+ console.log(c.green(` Deleted ${files.length} profile(s)`));
789
+ }
790
+
791
+ // Delete config and changelog
792
+ if (fs.existsSync(CONFIG_DIR)) {
793
+ const configFiles = fs.readdirSync(CONFIG_DIR);
794
+ for (const f of configFiles) {
795
+ const fp = path.join(CONFIG_DIR, f);
796
+ if (fs.statSync(fp).isFile()) fs.unlinkSync(fp);
797
+ }
798
+ console.log(c.green(' Deleted config and changelog'));
799
+ }
800
+
801
+ // Delete generated web files
802
+ const webDir = path.join(path.dirname(new URL(import.meta.url).pathname), '..', 'web');
803
+ if (fs.existsSync(webDir)) {
804
+ const webFiles = fs.readdirSync(webDir).filter(f => f.endsWith('.html'));
805
+ for (const f of webFiles) fs.unlinkSync(path.join(webDir, f));
806
+ if (webFiles.length) console.log(c.green(` Deleted ${webFiles.length} card page(s)`));
807
+ }
808
+
809
+ console.log(c.green('\nAll data cleared. Run "vip init" to start fresh.'));
810
+ });
811
+
765
812
  // --- upgrade ---
766
813
  program.command('upgrade')
767
814
  .description('Update vipcare to the latest version')
@@ -825,22 +872,22 @@ program.command('init')
825
872
  const profilesDir = profilesAnswer.trim() || defaultDir;
826
873
 
827
874
  console.log(`\n${c.cyan('AI backend preference:')}`);
828
- console.log(' 1. Auto-detect (recommended)');
829
- console.log(' 2. Claude CLI');
830
- console.log(' 3. Anthropic API');
831
- console.log(' 4. GitHub Copilot CLI');
832
- const backendAnswer = await rl.question(' > ');
875
+ console.log(' 1. Claude CLI (recommended)');
876
+ console.log(' 2. Anthropic API');
877
+ console.log(' 3. GitHub Copilot CLI');
878
+ console.log(' 4. Auto-detect');
879
+ const backendAnswer = await rl.question(' (default: 1) > ');
833
880
  const backendChoice = backendAnswer.trim() || '1';
834
881
 
835
- const backendMap = { '1': 'auto', '2': 'claude-cli', '3': 'anthropic', '4': 'copilot-cli' };
836
- const aiBackend = backendMap[backendChoice] || 'auto';
882
+ const backendMap = { '1': 'claude-cli', '2': 'anthropic', '3': 'copilot-cli', '4': 'auto' };
883
+ const aiBackend = backendMap[backendChoice] || 'claude-cli';
837
884
 
838
885
  const config = {
839
886
  profiles_dir: profilesDir.replace(/^~/, os.homedir()),
840
887
  ai_backend: aiBackend,
841
888
  };
842
889
 
843
- if (aiBackend === 'anthropic') {
890
+ if (backendChoice === '2' || aiBackend === 'anthropic') {
844
891
  const apiKey = await rl.question('\nAnthropic API key: ');
845
892
  if (apiKey.trim()) {
846
893
  config.anthropic_api_key = apiKey.trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vipcare",
3
- "version": "0.3.15",
3
+ "version": "0.3.17",
4
4
  "description": "Auto-build VIP person profiles from Twitter/LinkedIn public data",
5
5
  "type": "module",
6
6
  "bin": {