/**
 * @license
 * Copyright 2025 Vybestack LLC
 * SPDX-License-Identifier: Apache-2.0
 */
import { uninstallExtension } from '../../config/extension.js';
export async function handleUninstall(args) {
    try {
        await uninstallExtension(args.name);
        console.log(`Extension "${args.name}" successfully uninstalled.`);
    }
    catch (error) {
        console.error(error.message);
        process.exit(1);
    }
}
export const uninstallCommand = {
    command: 'uninstall <name>',
    describe: 'Uninstalls an extension.',
    builder: (yargs) => yargs
        .positional('name', {
        describe: 'The name of the extension to uninstall.',
        type: 'string',
    })
        .check((argv) => {
        if (!argv.name) {
            throw new Error('Please include the name of the extension to uninstall as a positional argument.');
        }
        return true;
    }),
    handler: async (argv) => {
        await handleUninstall({
            name: argv['name'],
        });
    },
};
//# sourceMappingURL=uninstall.js.map