claudeup 3.6.3 → 3.6.5
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/package.json +1 -1
- package/src/services/claude-cli.js +16 -5
- package/src/services/claude-cli.ts +15 -5
package/package.json
CHANGED
|
@@ -54,11 +54,18 @@ export async function installPlugin(pluginId, scope = "user") {
|
|
|
54
54
|
await execClaude(["plugin", "install", pluginId, "--scope", scope]);
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
* Uninstall a plugin using claude CLI
|
|
58
|
-
*
|
|
57
|
+
* Uninstall a plugin using claude CLI.
|
|
58
|
+
* Falls back to `disable` if `uninstall` fails (e.g., for plugins
|
|
59
|
+
* installed via old JSON method that the CLI doesn't recognize).
|
|
59
60
|
*/
|
|
60
61
|
export async function uninstallPlugin(pluginId, scope = "user") {
|
|
61
|
-
|
|
62
|
+
try {
|
|
63
|
+
await execClaude(["plugin", "uninstall", pluginId, "--scope", scope]);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
// Fallback: disable works for plugins installed via old JSON method
|
|
67
|
+
await execClaude(["plugin", "disable", pluginId, "--scope", scope]);
|
|
68
|
+
}
|
|
62
69
|
}
|
|
63
70
|
/**
|
|
64
71
|
* Enable a previously disabled plugin
|
|
@@ -73,10 +80,14 @@ export async function disablePlugin(pluginId, scope = "user") {
|
|
|
73
80
|
await execClaude(["plugin", "disable", pluginId, "--scope", scope]);
|
|
74
81
|
}
|
|
75
82
|
/**
|
|
76
|
-
* Update a plugin to the latest version
|
|
83
|
+
* Update a plugin to the latest version.
|
|
84
|
+
* Uses `install` as primary method since `update` only works for plugins
|
|
85
|
+
* originally installed via the CLI. `install` handles both fresh installs
|
|
86
|
+
* and re-installs (upgrades) of existing plugins regardless of how they
|
|
87
|
+
* were originally added.
|
|
77
88
|
*/
|
|
78
89
|
export async function updatePlugin(pluginId, scope = "user") {
|
|
79
|
-
await execClaude(["plugin", "
|
|
90
|
+
await execClaude(["plugin", "install", pluginId, "--scope", scope], 60000);
|
|
80
91
|
}
|
|
81
92
|
/**
|
|
82
93
|
* Add a marketplace by GitHub repo (e.g., "MadAppGang/magus")
|
|
@@ -75,14 +75,20 @@ export async function installPlugin(
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* Uninstall a plugin using claude CLI
|
|
79
|
-
*
|
|
78
|
+
* Uninstall a plugin using claude CLI.
|
|
79
|
+
* Falls back to `disable` if `uninstall` fails (e.g., for plugins
|
|
80
|
+
* installed via old JSON method that the CLI doesn't recognize).
|
|
80
81
|
*/
|
|
81
82
|
export async function uninstallPlugin(
|
|
82
83
|
pluginId: string,
|
|
83
84
|
scope: PluginScope = "user",
|
|
84
85
|
): Promise<void> {
|
|
85
|
-
|
|
86
|
+
try {
|
|
87
|
+
await execClaude(["plugin", "uninstall", pluginId, "--scope", scope]);
|
|
88
|
+
} catch {
|
|
89
|
+
// Fallback: disable works for plugins installed via old JSON method
|
|
90
|
+
await execClaude(["plugin", "disable", pluginId, "--scope", scope]);
|
|
91
|
+
}
|
|
86
92
|
}
|
|
87
93
|
|
|
88
94
|
/**
|
|
@@ -106,13 +112,17 @@ export async function disablePlugin(
|
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
/**
|
|
109
|
-
* Update a plugin to the latest version
|
|
115
|
+
* Update a plugin to the latest version.
|
|
116
|
+
* Uses `install` as primary method since `update` only works for plugins
|
|
117
|
+
* originally installed via the CLI. `install` handles both fresh installs
|
|
118
|
+
* and re-installs (upgrades) of existing plugins regardless of how they
|
|
119
|
+
* were originally added.
|
|
110
120
|
*/
|
|
111
121
|
export async function updatePlugin(
|
|
112
122
|
pluginId: string,
|
|
113
123
|
scope: PluginScope = "user",
|
|
114
124
|
): Promise<void> {
|
|
115
|
-
await execClaude(["plugin", "
|
|
125
|
+
await execClaude(["plugin", "install", pluginId, "--scope", scope], 60000);
|
|
116
126
|
}
|
|
117
127
|
|
|
118
128
|
/**
|