claudeup 3.5.0 → 3.6.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.
@@ -11,22 +11,19 @@ import {
11
11
  getAvailablePlugins,
12
12
  refreshAllMarketplaces,
13
13
  clearMarketplaceCache,
14
- saveInstalledPluginVersion,
15
- removeInstalledPluginVersion,
16
14
  getLocalMarketplacesInfo,
17
15
  type PluginInfo,
18
16
  } from "../../services/plugin-manager.js";
19
17
  import {
20
- enablePlugin,
21
- enableGlobalPlugin,
22
- enableLocalPlugin,
23
- saveGlobalInstalledPluginVersion,
24
- removeGlobalInstalledPluginVersion,
25
- saveLocalInstalledPluginVersion,
26
- removeLocalInstalledPluginVersion,
27
18
  setMcpEnvVar,
28
19
  getMcpEnvVars,
29
20
  } from "../../services/claude-settings.js";
21
+ import {
22
+ installPlugin as cliInstallPlugin,
23
+ uninstallPlugin as cliUninstallPlugin,
24
+ updatePlugin as cliUpdatePlugin,
25
+ type PluginScope,
26
+ } from "../../services/claude-cli.js";
30
27
  import {
31
28
  getPluginEnvRequirements,
32
29
  getPluginSourcePath,
@@ -342,10 +339,10 @@ export function PluginsScreen() {
342
339
  await modal.message(
343
340
  "Add Marketplace",
344
341
  "To add a marketplace, run this command in your terminal:\n\n" +
345
- " claude marketplace add owner/repo\n\n" +
342
+ " claude plugin marketplace add owner/repo\n\n" +
346
343
  "Examples:\n" +
347
- " claude marketplace add MadAppGang/magus\n" +
348
- " claude marketplace add anthropics/claude-plugins-official\n\n" +
344
+ " claude plugin marketplace add MadAppGang/magus\n" +
345
+ " claude plugin marketplace add anthropics/claude-plugins-official\n\n" +
349
346
  "Auto-update is enabled by default for new marketplaces.\n\n" +
350
347
  "After adding, refresh claudeup with 'r' to see the new marketplace.",
351
348
  "info",
@@ -500,7 +497,7 @@ export function PluginsScreen() {
500
497
  await modal.message(
501
498
  `Add ${mp.displayName}?`,
502
499
  `To add this marketplace, run in your terminal:\n\n` +
503
- ` claude marketplace add ${mp.source.repo || mp.name}\n\n` +
500
+ ` claude plugin marketplace add ${mp.source.repo || mp.name}\n\n` +
504
501
  `Auto-update is enabled by default.\n\n` +
505
502
  `After adding, refresh claudeup with 'r' to see it.`,
506
503
  "info",
@@ -596,47 +593,17 @@ export function PluginsScreen() {
596
593
  modal.loading(`${actionLabel}...`);
597
594
 
598
595
  try {
596
+ const scope = scopeValue as PluginScope;
599
597
  if (action === "uninstall") {
600
- // Uninstall from this scope
601
- if (scopeValue === "user") {
602
- await enableGlobalPlugin(plugin.id, false);
603
- await removeGlobalInstalledPluginVersion(plugin.id);
604
- } else if (scopeValue === "project") {
605
- await enablePlugin(plugin.id, false, state.projectPath);
606
- await removeInstalledPluginVersion(plugin.id, state.projectPath);
607
- } else {
608
- await enableLocalPlugin(plugin.id, false, state.projectPath);
609
- await removeLocalInstalledPluginVersion(
610
- plugin.id,
611
- state.projectPath,
612
- );
613
- }
598
+ await cliUninstallPlugin(plugin.id, scope);
599
+ } else if (action === "update") {
600
+ await cliUpdatePlugin(plugin.id, scope);
614
601
  } else {
615
- // Install or update (both save the latest version)
616
- if (scopeValue === "user") {
617
- await enableGlobalPlugin(plugin.id, true);
618
- await saveGlobalInstalledPluginVersion(plugin.id, latestVersion);
619
- } else if (scopeValue === "project") {
620
- await enablePlugin(plugin.id, true, state.projectPath);
621
- await saveInstalledPluginVersion(
622
- plugin.id,
623
- latestVersion,
624
- state.projectPath,
625
- );
626
- } else {
627
- await enableLocalPlugin(plugin.id, true, state.projectPath);
628
- await saveLocalInstalledPluginVersion(
629
- plugin.id,
630
- latestVersion,
631
- state.projectPath,
632
- );
633
- }
602
+ await cliInstallPlugin(plugin.id, scope);
634
603
 
635
604
  // On fresh install, prompt for MCP server env vars if needed
636
- if (action === "install") {
637
- modal.hideModal();
638
- await collectPluginEnvVars(plugin.name, plugin.marketplace);
639
- }
605
+ modal.hideModal();
606
+ await collectPluginEnvVars(plugin.name, plugin.marketplace);
640
607
  }
641
608
  if (action !== "install") {
642
609
  modal.hideModal();
@@ -654,20 +621,11 @@ export function PluginsScreen() {
654
621
  if (!item || item.type !== "plugin" || !item.plugin?.hasUpdate) return;
655
622
 
656
623
  const plugin = item.plugin;
657
- const isGlobal = pluginsState.scope === "global";
624
+ const scope: PluginScope = pluginsState.scope === "global" ? "user" : "project";
658
625
 
659
626
  modal.loading(`Updating ${plugin.name}...`);
660
627
  try {
661
- const versionToSave = plugin.version || "0.0.0";
662
- if (isGlobal) {
663
- await saveGlobalInstalledPluginVersion(plugin.id, versionToSave);
664
- } else {
665
- await saveInstalledPluginVersion(
666
- plugin.id,
667
- versionToSave,
668
- state.projectPath,
669
- );
670
- }
628
+ await cliUpdatePlugin(plugin.id, scope);
671
629
  modal.hideModal();
672
630
  fetchData();
673
631
  } catch (error) {
@@ -682,21 +640,12 @@ export function PluginsScreen() {
682
640
  const updatable = pluginsState.plugins.data.filter((p) => p.hasUpdate);
683
641
  if (updatable.length === 0) return;
684
642
 
685
- const isGlobal = pluginsState.scope === "global";
643
+ const scope: PluginScope = pluginsState.scope === "global" ? "user" : "project";
686
644
  modal.loading(`Updating ${updatable.length} plugin(s)...`);
687
645
 
688
646
  try {
689
647
  for (const plugin of updatable) {
690
- const versionToSave = plugin.version || "0.0.0";
691
- if (isGlobal) {
692
- await saveGlobalInstalledPluginVersion(plugin.id, versionToSave);
693
- } else {
694
- await saveInstalledPluginVersion(
695
- plugin.id,
696
- versionToSave,
697
- state.projectPath,
698
- );
699
- }
648
+ await cliUpdatePlugin(plugin.id, scope);
700
649
  }
701
650
  modal.hideModal();
702
651
  fetchData();
@@ -753,43 +702,15 @@ export function PluginsScreen() {
753
702
 
754
703
  try {
755
704
  if (action === "uninstall") {
756
- // Uninstall from this scope
757
- if (scope === "user") {
758
- await enableGlobalPlugin(plugin.id, false);
759
- await removeGlobalInstalledPluginVersion(plugin.id);
760
- } else if (scope === "project") {
761
- await enablePlugin(plugin.id, false, state.projectPath);
762
- await removeInstalledPluginVersion(plugin.id, state.projectPath);
763
- } else {
764
- await enableLocalPlugin(plugin.id, false, state.projectPath);
765
- await removeLocalInstalledPluginVersion(plugin.id, state.projectPath);
766
- }
705
+ await cliUninstallPlugin(plugin.id, scope);
706
+ } else if (action === "update") {
707
+ await cliUpdatePlugin(plugin.id, scope);
767
708
  } else {
768
- // Install or update to this scope (both save the latest version)
769
- if (scope === "user") {
770
- await enableGlobalPlugin(plugin.id, true);
771
- await saveGlobalInstalledPluginVersion(plugin.id, latestVersion);
772
- } else if (scope === "project") {
773
- await enablePlugin(plugin.id, true, state.projectPath);
774
- await saveInstalledPluginVersion(
775
- plugin.id,
776
- latestVersion,
777
- state.projectPath,
778
- );
779
- } else {
780
- await enableLocalPlugin(plugin.id, true, state.projectPath);
781
- await saveLocalInstalledPluginVersion(
782
- plugin.id,
783
- latestVersion,
784
- state.projectPath,
785
- );
786
- }
709
+ await cliInstallPlugin(plugin.id, scope);
787
710
 
788
711
  // On fresh install, prompt for MCP server env vars if needed
789
- if (action === "install") {
790
- modal.hideModal();
791
- await collectPluginEnvVars(plugin.name, plugin.marketplace);
792
- }
712
+ modal.hideModal();
713
+ await collectPluginEnvVars(plugin.name, plugin.marketplace);
793
714
  }
794
715
  if (action !== "install") {
795
716
  modal.hideModal();
@@ -848,17 +769,7 @@ export function PluginsScreen() {
848
769
  modal.loading(`Uninstalling ${plugin.name}...`);
849
770
 
850
771
  try {
851
- if (scopeValue === "user") {
852
- await enableGlobalPlugin(plugin.id, false);
853
- await removeGlobalInstalledPluginVersion(plugin.id);
854
- } else if (scopeValue === "project") {
855
- await enablePlugin(plugin.id, false, state.projectPath);
856
- await removeInstalledPluginVersion(plugin.id, state.projectPath);
857
- } else {
858
- // local scope
859
- await enableLocalPlugin(plugin.id, false, state.projectPath);
860
- await removeLocalInstalledPluginVersion(plugin.id, state.projectPath);
861
- }
772
+ await cliUninstallPlugin(plugin.id, scopeValue as PluginScope);
862
773
  modal.hideModal();
863
774
  fetchData();
864
775
  } catch (error) {