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

// src/commands/snapshot/spec.ts
var SnapshotInputSchema = exports_external.object({
  command: exports_external.string().optional(),
  data: exports_external.string().optional(),
  schema: exports_external.boolean().default(false)
});
var SnapshotResultSchema = exports_external.object({
  success: exports_external.boolean(),
  error: exports_external.object({
    message: exports_external.string()
  }).optional()
});

// src/commands/snapshot/command.ts
var command = {
  name: "snapshot",
  description: "Create a UI snapshot given a data state",
  options: [
    { flags: "-c, --command <command>", description: "The command to snapshot (e.g. init)" },
    { flags: "-d, --data <file>", description: "Path to JSON data file" },
    { flags: "-s, --schema", description: "Print the data schema for the command", defaultValue: false }
  ],
  action: async (_args, options) => {
    try {
      const parsedOptions = SnapshotInputSchema.parse(options);
      const { SnapshotHandler } = await import("../../chunk-8rt3pp6g.js");
      const handler = new SnapshotHandler;
      const result = await handler.execute({
        command: parsedOptions.command,
        data: parsedOptions.data,
        schema: parsedOptions.schema
      });
      if (!result.success) {
        console.error(theme.red(`Error: ${result.error?.message || "Snapshot failed"}`));
        process.exit(1);
      }
      process.exit(0);
    } catch (error) {
      console.error(theme.red("Unexpected error:"), error);
      process.exit(1);
    }
  }
};
export {
  command
};

//# debugId=E4F30033EED27EDA64756E2164756E21
