import {
  icons,
  theme
} from "../../chunk-kbtqrkwh.js";
import"../../chunk-3sfn889r.js";
import {
  exports_external
} from "../../chunk-c6ge431q.js";
import {
  __require
} from "../../chunk-9wyra8hs.js";

// src/commands/view/spec.ts
var ViewOptionsSchema = exports_external.object({
  projects: exports_external.boolean().default(false),
  name: exports_external.string().optional(),
  sourceScreen: exports_external.string().optional(),
  project: exports_external.string().optional(),
  screen: exports_external.string().optional(),
  serve: exports_external.boolean().default(false)
});

// src/commands/view/command.ts
var command = {
  name: "view",
  description: "Interactively view Stitch resources",
  options: [
    { flags: "--projects", description: "List all projects", defaultValue: false },
    { flags: "--name <name>", description: "Resource name to view" },
    { flags: "--sourceScreen <name>", description: "Source screen resource name" },
    { flags: "--project <id>", description: "Project ID" },
    { flags: "--screen <id>", description: "Screen ID" },
    { flags: "--serve", description: "Serve the screen via local server", defaultValue: false }
  ],
  action: async (_args, options) => {
    try {
      const parsedOptions = ViewOptionsSchema.parse(options);
      const { ViewCommandHandler } = await import("../../chunk-v78rg840.js");
      const handler = new ViewCommandHandler;
      await handler.execute(parsedOptions);
    } catch (error) {
      console.error(theme.red(`
${icons.error} Unexpected error:`), error);
      process.exit(1);
    }
  }
};
export {
  command
};

//# debugId=D4463A0EEB89E41764756E2164756E21
