feat: add sync, update, and remove commands
- sync: scans plugins and updates registry.json - update: checks and updates plugins to match registry - remove: removes installed plugin with --yes and --remove-deps options - registry.json stored at project root with plugin metadata and _sourcePath
This commit is contained in:
@@ -6,6 +6,9 @@ import { initCommand } from '../src/commands/init.js';
|
||||
import { installCommand } from '../src/commands/install.js';
|
||||
import { listCommand } from '../src/commands/list.js';
|
||||
import { validateCommand } from '../src/commands/validate.js';
|
||||
import { syncCommand } from '../src/commands/sync.js';
|
||||
import { updateCommand } from '../src/commands/update.js';
|
||||
import { removeCommand } from '../src/commands/remove.js';
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const pkg = require('../package.json');
|
||||
@@ -28,6 +31,14 @@ program
|
||||
.option('-g, --global', 'Install to global registry')
|
||||
.action(installCommand);
|
||||
|
||||
program
|
||||
.command('remove <plugin>')
|
||||
.alias('rm')
|
||||
.description('Remove an installed plugin')
|
||||
.option('-y, --yes', 'Skip confirmation prompt')
|
||||
.option('--remove-deps', 'Also remove npm dependencies')
|
||||
.action(removeCommand);
|
||||
|
||||
program
|
||||
.command('list')
|
||||
.alias('ls')
|
||||
@@ -35,6 +46,17 @@ program
|
||||
.option('-a, --all', 'Include disabled plugins')
|
||||
.action(listCommand);
|
||||
|
||||
program
|
||||
.command('sync')
|
||||
.description('Sync registry.json with installed plugins')
|
||||
.action(syncCommand);
|
||||
|
||||
program
|
||||
.command('update [plugin]')
|
||||
.description('Update plugins to match registry versions')
|
||||
.option('-a, --all', 'Update all plugins (default if no name given)')
|
||||
.action(updateCommand);
|
||||
|
||||
program
|
||||
.command('validate [path]')
|
||||
.description('Validate manyplug.json syntax')
|
||||
|
||||
Reference in New Issue
Block a user