run method

  1. @override
Future<void> run()
override

Run the command

Implementation

@override
Future<void> run() async {
  if (skillName == null || skillName!.isEmpty) {
    _showUsage();
    return;
  }

  // Find the skill location
  final location = await _findSkillLocation(skillName!);

  if (location == null) {
    stderr.writeln('✗ Skill not found: $skillName');
    stderr.writeln('');
    stderr.writeln('Use "boost skill:list" to see available skills.');
    exit(1);
  }

  // Confirm removal unless force flag is set
  if (!force) {
    print('Removing skill: $skillName');
    print('Location: ${location.path}');
    print('');
    print('This will permanently delete the skill directory.');
    print('Use --force to skip this confirmation.');

    // In a real interactive version, we would ask for confirmation here
    // For now, we'll proceed with a warning
    print('');
    print('To confirm, run with --force flag:');
    print('  boost skill:remove $skillName --force');
    return;
  }

  // Remove the skill
  try {
    await location.delete(recursive: true);
    print('✓ Skill removed: $skillName');
    print('');
    print('Location: ${location.path}');
  } catch (e) {
    stderr.writeln('✗ Failed to remove skill: $e');
    exit(1);
  }
}