handle method

  1. @override
Future<void> handle(
  1. List<String> args
)
override

Called automatically before executing the command. You can override to do pre-validation or setup.

Implementation

@override
Future<void> handle(List<String> args) async {
  logger.info('🚀 Starting Khadem development server...');

  _done ??= Completer<void>();

  await _startServer();

  // Set up file watcher for auto-reload
  if (argResults?['watch'] as bool? ?? true) {
    _setupFileWatcher();
  }

  // Set up keyboard commands
  _setupStdinListener();

  // Keep the command alive
  await _done!.future;
}