import { y as resolveStateDir } from "./paths-CQLGtQnw.js";
import { t as loadGlobalRuntimeDotEnvFiles } from "./dotenv-global-Bs-rMaqW.js";
import fs from "node:fs";
import path from "node:path";
//#region src/cli/gateway-dispatch-dotenv.ts
async function loadGatewayDispatchCliDotEnv(opts) {
	const quiet = opts?.quiet ?? true;
	const cwdEnvPath = path.join(process.cwd(), ".env");
	if (fs.existsSync(cwdEnvPath)) {
		const { loadCliDotEnv } = await import("./dotenv-AmXuYgyo.js");
		loadCliDotEnv({ quiet });
		return;
	}
	loadGlobalRuntimeDotEnvFiles({
		quiet,
		stateEnvPath: path.join(resolveStateDir(process.env), ".env")
	});
}
//#endregion
export { loadGatewayDispatchCliDotEnv };
