Repository: medusajs/medusa
File: packages/cli/medusa-cli/src/create-cli.ts (TypeScript)

Code before:
            type: "string",
            default: "0",
            describe:
              "Number of server processes in cluster mode or a percentage of cluster size (e.g., 25%).",
          }),
      handler: handlerP(
        getCommandHandler(`start`, (args, cmd) => {
          process.env.NODE_ENV = process.env.NODE_ENV || `production`
          cmd(args)
          // Return an empty promise to prevent handlerP from exiting early.
          // The development server shouldn't ever exit until the user directly
          // kills it so this is fine.
          return new Promise((resolve) => {})
        })
      ),
    })
    .command({
      command: "build",
      desc: "Build your project.",
      builder: (_) =>
        _.option("admin-only", {
          default: false,
          type: "boolean",
          describe:
            "Only build the admin to serve it separately (outDir .medusa/admin)",
        }).option("types", {
          type: "boolean",
          default: true,
          describe:
            "Generate automated types for modules inside the .medusa directory",
        }),
      handler: handlerP(
        getCommandHandler(`build`, (args, cmd) => {
          process.env.NODE_ENV = process.env.NODE_ENV || `development`
          cmd(args)

          return new Promise((resolve) => {})
        })
      ),
    })
    .command({
      command: `user`,
      desc: `Create a user`,
      builder: (_) =>
        _.option(`e`, {
          alias: `email`,
          type: `string`,
          describe: `User's email.`,
        })
          .option(`p`, {
            alias: `password`,

Review comment (refactor):
Q: is there a use case where you don't want to generate types? If not I think we should remove this.

Code after:
            type: "string",
            default: "0",
            describe:
              "Number of server processes in cluster mode or a percentage of cluster size (e.g., 25%).",
          }),
      handler: handlerP(
        getCommandHandler(`start`, (args, cmd) => {
          process.env.NODE_ENV = process.env.NODE_ENV || `production`
          cmd(args)
          // Return an empty promise to prevent handlerP from exiting early.
          // The development server shouldn't ever exit until the user directly
          // kills it so this is fine.
          return new Promise((resolve) => {})
        })
      ),
    })
    .command({
      command: "build",
      desc: "Build your project.",
      builder: (_) =>
        _.option("admin-only", {
          default: false,
          type: "boolean",
          describe:
            "Only build the admin to serve it separately (outDir .medusa/admin)",
        }),
      handler: handlerP(
        getCommandHandler(`build`, (args, cmd) => {
          process.env.NODE_ENV = process.env.NODE_ENV || `development`
          cmd(args)

          return new Promise((resolve) => {})
        })
      ),
    })
    .command({
      command: `user`,
      desc: `Create a user`,
      builder: (_) =>
        _.option(`e`, {
          alias: `email`,
          type: `string`,
          describe: `User's email.`,
        })
          .option(`p`, {
            alias: `password`,
            type: `string`,
            describe: `User's password.`,
          })
          .option(`i`, {
            alias: `id`,