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.
Files changed (75) hide show
  1. package/.vscode/settings.json +5 -0
  2. package/CHANGELOG.md +15 -0
  3. package/dist/add-B9nVyh8T.js +113 -0
  4. package/dist/add-json-CXNDl3al.js +58 -0
  5. package/dist/atomic-write-BqEykHp9.js +26 -0
  6. package/dist/backup-DSDhHI5f.js +64 -0
  7. package/dist/cache-D6kd7qE8.js +226 -0
  8. package/dist/claude-cli-BeA-bmoW.js +394 -0
  9. package/dist/cli-DNNZjJYL.js +84 -0
  10. package/dist/clone-DLFLewBY.js +88 -0
  11. package/dist/config-DijVdEFn.js +176 -0
  12. package/dist/dev-DRJRNp7y.js +265 -0
  13. package/dist/disable-BA8tXPJN.js +39 -0
  14. package/dist/enable-Bdnnn_Cq.js +40 -0
  15. package/dist/get-BPjMXTMc.js +41 -0
  16. package/dist/hook-state-Di8lUsPr.js +171 -0
  17. package/dist/hooks-Bmn7pUZa.js +280 -0
  18. package/dist/index.js +1230 -303
  19. package/dist/list-B8YeDWt6.js +64 -0
  20. package/dist/marketplace-Br89Tg-Z.js +168 -0
  21. package/dist/output-BchYq0mR.js +15 -0
  22. package/dist/paths-BPISiJi4.js +124 -0
  23. package/dist/plugin-cache-Bby9Dxm9.js +405 -0
  24. package/dist/plugins-DHYJF5CP.js +212 -0
  25. package/dist/profile-CX97sMGp.js +120 -0
  26. package/dist/profile-DkY_lBEm.js +70 -0
  27. package/dist/redact-O35tjnRD.js +26 -0
  28. package/dist/registry-CfUKT7_C.js +92 -0
  29. package/dist/reload-CYDhkCVZ.js +31 -0
  30. package/dist/remove-DIPWYMpk.js +31 -0
  31. package/dist/reset-project-choices-DRM5KByw.js +28 -0
  32. package/dist/restore-DdMfUljI.js +84 -0
  33. package/dist/rolldown-runtime-CiIaOW0V.js +13 -0
  34. package/dist/settings-DEcWtzLE.js +201 -0
  35. package/dist/validation-xMlbgGCF.js +44 -0
  36. package/package.json +20 -19
  37. package/dist/cli/commands/add-json.js +0 -60
  38. package/dist/cli/commands/add.js +0 -135
  39. package/dist/cli/commands/backup.js +0 -83
  40. package/dist/cli/commands/cache.js +0 -296
  41. package/dist/cli/commands/dev.js +0 -161
  42. package/dist/cli/commands/disable.js +0 -36
  43. package/dist/cli/commands/enable.js +0 -39
  44. package/dist/cli/commands/get.js +0 -45
  45. package/dist/cli/commands/hooks.js +0 -314
  46. package/dist/cli/commands/list.js +0 -63
  47. package/dist/cli/commands/marketplace.js +0 -211
  48. package/dist/cli/commands/plugins.js +0 -265
  49. package/dist/cli/commands/profile.js +0 -134
  50. package/dist/cli/commands/reload.js +0 -36
  51. package/dist/cli/commands/remove.js +0 -35
  52. package/dist/cli/commands/reset-project-choices.js +0 -32
  53. package/dist/cli/commands/restore.js +0 -105
  54. package/dist/cli/index.js +0 -28
  55. package/dist/cli/output.js +0 -21
  56. package/dist/commands/add-server.js +0 -310
  57. package/dist/commands/backup.js +0 -60
  58. package/dist/commands/edit-config.js +0 -109
  59. package/dist/commands/edit-plugins.js +0 -201
  60. package/dist/commands/manage-cache.js +0 -155
  61. package/dist/commands/manage-hooks.js +0 -99
  62. package/dist/commands/manage-marketplace.js +0 -293
  63. package/dist/commands/restore.js +0 -118
  64. package/dist/core/config.js +0 -146
  65. package/dist/core/dev-override.js +0 -210
  66. package/dist/core/hook-state.js +0 -220
  67. package/dist/core/plugin-cache.js +0 -506
  68. package/dist/core/profile.js +0 -94
  69. package/dist/core/registry.js +0 -121
  70. package/dist/core/settings.js +0 -243
  71. package/dist/core/validation.js +0 -49
  72. package/dist/types.js +0 -2
  73. package/dist/utils/atomic-write.js +0 -27
  74. package/dist/utils/claude-cli.js +0 -483
  75. package/dist/utils/paths.js +0 -114
