#!/usr/bin/env node
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
const dotenv_1 = __importDefault(require("dotenv"));
const shell_1 = require("./shell");
const terminal_1 = require("./terminal");
dotenv_1.default.config();
process.env.LOG_LEVEL = (_a = process.env.LOG_LEVEL) !== null && _a !== void 0 ? _a : "error";
async function run() {
    if (process.argv.includes("--help") || process.argv.includes("-h")) {
        (0, terminal_1.printBanner)();
        (0, terminal_1.printShellHelp)();
        return;
    }
    await (0, shell_1.runInteractiveShell)();
}
run().catch((error) => {
    const message = error instanceof Error ? error.message : String(error);
    console.error((0, terminal_1.colorize)(`Fatal error: ${message}`, terminal_1.ansi.red, terminal_1.ansi.bold));
    process.exitCode = 1;
});
