UNPKG

@jalasem/dss

Version:

Dev Spaces Switcher (DSS) - Seamlessly manage isolated development environments with separate SSH keys and Git configurations. Enhanced UI with beautiful tables and improved documentation.

75 lines (74 loc) • 3.59 kB
#!/usr/bin/env node "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const commander_1 = require("commander"); const SpaceManager_1 = require("./utils/SpaceManager"); const completion_1 = require("./utils/completion"); const batchOperations_1 = require("./utils/batchOperations"); const ui_1 = require("./utils/ui"); commander_1.program .name("dss") .description(ui_1.UIHelper.highlight("Dev Spaces Switcher (DSS)") + ": Manage your development spaces easily.") .version(require('../package.json').version, '-v, --version', 'output the current version'); commander_1.program.command("add").description("Add a new space").action(SpaceManager_1.addSpace); commander_1.program.command("list").description("List all spaces").action(SpaceManager_1.listSpaces); commander_1.program .command("inspect [spaceName]") .description("Show detailed information about a space") .action(SpaceManager_1.inspectSpace); commander_1.program .command("onboard") .description("Interactive onboarding for new users") .action(SpaceManager_1.onboardUser); commander_1.program .command("completion [shell]") .description("Generate shell completion script (bash, zsh, fish)") .action(completion_1.generateCompletionScript); commander_1.program .command("switch [spaceName]") .description("Switch to a specified space") .option('--dry-run', 'Preview changes without applying them') .action(SpaceManager_1.switchSpace); commander_1.program .command("remove [spaceName]") .description("Remove a specified space") .option('--dry-run', 'Preview what would be removed without actually removing it') .action(SpaceManager_1.removeSpace); commander_1.program .command("edit [spaceName]") .description("Modify an existing space") .action(SpaceManager_1.modifySpace); commander_1.program .command("test") .description("Test the current space's access to GitHub") .action(SpaceManager_1.testSpace); // Batch operations commander_1.program .command("batch") .description("Batch operations for multiple spaces") .action(batchOperations_1.batchSwitchSpaces); commander_1.program .command("export") .description("Export space configuration") .action(batchOperations_1.exportSpaceConfiguration); commander_1.program .command("import") .description("Import space configuration") .action(batchOperations_1.importSpaceConfiguration); commander_1.program .command("bulk") .description("Bulk update operations for multiple spaces") .option('--dry-run', 'Preview changes without applying them') .action(batchOperations_1.bulkUpdateSpaces); commander_1.program.parse(process.argv); // Show help if no command provided if (!process.argv.slice(2).length) { commander_1.program.outputHelp(); console.log(ui_1.UIHelper.dim('\nšŸ’” Getting Started:')); console.log(ui_1.UIHelper.dim(' • ' + ui_1.UIHelper.command('dss onboard') + ' - Interactive setup guide for new users')); console.log(ui_1.UIHelper.dim(' • ' + ui_1.UIHelper.command('dss add') + ' - Create your first development space')); console.log(ui_1.UIHelper.dim(' • ' + ui_1.UIHelper.command('dss list') + ' - View all your spaces')); console.log(ui_1.UIHelper.dim(' • ' + ui_1.UIHelper.command('dss switch') + ' - Switch between spaces')); console.log(ui_1.UIHelper.dim(' • ' + ui_1.UIHelper.command('dss test') + ' - Test GitHub access')); console.log(ui_1.UIHelper.dim('\nšŸ“– For detailed help: ' + ui_1.UIHelper.command('dss <command> --help'))); }