@@ -1,296 +0,0 @@
1
- import { defineCommand } from 'citty';
2
- import { clean_orphaned_versions, clear_plugin_caches, get_cached_plugins_info, link_local_plugin, list_linked_plugins, read_installed_plugins, refresh_all_marketplaces, scan_all_cache_keys, unlink_local_plugin, } from '../../core/plugin-cache.js';
3
- import { error, output } from '../output.js';
4
- const status = defineCommand({
5
- meta: {
6
- name: 'status',
7
- description: 'Show cached plugins with staleness info',
8
- },
9
- args: {
10
- json: {
11
- type: 'boolean',
12
- description: 'Output as JSON',
13
- default: false,
14
- },
15
- },
16
- async run({ args }) {
17
- const plugins = await get_cached_plugins_info();
18
- if (args.json) {
19
- output(plugins, true);
20
- return;
21
- }
22
- if (plugins.length === 0) {
23
- console.log('No cached plugins found.');
24
- return;
25
- }
26
- for (const p of plugins) {
27
- const stale_markers = [];
28
- if (p.isVersionStale) {
29
- stale_markers.push(`version: ${p.installedVersion} → ${p.latestVersion}`);
30
- }
31
- if (p.isShaStale) {
32
- stale_markers.push('commits behind');
33
- }
34
- if (p.orphanedVersions.length > 0) {
35
- stale_markers.push(`${p.orphanedVersions.length} orphaned`);
36
- }
37
- const status_str = stale_markers.length > 0
38
- ? ` [stale: ${stale_markers.join(', ')}]`
39
- : ' [up to date]';
40
- console.log(`${p.name}@${p.marketplace} v${p.installedVersion}${status_str}`);
41
- }
42
- },
43
- });
44
- const clear = defineCommand({
45
- meta: {
46
- name: 'clear',
47
- description: 'Clear plugin caches (refreshes marketplace first)',
48
- },
49
- args: {
50
- plugin: {
51
- type: 'positional',
52
- description: 'Plugin key (name@marketplace) — omit for all',
53
- required: false,
54
- },
55
- all: {
56
- type: 'boolean',
57
- description: 'Clear all plugin caches',
58
- default: false,
59
- },
60
- json: {
61
- type: 'boolean',
62
- description: 'Output as JSON',
63
- default: false,
64
- },
65
- },
66
- async run({ args }) {
67
- const installed = await read_installed_plugins();
68
- const installed_keys = Object.keys(installed.plugins);
69
- // When --all, also scan disk for marketplace-sourced caches
70
- // not tracked in installed_plugins.json
71
- const scanned_keys = args.all ? await scan_all_cache_keys() : [];
72
- const all_keys = [
73
- ...new Set([...installed_keys, ...scanned_keys]),
74
- ];
75
- if (all_keys.length === 0) {
76
- if (args.json) {
77
- output({ cleared: [], errors: [] }, true);
78
- }
79
- else {
80
- console.log('No cached plugins to clear.');
81
- }
82
- return;
83
- }
84
- let keys_to_clear;
85
- if (args.plugin) {
86
- if (!installed.plugins[args.plugin] &&
87
- !scanned_keys.includes(args.plugin)) {
88
- error(`Plugin '${args.plugin}' not found in cache. Run 'mcpick cache status' to see cached plugins.`);
89
- }
90
- keys_to_clear = [args.plugin];
91
- }
92
- else if (args.all) {
93
- keys_to_clear = all_keys;
94
- }
95
- else {
96
- error('Specify a plugin key or use --all. Run "mcpick cache status" to see cached plugins.');
97
- }
98
- const result = await clear_plugin_caches(keys_to_clear);
99
- if (args.json) {
100
- output(result, true);
101
- }
102
- else {
103
- for (const key of result.cleared) {
104
- console.log(`Cleared: ${key}`);
105
- }
106
- for (const err of result.errors) {
107
- console.error(`Error: ${err}`);
108
- }
109
- if (result.cleared.length > 0) {
110
- console.log('\nRun /reload-plugins in Claude Code or restart your session.');
111
- }
112
- }
113
- },
114
- });
115
- const clean_orphaned = defineCommand({
116
- meta: {
117
- name: 'clean-orphaned',
118
- description: 'Remove orphaned plugin version directories',
119
- },
120
- args: {
121
- json: {
122
- type: 'boolean',
123
- description: 'Output as JSON',
124
- default: false,
125
- },
126
- },
127
- async run({ args }) {
128
- const result = await clean_orphaned_versions();
129
- if (args.json) {
130
- output(result, true);
131
- }
132
- else if (result.cleaned === 0) {
133
- console.log('No orphaned versions found.');
134
- }
135
- else {
136
- for (const p of result.paths) {
137
- console.log(`Removed: ${p}`);
138
- }
139
- console.log(`\nCleaned ${result.cleaned} orphaned version(s).`);
140
- }
141
- },
142
- });
143
- const refresh = defineCommand({
144
- meta: {
145
- name: 'refresh',
146
- description: 'Refresh all marketplace clones (git pull)',
147
- },
148
- args: {
149
- json: {
150
- type: 'boolean',
151
- description: 'Output as JSON',
152
- default: false,
153
- },
154
- },
155
- async run({ args }) {
156
- const results = await refresh_all_marketplaces();
157
- if (args.json) {
158
- const data = Object.fromEntries(results);
159
- output(data, true);
160
- return;
161
- }
162
- if (results.size === 0) {
163
- console.log('No marketplaces configured.');
164
- return;
165
- }
166
- for (const [name, result] of results) {
167
- if (result.success) {
168
- console.log(`${name} refreshed`);
169
- }
170
- else {
171
- console.error(`${name} failed: ${result.error}`);
172
- }
173
- }
174
- },
175
- });
176
- const link = defineCommand({
177
- meta: {
178
- name: 'link',
179
- description: 'Symlink a local directory into the plugin cache for dev',
180
- },
181
- args: {
182
- path: {
183
- type: 'positional',
184
- description: 'Local path to the plugin/marketplace directory',
185
- required: true,
186
- },
187
- as: {
188
- type: 'string',
189
- description: 'Plugin key (name@marketplace) for the cache entry',
190
- required: true,
191
- },
192
- json: {
193
- type: 'boolean',
194
- description: 'Output as JSON',
195
- default: false,
196
- },
197
- },
198
- async run({ args }) {
199
- if (!args.as) {
200
- error('--as is required. Specify plugin key as name@marketplace.');
201
- }
202
- if (!args.as.includes('@')) {
203
- error('Plugin key must be in name@marketplace format (e.g. my-plugin@my-marketplace)');
204
- }
205
- const result = await link_local_plugin(args.path, args.as);
206
- if (args.json) {
207
- output(result, true);
208
- }
209
- else if (result.success) {
210
- console.log(`Linked: ${result.key}`);
211
- console.log(` ${result.symlinkPath} → ${result.targetPath}`);
212
- console.log('\nRun /reload-plugins in Claude Code or restart your session.');
213
- }
214
- else {
215
- error(result.error || 'Unknown error');
216
- }
217
- },
218
- });
219
- const unlink = defineCommand({
220
- meta: {
221
- name: 'unlink',
222
- description: 'Remove a symlink from the plugin cache',
223
- },
224
- args: {
225
- key: {
226
- type: 'positional',
227
- description: 'Plugin key (name@marketplace)',
228
- required: true,
229
- },
230
- json: {
231
- type: 'boolean',
232
- description: 'Output as JSON',
233
- default: false,
234
- },
235
- },
236
- async run({ args }) {
237
- const result = await unlink_local_plugin(args.key);
238
- if (args.json) {
239
- output(result, true);
240
- }
241
- else if (result.success) {
242
- console.log(`Unlinked: ${args.key}`);
243
- if (result.restored) {
244
- console.log(' Original cache directory restored from backup.');
245
- }
246
- console.log('\nRun /reload-plugins in Claude Code or restart your session.');
247
- }
248
- else {
249
- error(result.error || 'Unknown error');
250
- }
251
- },
252
- });
253
- const links = defineCommand({
254
- meta: {
255
- name: 'links',
256
- description: 'List all symlinked plugin cache entries',
257
- },
258
- args: {
259
- json: {
260
- type: 'boolean',
261
- description: 'Output as JSON',
262
- default: false,
263
- },
264
- },
265
- async run({ args }) {
266
- const linked = await list_linked_plugins();
267
- if (args.json) {
268
- output(linked, true);
269
- return;
270
- }
271
- if (linked.length === 0) {
272
- console.log('No linked plugins.');
273
- return;
274
- }
275
- for (const l of linked) {
276
- console.log(`${l.key}`);
277
- console.log(` ${l.symlinkPath} → ${l.targetPath}`);
278
- }
279
- },
280
- });
281
- export default defineCommand({
282
- meta: {
283
- name: 'cache',
284
- description: 'Manage plugin cache',
285
- },
286
- subCommands: {
287
- status,
288
- clear,
289
- 'clean-orphaned': clean_orphaned,
290
- refresh,
291
- link,
292
- unlink,
293
- links,
294
- },
295
- });
296
- //# sourceMappingURL=cache.js.map
@@ -1,161 +0,0 @@
1
- import { defineCommand } from 'citty';
2
- import { apply_dev_override, list_dev_overrides, restore_all_dev_overrides, restore_dev_override, } from '../../core/dev-override.js';
3
- import { error, output } from '../output.js';
4
- const apply = defineCommand({
5
- meta: {
6
- name: 'apply',
7
- description: 'Override an MCP server with a local dev command',
8
- },
9
- args: {
10
- name: {
11
- type: 'positional',
12
- description: 'Server name to override',
13
- required: true,
14
- },
15
- command: {
16
- type: 'string',
17
- description: 'Local command to run',
18
- required: true,
19
- },
20
- args: {
21
- type: 'string',
22
- description: 'Comma-separated arguments',
23
- },
24
- scope: {
25
- type: 'string',
26
- description: 'Scope to search: local, project, or user (default: auto-detect)',
27
- },
28
- json: {
29
- type: 'boolean',
30
- description: 'Output as JSON',
31
- default: false,
32
- },
33
- },
34
- async run({ args }) {
35
- const scope = args.scope;
36
- if (scope && !['local', 'project', 'user'].includes(scope)) {
37
- error(`Invalid scope: ${scope}. Use local, project, or user.`);
38
- }
39
- const cmd_args = args.args ? args.args.split(',') : [];
40
- const result = await apply_dev_override(args.name, args.command, cmd_args, scope);
41
- if (args.json) {
42
- output(result, true);
43
- }
44
- else if (result.success) {
45
- console.log(`Dev override applied for '${args.name}' (scope: ${result.scope})`);
46
- console.log(` command: ${args.command}${cmd_args.length > 0 ? ` ${cmd_args.join(' ')}` : ''}`);
47
- console.log('\nRestart Claude Code or run /reload-plugins to pick up changes.');
48
- }
49
- else {
50
- error(result.error || 'Unknown error');
51
- }
52
- },
53
- });
54
- const restore = defineCommand({
55
- meta: {
56
- name: 'restore',
57
- description: 'Restore original server config from dev override',
58
- },
59
- args: {
60
- name: {
61
- type: 'positional',
62
- description: 'Server name to restore (omit with --all to restore all)',
63
- required: false,
64
- },
65
- all: {
66
- type: 'boolean',
67
- description: 'Restore all dev overrides',
68
- default: false,
69
- },
70
- json: {
71
- type: 'boolean',
72
- description: 'Output as JSON',
73
- default: false,
74
- },
75
- },
76
- async run({ args }) {
77
- if (args.all) {
78
- const result = await restore_all_dev_overrides();
79
- if (args.json) {
80
- output(result, true);
81
- }
82
- else {
83
- if (result.restored.length === 0 &&
84
- result.errors.length === 0) {
85
- console.log('No dev overrides to restore.');
86
- }
87
- else {
88
- for (const name of result.restored) {
89
- console.log(`Restored: ${name}`);
90
- }
91
- for (const err of result.errors) {
92
- console.error(`Error: ${err}`);
93
- }
94
- }
95
- }
96
- return;
97
- }
98
- if (!args.name) {
99
- error('Specify a server name or use --all. Run "mcpick dev list" to see active overrides.');
100
- }
101
- const result = await restore_dev_override(args.name);
102
- if (args.json) {
103
- output(result, true);
104
- }
105
- else if (result.success) {
106
- console.log(`Restored original config for '${args.name}'`);
107
- console.log('\nRestart Claude Code or run /reload-plugins to pick up changes.');
108
- }
109
- else {
110
- error(result.error || 'Unknown error');
111
- }
112
- },
113
- });
114
- const list = defineCommand({
115
- meta: {
116
- name: 'list',
117
- description: 'List active dev overrides',
118
- },
119
- args: {
120
- json: {
121
- type: 'boolean',
122
- description: 'Output as JSON',
123
- default: false,
124
- },
125
- },
126
- async run({ args }) {
127
- const overrides = await list_dev_overrides();
128
- if (args.json) {
129
- output(overrides, true);
130
- return;
131
- }
132
- if (overrides.length === 0) {
133
- console.log('No active dev overrides.');
134
- return;
135
- }
136
- for (const o of overrides) {
137
- const orig = o.original;
138
- const dev = o.dev;
139
- const original_cmd = orig.command
140
- ? `${orig.command}${orig.args ? ' ' + orig.args.join(' ') : ''}`
141
- : orig.url || '?';
142
- const dev_cmd = `${dev.command}${dev.args ? ' ' + dev.args.join(' ') : ''}`;
143
- console.log(`${o.name} (scope: ${o.scope})`);
144
- console.log(` original: ${original_cmd}`);
145
- console.log(` dev: ${dev_cmd}`);
146
- console.log(` since: ${o.createdAt}`);
147
- }
148
- },
149
- });
150
- export default defineCommand({
151
- meta: {
152
- name: 'dev',
153
- description: 'MCP server local development workflow',
154
- },
155
- subCommands: {
156
- apply,
157
- restore,
158
- list,
159
- },
160
- });
161
- //# sourceMappingURL=dev.js.map
@@ -1,36 +0,0 @@
1
- import { defineCommand } from 'citty';
2
- import { get_all_available_servers } 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: 'disable',
8
- description: 'Disable an MCP server',
9
- },
10
- args: {
11
- server: {
12
- type: 'positional',
13
- description: 'Server name to disable',
14
- required: true,
15
- },
16
- scope: {
17
- type: 'string',
18
- description: 'Scope: local, project, or user (default: local)',
19
- default: 'local',
20
- },
21
- },
22
- async run({ args }) {
23
- const scope = args.scope;
24
- if (!['local', 'project', 'user'].includes(scope)) {
25
- error(`Invalid scope: ${scope}. Use local, project, or user.`);
26
- }
27
- // Sync config→registry before removing so headers/env are preserved
28
- await get_all_available_servers();
29
- const result = await remove_mcp_via_cli(args.server);
30
- if (!result.success) {
31
- error(result.error || 'Failed to disable server');
32
- }
33
- console.log(`Disabled '${args.server}' (scope: ${scope})`);
34
- },
35
- });
36
- //# sourceMappingURL=disable.js.map
@@ -1,39 +0,0 @@
1
- import { defineCommand } from 'citty';
2
- import { get_all_available_servers } from '../../core/registry.js';
3
- import { add_mcp_via_cli } from '../../utils/claude-cli.js';
4
- import { error } from '../output.js';
5
- export default defineCommand({
6
- meta: {
7
- name: 'enable',
8
- description: 'Enable an MCP server',
9
- },
10
- args: {
11
- server: {
12
- type: 'positional',
13
- description: 'Server name to enable',
14
- required: true,
15
- },
16
- scope: {
17
- type: 'string',
18
- description: 'Scope: local, project, or user (default: local)',
19
- default: 'local',
20
- },
21
- },
22
- async run({ args }) {
23
- const scope = args.scope;
24
- if (!['local', 'project', 'user'].includes(scope)) {
25
- error(`Invalid scope: ${scope}. Use local, project, or user.`);
26
- }
27
- const all_servers = await get_all_available_servers();
28
- const server = all_servers.find((s) => s.name === args.server);
29
- if (!server) {
30
- error(`Server '${args.server}' not found in registry. Run 'mcpick list' to see available servers.`);
31
- }
32
- const result = await add_mcp_via_cli(server, scope);
33
- if (!result.success) {
34
- error(result.error || 'Failed to enable server');
35
- }
36
- console.log(`Enabled '${server.name}' (scope: ${scope})`);
37
- },
38
- });
39
- //# sourceMappingURL=enable.js.map
@@ -1,45 +0,0 @@
1
- import { defineCommand } from 'citty';
2
- import { mcp_get_via_cli } from '../../utils/claude-cli.js';
3
- import { error, output } from '../output.js';
4
- export default defineCommand({
5
- meta: {
6
- name: 'get',
7
- description: 'Get details about an MCP server',
8
- },
9
- args: {
10
- name: {
11
- type: 'positional',
12
- description: 'Server name',
13
- required: true,
14
- },
15
- json: {
16
- type: 'boolean',
17
- description: 'Output as JSON',
18
- default: false,
19
- },
20
- },
21
- async run({ args }) {
22
- const result = await mcp_get_via_cli(args.name);
23
- if (args.json) {
24
- try {
25
- const parsed = JSON.parse(result.stdout || '{}');
26
- output(parsed, true);
27
- }
28
- catch {
29
- output({
30
- name: args.name,
31
- success: result.success,
32
- output: result.stdout,
33
- error: result.error,
34
- }, true);
35
- }
36
- }
37
- else if (result.success) {
38
- console.log(result.stdout || 'No details available.');
39
- }
40
- else {
41
- error(result.error || 'Unknown error');
42
- }
43
- },
44
- });
45
- //# sourceMappingURL=get.js.map