#!/usr/bin/env php
<?php

// Dynamically locate the autoloader
$autoloadPaths = [
    __DIR__ . '/../vendor/autoload.php',          // When running directly from the library
    __DIR__ . '/../../../autoload.php',           // When installed via Composer in a project
];

$autoloadFound = false;

foreach ($autoloadPaths as $autoloadPath) {
    if (file_exists($autoloadPath)) {
        require $autoloadPath;
        $autoloadFound = true;
        break;
    }
}

if (!$autoloadFound) {
    fwrite(STDERR, "Autoload file not found. Ensure dependencies are installed using Composer.\n");
    exit(1);
}

use Symfony\Component\Console\Application;
use Fabric\Command\CreateProjectCommand;

$application = new Application();
$application->add(new CreateProjectCommand());
$application->run();

