run method

  1. @override
  2. @cliCommand
Future<void> run({
  1. String? source,
  2. String? type,
  3. String? prefix,
  4. int? maxSize,
  5. bool? removeComments,
  6. String? format,
  7. String? profile,
  8. bool yes = false,
  9. bool verbose = false,
})
override

Generate combined output files from source code

Scans the source directory for files, applies ignore patterns, optionally removes comments, and generates chunked output files.

Implementation

@override
@cliCommand
Future<void> run({
  /// Source directory to scan (default: auto-detect)
  String? source,

  /// Project type: auto, dart, python, javascript, typescript, go, rust, java, kotlin, swift, cpp, csharp, ruby, php, web, generic
  String? type,

  /// Output file prefix (default: CLAUDIO)
  String? prefix,

  /// Maximum size per output file in KB (default: 1000)
  int? maxSize,

  /// Remove comments from output (default: true)
  bool? removeComments,

  /// Output format: text, markdown, or json (default: text)
  String? format,

  /// Load settings from a saved profile
  String? profile,

  /// Skip interactive confirmation
  bool yes = false,

  /// Show verbose output
  bool verbose = false,
}) async {
  try {
    // Build configuration
    final config = await _buildConfig(
      source: source,
      type: type,
      prefix: prefix,
      maxSize: maxSize,
      removeComments: removeComments,
      format: format,
      profile: profile,
      verbose: verbose,
    );

    // Interactive confirmation (unless --yes)
    if (!yes) {
      final confirmed = await UserPrompt.confirmConfiguration(config);
      if (!confirmed) {
        warn('Operation cancelled by user');
        return;
      }
    }

    // Run the generation
    await _runGeneration(config);
  } catch (e) {
    error('Generation failed: $e');
    exit(1);
  }
}