startSync method

void startSync()

Direct sync mode

Implementation

void startSync() {
  print('🚀 Starting Model Sync...');

  stdout.write('Enter JSON file path (default: response.json): ');
  String? jsonPath = stdin.readLineSync()?.trim();
  if (jsonPath == null || jsonPath.isEmpty) jsonPath = 'response.json';

  if (!File(jsonPath).existsSync()) {
    print('Error: $jsonPath not found.');
    return;
  }

  dynamic json;
  try {
    _progress.start('Reading $jsonPath...');
    json = JsonParser.parseFile(jsonPath);
    _progress.success('$jsonPath loaded');
  } catch (e) {
    _progress.error('Error parsing $jsonPath: $e');
    return;
  }

  _handleSync(json);
}