/** * Workspace Command Module * Workspace and project management for Gemini Flow */ import { Command } from "commander"; import chalk from "chalk"; import ora from "ora"; import inquirer from "inquirer"; import { Logger } from "../../utils/logger.js"; import { ConfigManager } from "../config/config-manager.js"; export interface WorkspaceInfo { id: string; name: string; path: string; type: "project" | "template" | "experiment"; status: "active" | "inactive" | "archived"; description?: string; tags: string[]; createdAt: Date; lastModified: Date; settings: Record; } export class WorkspaceCommand extends Command { private logger: Logger; private configManager: ConfigManager; private readonly workspaceTypes: Record< string, { description: string; template: string } > = { project: { description: "Standard development project", template: "standard", }, template: { description: "Reusable project template", template: "template", }, experiment: { description: "Experimental or research project", template: "experiment", }, api: { description: "API development project", template: "api" }, frontend: { description: "Frontend application", template: "frontend" }, fullstack: { description: "Full-stack application", template: "fullstack" }, microservice: { description: "Microservice project", template: "microservice", }, ml: { description: "Machine learning project", template: "ml" }, }; constructor(configManager: ConfigManager) { super("workspace"); this.configManager = configManager; this.logger = new Logger("WorkspaceCommand"); this.description("Manage workspaces and projects") .addCommand(this.createInitCommand()) .addCommand(this.createListCommand()) .addCommand(this.createSwitchCommand()) .addCommand(this.createInfoCommand()) .addCommand(this.createDeleteCommand()) .addCommand(this.createArchiveCommand()) .addCommand(this.createCloneCommand()) .addCommand(this.createTemplateCommand()) .addCommand(this.createSettingsCommand()); } private createInitCommand(): Command { const init = new Command("init"); init .description("Initialize new workspace") .argument("[name]", "Workspace name") .option( "-t, --type ", "Workspace type (project|template|experiment|api|frontend|fullstack|microservice|ml)", ) .option("-p, --path ", "Workspace path") .option("--template