#!/usr/bin/env node
import { version } from "../../package.js";
import "./cli-log-level-preset.js";
import { formatRootHelp } from "./command-manifest.js";
//#region src/cli/bin.ts
function printRootHelp() {
	console.log(formatRootHelp());
}
const rootArgs = process.argv.slice(2).filter((arg) => arg !== "--");
if (rootArgs.length === 1 && (rootArgs[0] === "--version" || rootArgs[0] === "-V")) {
	console.log(version);
	process.exit(0);
}
if (rootArgs.length === 1 && (rootArgs[0] === "--help" || rootArgs[0] === "-h" || rootArgs[0] === "help")) {
	printRootHelp();
	process.exit(0);
}
const filteredArgv = process.argv.filter((arg, index) => {
	if (arg !== "--") return true;
	return index < 2;
});
const { tryRunGatewayRunFastPath } = await import("./gateway-run-fast-path.js");
if (await tryRunGatewayRunFastPath(filteredArgv)) process.exit(typeof process.exitCode === "number" ? process.exitCode : 0);
const { runCli } = await import("./index.js");
await runCli(process.argv);
//#endregion
export {};

//# sourceMappingURL=bin.js.map