1 diff --git a/bin/melos.dart b/bin/melos.dart
2 index 0db7013..218276f 100644
7 import 'package:cli_launcher/cli_launcher.dart';
8 import 'package:melos/src/command_runner.dart';
10 -Future<void> main(List<String> arguments) async => launchExecutable(
13 +Future<void> main(List<String> arguments) async {
14 + final melosYamlPath = findMelosYaml();
16 + if (melosYamlPath == null) {
17 + print('Error: melos.yaml not found in the project.');
18 + // Handle the error as needed
25 + directory: Directory.current,
26 + localInstallation: ExecutableInstallation(
27 name: ExecutableName('melos'),
28 - launchFromSelf: false,
29 - entrypoint: melosEntryPoint,
31 + packageRoot: melosYamlPath,
38 +Directory? findMelosYaml() {
39 + var directory = Directory.current;
40 + while (directory.path != directory.parent.path) {
41 + final melosYamlPath = '${directory.path}/melos.yaml';
42 + if (File(melosYamlPath).existsSync()) {
45 + directory = directory.parent;