mcpick 0.0.17 → 0.0.19
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/.vscode/settings.json +5 -0
- package/CHANGELOG.md +15 -0
- package/dist/add-B9nVyh8T.js +113 -0
- package/dist/add-json-CXNDl3al.js +58 -0
- package/dist/atomic-write-BqEykHp9.js +26 -0
- package/dist/backup-DSDhHI5f.js +64 -0
- package/dist/cache-D6kd7qE8.js +226 -0
- package/dist/claude-cli-BeA-bmoW.js +394 -0
- package/dist/cli-DNNZjJYL.js +84 -0
- package/dist/clone-DLFLewBY.js +88 -0
- package/dist/config-DijVdEFn.js +176 -0
- package/dist/dev-DRJRNp7y.js +265 -0
- package/dist/disable-BA8tXPJN.js +39 -0
- package/dist/enable-Bdnnn_Cq.js +40 -0
- package/dist/get-BPjMXTMc.js +41 -0
- package/dist/hook-state-Di8lUsPr.js +171 -0
- package/dist/hooks-Bmn7pUZa.js +280 -0
- package/dist/index.js +1230 -303
- package/dist/list-B8YeDWt6.js +64 -0
- package/dist/marketplace-Br89Tg-Z.js +168 -0
- package/dist/output-BchYq0mR.js +15 -0
- package/dist/paths-BPISiJi4.js +124 -0
- package/dist/plugin-cache-Bby9Dxm9.js +405 -0
- package/dist/plugins-DHYJF5CP.js +212 -0
- package/dist/profile-CX97sMGp.js +120 -0
- package/dist/profile-DkY_lBEm.js +70 -0
- package/dist/redact-O35tjnRD.js +26 -0
- package/dist/registry-CfUKT7_C.js +92 -0
- package/dist/reload-CYDhkCVZ.js +31 -0
- package/dist/remove-DIPWYMpk.js +31 -0
- package/dist/reset-project-choices-DRM5KByw.js +28 -0
- package/dist/restore-DdMfUljI.js +84 -0
- package/dist/rolldown-runtime-CiIaOW0V.js +13 -0
- package/dist/settings-DEcWtzLE.js +201 -0
- package/dist/validation-xMlbgGCF.js +44 -0
- package/package.json +20 -19
- package/dist/cli/commands/add-json.js +0 -60
- package/dist/cli/commands/add.js +0 -135
- package/dist/cli/commands/backup.js +0 -83
- package/dist/cli/commands/cache.js +0 -296
- package/dist/cli/commands/dev.js +0 -161
- package/dist/cli/commands/disable.js +0 -36
- package/dist/cli/commands/enable.js +0 -39
- package/dist/cli/commands/get.js +0 -45
- package/dist/cli/commands/hooks.js +0 -314
- package/dist/cli/commands/list.js +0 -63
- package/dist/cli/commands/marketplace.js +0 -211
- package/dist/cli/commands/plugins.js +0 -265
- package/dist/cli/commands/profile.js +0 -134
- package/dist/cli/commands/reload.js +0 -36
- package/dist/cli/commands/remove.js +0 -35
- package/dist/cli/commands/reset-project-choices.js +0 -32
- package/dist/cli/commands/restore.js +0 -105
- package/dist/cli/index.js +0 -28
- package/dist/cli/output.js +0 -21
- package/dist/commands/add-server.js +0 -310
- package/dist/commands/backup.js +0 -60
- package/dist/commands/edit-config.js +0 -109
- package/dist/commands/edit-plugins.js +0 -201
- package/dist/commands/manage-cache.js +0 -155
- package/dist/commands/manage-hooks.js +0 -99
- package/dist/commands/manage-marketplace.js +0 -293
- package/dist/commands/restore.js +0 -118
- package/dist/core/config.js +0 -146
- package/dist/core/dev-override.js +0 -210
- package/dist/core/hook-state.js +0 -220
- package/dist/core/plugin-cache.js +0 -506
- package/dist/core/profile.js +0 -94
- package/dist/core/registry.js +0 -121
- package/dist/core/settings.js +0 -243
- package/dist/core/validation.js +0 -49
- package/dist/types.js +0 -2
- package/dist/utils/atomic-write.js +0 -27
- package/dist/utils/claude-cli.js +0 -483
- package/dist/utils/paths.js +0 -114
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from 'citty';
|
|
2
|
-
import { parse_plugin_key, read_known_marketplaces, } from '../../core/plugin-cache.js';
|
|
3
|
-
import { build_enabled_plugins, get_all_plugins, read_claude_settings, write_claude_settings, } from '../../core/settings.js';
|
|
4
|
-
import { install_plugin_via_cli, uninstall_plugin_via_cli, update_plugin_via_cli, validate_plugin_via_cli, } from '../../utils/claude-cli.js';
|
|
5
|
-
import { error, output } from '../output.js';
|
|
6
|
-
const list = defineCommand({
|
|
7
|
-
meta: {
|
|
8
|
-
name: 'list',
|
|
9
|
-
description: 'List all plugins and their status',
|
|
10
|
-
},
|
|
11
|
-
args: {
|
|
12
|
-
json: {
|
|
13
|
-
type: 'boolean',
|
|
14
|
-
description: 'Output as JSON',
|
|
15
|
-
default: false,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
async run({ args }) {
|
|
19
|
-
const settings = await read_claude_settings();
|
|
20
|
-
const plugins = get_all_plugins(settings);
|
|
21
|
-
if (args.json) {
|
|
22
|
-
output(plugins, true);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
if (plugins.length === 0) {
|
|
26
|
-
console.log('No plugins found.');
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
for (const p of plugins) {
|
|
30
|
-
const status = p.enabled ? 'on' : 'off';
|
|
31
|
-
console.log(`${p.name}@${p.marketplace} ${status}`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
const enable = defineCommand({
|
|
37
|
-
meta: {
|
|
38
|
-
name: 'enable',
|
|
39
|
-
description: 'Enable a plugin',
|
|
40
|
-
},
|
|
41
|
-
args: {
|
|
42
|
-
plugin: {
|
|
43
|
-
type: 'positional',
|
|
44
|
-
description: 'Plugin key (name@marketplace)',
|
|
45
|
-
required: true,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
async run({ args }) {
|
|
49
|
-
const settings = await read_claude_settings();
|
|
50
|
-
const plugins = get_all_plugins(settings);
|
|
51
|
-
const key = args.plugin;
|
|
52
|
-
const plugin = plugins.find((p) => `${p.name}@${p.marketplace}` === key);
|
|
53
|
-
if (!plugin) {
|
|
54
|
-
error(`Plugin '${key}' not found. Run 'mcpick plugins list' to see available plugins.`);
|
|
55
|
-
}
|
|
56
|
-
plugin.enabled = true;
|
|
57
|
-
const updated = build_enabled_plugins(plugins);
|
|
58
|
-
await write_claude_settings({ enabledPlugins: updated });
|
|
59
|
-
console.log(`Enabled plugin '${key}'`);
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
const disable = defineCommand({
|
|
63
|
-
meta: {
|
|
64
|
-
name: 'disable',
|
|
65
|
-
description: 'Disable a plugin',
|
|
66
|
-
},
|
|
67
|
-
args: {
|
|
68
|
-
plugin: {
|
|
69
|
-
type: 'positional',
|
|
70
|
-
description: 'Plugin key (name@marketplace)',
|
|
71
|
-
required: true,
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
async run({ args }) {
|
|
75
|
-
const settings = await read_claude_settings();
|
|
76
|
-
const plugins = get_all_plugins(settings);
|
|
77
|
-
const key = args.plugin;
|
|
78
|
-
const plugin = plugins.find((p) => `${p.name}@${p.marketplace}` === key);
|
|
79
|
-
if (!plugin) {
|
|
80
|
-
error(`Plugin '${key}' not found. Run 'mcpick plugins list' to see available plugins.`);
|
|
81
|
-
}
|
|
82
|
-
plugin.enabled = false;
|
|
83
|
-
const updated = build_enabled_plugins(plugins);
|
|
84
|
-
await write_claude_settings({ enabledPlugins: updated });
|
|
85
|
-
console.log(`Disabled plugin '${key}'`);
|
|
86
|
-
},
|
|
87
|
-
});
|
|
88
|
-
const install = defineCommand({
|
|
89
|
-
meta: {
|
|
90
|
-
name: 'install',
|
|
91
|
-
description: 'Install a plugin from a marketplace',
|
|
92
|
-
},
|
|
93
|
-
args: {
|
|
94
|
-
plugin: {
|
|
95
|
-
type: 'positional',
|
|
96
|
-
description: 'Plugin key (name@marketplace)',
|
|
97
|
-
required: true,
|
|
98
|
-
},
|
|
99
|
-
scope: {
|
|
100
|
-
type: 'string',
|
|
101
|
-
description: 'Installation scope: user, project, or local',
|
|
102
|
-
default: 'user',
|
|
103
|
-
},
|
|
104
|
-
json: {
|
|
105
|
-
type: 'boolean',
|
|
106
|
-
description: 'Output as JSON',
|
|
107
|
-
default: false,
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
async run({ args }) {
|
|
111
|
-
const scope = args.scope;
|
|
112
|
-
const result = await install_plugin_via_cli(args.plugin, scope);
|
|
113
|
-
if (args.json) {
|
|
114
|
-
output(result, true);
|
|
115
|
-
}
|
|
116
|
-
else if (result.success) {
|
|
117
|
-
console.log(`Installed plugin '${args.plugin}' (scope: ${scope})`);
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
error(result.error ?? 'Unknown error');
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
});
|
|
124
|
-
const uninstall = defineCommand({
|
|
125
|
-
meta: {
|
|
126
|
-
name: 'uninstall',
|
|
127
|
-
description: 'Uninstall a plugin',
|
|
128
|
-
},
|
|
129
|
-
args: {
|
|
130
|
-
plugin: {
|
|
131
|
-
type: 'positional',
|
|
132
|
-
description: 'Plugin key (name@marketplace)',
|
|
133
|
-
required: true,
|
|
134
|
-
},
|
|
135
|
-
scope: {
|
|
136
|
-
type: 'string',
|
|
137
|
-
description: 'Uninstall from scope: user, project, or local',
|
|
138
|
-
default: 'user',
|
|
139
|
-
},
|
|
140
|
-
json: {
|
|
141
|
-
type: 'boolean',
|
|
142
|
-
description: 'Output as JSON',
|
|
143
|
-
default: false,
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
async run({ args }) {
|
|
147
|
-
const scope = args.scope;
|
|
148
|
-
// Check if this is a marketplace-managed plugin
|
|
149
|
-
const { marketplace } = parse_plugin_key(args.plugin);
|
|
150
|
-
const known = await read_known_marketplaces();
|
|
151
|
-
if (known[marketplace]) {
|
|
152
|
-
const msg = `'${args.plugin}' is managed by marketplace '${marketplace}'.\n` +
|
|
153
|
-
`To remove the marketplace: mcpick marketplace remove ${marketplace}\n` +
|
|
154
|
-
`Or via Claude CLI: claude plugin marketplace remove ${marketplace}`;
|
|
155
|
-
if (args.json) {
|
|
156
|
-
output({
|
|
157
|
-
success: false,
|
|
158
|
-
error: msg,
|
|
159
|
-
marketplace_managed: true,
|
|
160
|
-
}, true);
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
error(msg);
|
|
164
|
-
}
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
const result = await uninstall_plugin_via_cli(args.plugin, scope);
|
|
168
|
-
if (args.json) {
|
|
169
|
-
output(result, true);
|
|
170
|
-
}
|
|
171
|
-
else if (result.success) {
|
|
172
|
-
console.log(`Uninstalled plugin '${args.plugin}' (scope: ${scope})`);
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
error(result.error ?? 'Unknown error');
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
});
|
|
179
|
-
const update = defineCommand({
|
|
180
|
-
meta: {
|
|
181
|
-
name: 'update',
|
|
182
|
-
description: 'Update a plugin to latest version',
|
|
183
|
-
},
|
|
184
|
-
args: {
|
|
185
|
-
plugin: {
|
|
186
|
-
type: 'positional',
|
|
187
|
-
description: 'Plugin key (name@marketplace)',
|
|
188
|
-
required: true,
|
|
189
|
-
},
|
|
190
|
-
scope: {
|
|
191
|
-
type: 'string',
|
|
192
|
-
description: 'Scope to update: user, project, or local',
|
|
193
|
-
default: 'user',
|
|
194
|
-
},
|
|
195
|
-
json: {
|
|
196
|
-
type: 'boolean',
|
|
197
|
-
description: 'Output as JSON',
|
|
198
|
-
default: false,
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
async run({ args }) {
|
|
202
|
-
const scope = args.scope;
|
|
203
|
-
const result = await update_plugin_via_cli(args.plugin, scope);
|
|
204
|
-
if (args.json) {
|
|
205
|
-
output(result, true);
|
|
206
|
-
}
|
|
207
|
-
else if (result.success) {
|
|
208
|
-
console.log(`Updated plugin '${args.plugin}' (scope: ${scope})`);
|
|
209
|
-
}
|
|
210
|
-
else {
|
|
211
|
-
error(result.error ?? 'Unknown error');
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
});
|
|
215
|
-
const validate = defineCommand({
|
|
216
|
-
meta: {
|
|
217
|
-
name: 'validate',
|
|
218
|
-
description: 'Validate a plugin or marketplace manifest',
|
|
219
|
-
},
|
|
220
|
-
args: {
|
|
221
|
-
path: {
|
|
222
|
-
type: 'positional',
|
|
223
|
-
description: 'Path to plugin or marketplace manifest',
|
|
224
|
-
required: true,
|
|
225
|
-
},
|
|
226
|
-
json: {
|
|
227
|
-
type: 'boolean',
|
|
228
|
-
description: 'Output as JSON',
|
|
229
|
-
default: false,
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
async run({ args }) {
|
|
233
|
-
const result = await validate_plugin_via_cli(args.path);
|
|
234
|
-
if (args.json) {
|
|
235
|
-
output({
|
|
236
|
-
path: args.path,
|
|
237
|
-
valid: result.success,
|
|
238
|
-
output: result.stdout,
|
|
239
|
-
error: result.error,
|
|
240
|
-
}, true);
|
|
241
|
-
}
|
|
242
|
-
else if (result.success) {
|
|
243
|
-
console.log(result.stdout || 'Validation passed.');
|
|
244
|
-
}
|
|
245
|
-
else {
|
|
246
|
-
error(result.error || 'Validation failed');
|
|
247
|
-
}
|
|
248
|
-
},
|
|
249
|
-
});
|
|
250
|
-
export default defineCommand({
|
|
251
|
-
meta: {
|
|
252
|
-
name: 'plugins',
|
|
253
|
-
description: 'Manage Claude Code plugins',
|
|
254
|
-
},
|
|
255
|
-
subCommands: {
|
|
256
|
-
list,
|
|
257
|
-
enable,
|
|
258
|
-
disable,
|
|
259
|
-
install,
|
|
260
|
-
uninstall,
|
|
261
|
-
update,
|
|
262
|
-
validate,
|
|
263
|
-
},
|
|
264
|
-
});
|
|
265
|
-
//# sourceMappingURL=plugins.js.map
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from 'citty';
|
|
2
|
-
import { write_claude_config } from '../../core/config.js';
|
|
3
|
-
import { list_profiles, load_profile, save_profile, } from '../../core/profile.js';
|
|
4
|
-
import { write_claude_settings } from '../../core/settings.js';
|
|
5
|
-
import { error, output } from '../output.js';
|
|
6
|
-
const list = defineCommand({
|
|
7
|
-
meta: {
|
|
8
|
-
name: 'list',
|
|
9
|
-
description: 'List all saved profiles',
|
|
10
|
-
},
|
|
11
|
-
args: {
|
|
12
|
-
json: {
|
|
13
|
-
type: 'boolean',
|
|
14
|
-
description: 'Output as JSON',
|
|
15
|
-
default: false,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
async run({ args }) {
|
|
19
|
-
const profiles = await list_profiles();
|
|
20
|
-
if (args.json) {
|
|
21
|
-
output(profiles, true);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
if (profiles.length === 0) {
|
|
25
|
-
console.log('No profiles found.');
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
for (const p of profiles) {
|
|
29
|
-
const parts = [`${p.serverCount} servers`];
|
|
30
|
-
if (p.pluginCount > 0) {
|
|
31
|
-
parts.push(`${p.pluginCount} plugins`);
|
|
32
|
-
}
|
|
33
|
-
console.log(`${p.name} (${parts.join(', ')})`);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
const load = defineCommand({
|
|
39
|
-
meta: {
|
|
40
|
-
name: 'load',
|
|
41
|
-
description: 'Load and apply a saved profile',
|
|
42
|
-
},
|
|
43
|
-
args: {
|
|
44
|
-
name: {
|
|
45
|
-
type: 'positional',
|
|
46
|
-
description: 'Profile name',
|
|
47
|
-
required: true,
|
|
48
|
-
},
|
|
49
|
-
json: {
|
|
50
|
-
type: 'boolean',
|
|
51
|
-
description: 'Output as JSON',
|
|
52
|
-
default: false,
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
async run({ args }) {
|
|
56
|
-
try {
|
|
57
|
-
const profile = await load_profile(args.name);
|
|
58
|
-
await write_claude_config(profile.config);
|
|
59
|
-
const server_count = Object.keys(profile.config.mcpServers || {}).length;
|
|
60
|
-
let plugin_count = 0;
|
|
61
|
-
if (profile.enabledPlugins) {
|
|
62
|
-
await write_claude_settings({
|
|
63
|
-
enabledPlugins: profile.enabledPlugins,
|
|
64
|
-
});
|
|
65
|
-
plugin_count = Object.keys(profile.enabledPlugins).length;
|
|
66
|
-
}
|
|
67
|
-
if (args.json) {
|
|
68
|
-
output({
|
|
69
|
-
profile: args.name,
|
|
70
|
-
servers: server_count,
|
|
71
|
-
plugins: plugin_count,
|
|
72
|
-
}, true);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
const parts = [`${server_count} servers`];
|
|
76
|
-
if (plugin_count > 0) {
|
|
77
|
-
parts.push(`${plugin_count} plugins`);
|
|
78
|
-
}
|
|
79
|
-
console.log(`Profile '${args.name}' applied (${parts.join(', ')})`);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
catch (err) {
|
|
83
|
-
error(err instanceof Error ? err.message : 'Failed to load profile');
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
const save = defineCommand({
|
|
88
|
-
meta: {
|
|
89
|
-
name: 'save',
|
|
90
|
-
description: 'Save current config as a profile',
|
|
91
|
-
},
|
|
92
|
-
args: {
|
|
93
|
-
name: {
|
|
94
|
-
type: 'positional',
|
|
95
|
-
description: 'Profile name',
|
|
96
|
-
required: true,
|
|
97
|
-
},
|
|
98
|
-
json: {
|
|
99
|
-
type: 'boolean',
|
|
100
|
-
description: 'Output as JSON',
|
|
101
|
-
default: false,
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
async run({ args }) {
|
|
105
|
-
try {
|
|
106
|
-
const counts = await save_profile(args.name);
|
|
107
|
-
if (args.json) {
|
|
108
|
-
output({
|
|
109
|
-
profile: args.name,
|
|
110
|
-
servers: counts.serverCount,
|
|
111
|
-
plugins: counts.pluginCount,
|
|
112
|
-
}, true);
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
const parts = [`${counts.serverCount} servers`];
|
|
116
|
-
if (counts.pluginCount > 0) {
|
|
117
|
-
parts.push(`${counts.pluginCount} plugins`);
|
|
118
|
-
}
|
|
119
|
-
console.log(`Profile '${args.name}' saved (${parts.join(', ')})`);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
catch (err) {
|
|
123
|
-
error(err instanceof Error ? err.message : 'Failed to save profile');
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
});
|
|
127
|
-
export default defineCommand({
|
|
128
|
-
meta: {
|
|
129
|
-
name: 'profile',
|
|
130
|
-
description: 'Manage profiles (MCP servers + plugins)',
|
|
131
|
-
},
|
|
132
|
-
subCommands: { list, load, save },
|
|
133
|
-
});
|
|
134
|
-
//# sourceMappingURL=profile.js.map
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from 'citty';
|
|
2
|
-
import { output } from '../output.js';
|
|
3
|
-
export default defineCommand({
|
|
4
|
-
meta: {
|
|
5
|
-
name: 'reload',
|
|
6
|
-
description: 'Reload plugins in Claude Code',
|
|
7
|
-
},
|
|
8
|
-
args: {
|
|
9
|
-
json: {
|
|
10
|
-
type: 'boolean',
|
|
11
|
-
description: 'Output as JSON',
|
|
12
|
-
default: false,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
async run({ args }) {
|
|
16
|
-
const info = {
|
|
17
|
-
supported: false,
|
|
18
|
-
message: 'Claude Code does not expose a programmatic reload API.',
|
|
19
|
-
instructions: [
|
|
20
|
-
'Run /reload-plugins inside an active Claude Code session',
|
|
21
|
-
'Or restart your Claude Code session to pick up changes',
|
|
22
|
-
],
|
|
23
|
-
};
|
|
24
|
-
if (args.json) {
|
|
25
|
-
output(info, true);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
console.log(info.message);
|
|
29
|
-
console.log('\nTo reload plugins:');
|
|
30
|
-
for (const instruction of info.instructions) {
|
|
31
|
-
console.log(` - ${instruction}`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=reload.js.map
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from 'citty';
|
|
2
|
-
import { get_all_available_servers, read_server_registry, write_server_registry, } from '../../core/registry.js';
|
|
3
|
-
import { remove_mcp_via_cli } from '../../utils/claude-cli.js';
|
|
4
|
-
import { error } from '../output.js';
|
|
5
|
-
export default defineCommand({
|
|
6
|
-
meta: {
|
|
7
|
-
name: 'remove',
|
|
8
|
-
description: 'Remove an MCP server from the registry and disable it',
|
|
9
|
-
},
|
|
10
|
-
args: {
|
|
11
|
-
server: {
|
|
12
|
-
type: 'positional',
|
|
13
|
-
description: 'Server name to remove',
|
|
14
|
-
required: true,
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
async run({ args }) {
|
|
18
|
-
const all_servers = await get_all_available_servers();
|
|
19
|
-
const found = all_servers.find((s) => s.name === args.server);
|
|
20
|
-
if (!found) {
|
|
21
|
-
error(`Server '${args.server}' not found. Run 'mcpick list' to see available servers.`);
|
|
22
|
-
}
|
|
23
|
-
// Remove from registry if present
|
|
24
|
-
const registry = await read_server_registry();
|
|
25
|
-
const index = registry.servers.findIndex((s) => s.name === args.server);
|
|
26
|
-
if (index >= 0) {
|
|
27
|
-
registry.servers.splice(index, 1);
|
|
28
|
-
await write_server_registry(registry);
|
|
29
|
-
}
|
|
30
|
-
// Remove via CLI
|
|
31
|
-
await remove_mcp_via_cli(args.server);
|
|
32
|
-
console.log(`Removed '${args.server}'`);
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=remove.js.map
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from 'citty';
|
|
2
|
-
import { mcp_reset_project_choices_via_cli } from '../../utils/claude-cli.js';
|
|
3
|
-
import { error, output } from '../output.js';
|
|
4
|
-
export default defineCommand({
|
|
5
|
-
meta: {
|
|
6
|
-
name: 'reset-project-choices',
|
|
7
|
-
description: 'Reset all approved and rejected project-scoped MCP servers',
|
|
8
|
-
},
|
|
9
|
-
args: {
|
|
10
|
-
json: {
|
|
11
|
-
type: 'boolean',
|
|
12
|
-
description: 'Output as JSON',
|
|
13
|
-
default: false,
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
async run({ args }) {
|
|
17
|
-
const result = await mcp_reset_project_choices_via_cli();
|
|
18
|
-
if (args.json) {
|
|
19
|
-
output({
|
|
20
|
-
success: result.success,
|
|
21
|
-
error: result.error,
|
|
22
|
-
}, true);
|
|
23
|
-
}
|
|
24
|
-
else if (result.success) {
|
|
25
|
-
console.log('Project MCP server choices have been reset.');
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
error(result.error || 'Unknown error');
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=reset-project-choices.js.map
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from 'citty';
|
|
2
|
-
import { readFile } from 'node:fs/promises';
|
|
3
|
-
import { write_claude_config } from '../../core/config.js';
|
|
4
|
-
import { list_backups, list_plugin_backups, } from '../../core/registry.js';
|
|
5
|
-
import { write_claude_settings } from '../../core/settings.js';
|
|
6
|
-
import { validate_claude_config } from '../../core/validation.js';
|
|
7
|
-
import { error, output } from '../output.js';
|
|
8
|
-
export default defineCommand({
|
|
9
|
-
meta: {
|
|
10
|
-
name: 'restore',
|
|
11
|
-
description: 'Restore config from a backup (latest if no file specified)',
|
|
12
|
-
},
|
|
13
|
-
args: {
|
|
14
|
-
file: {
|
|
15
|
-
type: 'positional',
|
|
16
|
-
description: 'Backup filename or path (optional, defaults to latest)',
|
|
17
|
-
required: false,
|
|
18
|
-
},
|
|
19
|
-
type: {
|
|
20
|
-
type: 'string',
|
|
21
|
-
description: 'What to restore: mcp (default), plugins, or all',
|
|
22
|
-
default: 'mcp',
|
|
23
|
-
},
|
|
24
|
-
json: {
|
|
25
|
-
type: 'boolean',
|
|
26
|
-
description: 'Output as JSON',
|
|
27
|
-
default: false,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
async run({ args }) {
|
|
31
|
-
const restore_type = args.type;
|
|
32
|
-
const results = {};
|
|
33
|
-
if (restore_type === 'mcp' || restore_type === 'all') {
|
|
34
|
-
const backups = await list_backups();
|
|
35
|
-
if (backups.length === 0) {
|
|
36
|
-
if (restore_type === 'mcp') {
|
|
37
|
-
error('No MCP backups found. Run "mcpick backup" first.');
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
let backup_path;
|
|
42
|
-
if (args.file && restore_type === 'mcp') {
|
|
43
|
-
const found = backups.find((b) => b.filename === args.file || b.path === args.file);
|
|
44
|
-
if (!found) {
|
|
45
|
-
error(`Backup '${args.file}' not found. Available: ${backups.map((b) => b.filename).join(', ')}`);
|
|
46
|
-
}
|
|
47
|
-
backup_path = found.path;
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
backup_path = backups[0].path;
|
|
51
|
-
}
|
|
52
|
-
const content = await readFile(backup_path, 'utf-8');
|
|
53
|
-
const parsed = JSON.parse(content);
|
|
54
|
-
const config = validate_claude_config(parsed);
|
|
55
|
-
await write_claude_config(config);
|
|
56
|
-
const server_count = Object.keys(config.mcpServers || {}).length;
|
|
57
|
-
results.mcp = {
|
|
58
|
-
restored: backup_path,
|
|
59
|
-
servers: server_count,
|
|
60
|
-
};
|
|
61
|
-
if (!args.json) {
|
|
62
|
-
console.log(`Restored MCP: ${backup_path} (${server_count} servers)`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
if (restore_type === 'plugins' || restore_type === 'all') {
|
|
67
|
-
const backups = await list_plugin_backups();
|
|
68
|
-
if (backups.length === 0) {
|
|
69
|
-
if (restore_type === 'plugins') {
|
|
70
|
-
error('No plugin backups found. Run "mcpick backup" first.');
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
let backup_path;
|
|
75
|
-
if (args.file && restore_type === 'plugins') {
|
|
76
|
-
const found = backups.find((b) => b.filename === args.file || b.path === args.file);
|
|
77
|
-
if (!found) {
|
|
78
|
-
error(`Backup '${args.file}' not found. Available: ${backups.map((b) => b.filename).join(', ')}`);
|
|
79
|
-
}
|
|
80
|
-
backup_path = found.path;
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
backup_path = backups[0].path;
|
|
84
|
-
}
|
|
85
|
-
const content = await readFile(backup_path, 'utf-8');
|
|
86
|
-
const parsed = JSON.parse(content);
|
|
87
|
-
await write_claude_settings({
|
|
88
|
-
enabledPlugins: parsed.enabledPlugins || {},
|
|
89
|
-
});
|
|
90
|
-
const plugin_count = Object.keys(parsed.enabledPlugins || {}).length;
|
|
91
|
-
results.plugins = {
|
|
92
|
-
restored: backup_path,
|
|
93
|
-
plugins: plugin_count,
|
|
94
|
-
};
|
|
95
|
-
if (!args.json) {
|
|
96
|
-
console.log(`Restored plugins: ${backup_path} (${plugin_count} plugins)`);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if (args.json) {
|
|
101
|
-
output(results, true);
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
});
|
|
105
|
-
//# sourceMappingURL=restore.js.map
|
package/dist/cli/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { defineCommand, runMain } from 'citty';
|
|
2
|
-
const main = defineCommand({
|
|
3
|
-
meta: {
|
|
4
|
-
name: 'mcpick',
|
|
5
|
-
description: 'MCP Server Configuration Manager',
|
|
6
|
-
},
|
|
7
|
-
subCommands: {
|
|
8
|
-
list: () => import('./commands/list.js').then((m) => m.default),
|
|
9
|
-
enable: () => import('./commands/enable.js').then((m) => m.default),
|
|
10
|
-
disable: () => import('./commands/disable.js').then((m) => m.default),
|
|
11
|
-
remove: () => import('./commands/remove.js').then((m) => m.default),
|
|
12
|
-
add: () => import('./commands/add.js').then((m) => m.default),
|
|
13
|
-
'add-json': () => import('./commands/add-json.js').then((m) => m.default),
|
|
14
|
-
get: () => import('./commands/get.js').then((m) => m.default),
|
|
15
|
-
'reset-project-choices': () => import('./commands/reset-project-choices.js').then((m) => m.default),
|
|
16
|
-
backup: () => import('./commands/backup.js').then((m) => m.default),
|
|
17
|
-
restore: () => import('./commands/restore.js').then((m) => m.default),
|
|
18
|
-
profile: () => import('./commands/profile.js').then((m) => m.default),
|
|
19
|
-
plugins: () => import('./commands/plugins.js').then((m) => m.default),
|
|
20
|
-
hooks: () => import('./commands/hooks.js').then((m) => m.default),
|
|
21
|
-
cache: () => import('./commands/cache.js').then((m) => m.default),
|
|
22
|
-
dev: () => import('./commands/dev.js').then((m) => m.default),
|
|
23
|
-
marketplace: () => import('./commands/marketplace.js').then((m) => m.default),
|
|
24
|
-
reload: () => import('./commands/reload.js').then((m) => m.default),
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
export const run = () => runMain(main);
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cli/output.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function output(data, json) {
|
|
2
|
-
if (json) {
|
|
3
|
-
console.log(JSON.stringify(data, null, 2));
|
|
4
|
-
}
|
|
5
|
-
else if (typeof data === 'string') {
|
|
6
|
-
console.log(data);
|
|
7
|
-
}
|
|
8
|
-
else if (Array.isArray(data)) {
|
|
9
|
-
for (const item of data) {
|
|
10
|
-
console.log(item);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
console.log(data);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export function error(message) {
|
|
18
|
-
console.error(`error: ${message}`);
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=output.js.map
|