import process from 'node:process';
import { d as defineCommand, b as legacyRootDirArgs, a as dotEnvArgs, f as envNameArgs, l as logLevelArgs, c as cwdArgs } from '../shared/nuxi.C0YEEVs2.mjs';
import { b as a } from '../shared/nuxi.DQjfoGl0.mjs';
import { r as resolve } from '../shared/nuxi.Do0aYBCO.mjs';
import 'node:crypto';
import 'node:path';
import 'node:tty';
import 'node:url';
import 'node:util';

const devChild = defineCommand({
  meta: {
    name: "_dev",
    description: "Run Nuxt development server (internal command to start child process)"
  },
  args: {
    ...cwdArgs,
    ...logLevelArgs,
    ...envNameArgs,
    ...dotEnvArgs,
    ...legacyRootDirArgs,
    clear: {
      type: "boolean",
      description: "Clear console on restart",
      negativeDescription: "Disable clear console on restart"
    }
  },
  async run(ctx) {
    if (!process.send && !a) {
      console.warn("`nuxi _dev` is an internal command and should not be used directly. Please use `nuxi dev` instead.");
    }
    const cwd = resolve(ctx.args.cwd || ctx.args.rootDir);
    const { initialize } = await import('../dev/index.mjs');
    await initialize({ cwd, args: ctx.args }, ctx);
  }
});

export { devChild as default };
