@aristobyte-ui/cli
Version:
The official AristoByteUI CLI — initialize projects, install, upgrade, remove, and manage UI components seamlessly.
685 lines (661 loc) • 32 kB
JavaScript
#!/usr/bin/env node
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// ../../node_modules/picocolors/picocolors.js
var require_picocolors = __commonJS({
"../../node_modules/picocolors/picocolors.js"(exports, module) {
"use strict";
var p = process || {};
var argv = p.argv || [];
var env2 = p.env || {};
var isColorSupported = !(!!env2.NO_COLOR || argv.includes("--no-color")) && (!!env2.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env2.TERM !== "dumb" || !!env2.CI);
var formatter = (open, close, replace = open) => (input) => {
let string = "" + input, index = string.indexOf(close, open.length);
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
};
var replaceClose = (string, close, replace, index) => {
let result = "", cursor = 0;
do {
result += string.substring(cursor, index) + replace;
cursor = index + close.length;
index = string.indexOf(close, cursor);
} while (~index);
return result + string.substring(cursor);
};
var createColors = (enabled = isColorSupported) => {
let f = enabled ? formatter : () => String;
return {
isColorSupported: enabled,
reset: f("\x1B[0m", "\x1B[0m"),
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
italic: f("\x1B[3m", "\x1B[23m"),
underline: f("\x1B[4m", "\x1B[24m"),
inverse: f("\x1B[7m", "\x1B[27m"),
hidden: f("\x1B[8m", "\x1B[28m"),
strikethrough: f("\x1B[9m", "\x1B[29m"),
black: f("\x1B[30m", "\x1B[39m"),
red: f("\x1B[31m", "\x1B[39m"),
green: f("\x1B[32m", "\x1B[39m"),
yellow: f("\x1B[33m", "\x1B[39m"),
blue: f("\x1B[34m", "\x1B[39m"),
magenta: f("\x1B[35m", "\x1B[39m"),
cyan: f("\x1B[36m", "\x1B[39m"),
white: f("\x1B[37m", "\x1B[39m"),
gray: f("\x1B[90m", "\x1B[39m"),
bgBlack: f("\x1B[40m", "\x1B[49m"),
bgRed: f("\x1B[41m", "\x1B[49m"),
bgGreen: f("\x1B[42m", "\x1B[49m"),
bgYellow: f("\x1B[43m", "\x1B[49m"),
bgBlue: f("\x1B[44m", "\x1B[49m"),
bgMagenta: f("\x1B[45m", "\x1B[49m"),
bgCyan: f("\x1B[46m", "\x1B[49m"),
bgWhite: f("\x1B[47m", "\x1B[49m"),
blackBright: f("\x1B[90m", "\x1B[39m"),
redBright: f("\x1B[91m", "\x1B[39m"),
greenBright: f("\x1B[92m", "\x1B[39m"),
yellowBright: f("\x1B[93m", "\x1B[39m"),
blueBright: f("\x1B[94m", "\x1B[39m"),
magentaBright: f("\x1B[95m", "\x1B[39m"),
cyanBright: f("\x1B[96m", "\x1B[39m"),
whiteBright: f("\x1B[97m", "\x1B[39m"),
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
bgRedBright: f("\x1B[101m", "\x1B[49m"),
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
};
};
module.exports = createColors();
module.exports.createColors = createColors;
}
});
// index.ts
import { Command } from "commander";
// commands/add.ts
import { spinner } from "@clack/prompts";
// utils/installPackage.ts
import { execa } from "execa";
async function installPackage(pkgManager, pkg, dev = false) {
let args = [];
switch (pkgManager) {
case "npm":
args = ["install", pkg, dev ? "--save-dev" : "--save"];
break;
case "yarn":
args = ["add", pkg];
if (dev) args.push("-D");
break;
case "pnpm":
args = ["add", pkg];
if (dev) args.push("-D");
break;
case "bun":
args = ["add", pkg];
if (dev) args.push("-d");
break;
default:
throw new Error(`Unsupported package manager: ${pkgManager}`);
}
await execa(pkgManager, args, { stdio: "inherit" });
}
// commands/add.ts
var import_picocolors = __toESM(require_picocolors());
async function add(component) {
const s = spinner();
try {
s.start(`Installing ${component}...`);
if (component === "all") {
await installPackage("yarn", "@aristobyte-ui/react");
s.stop();
console.log(import_picocolors.default.green("\u2705 All components installed!"));
return;
}
const pkgName = `@aristobyte-ui/${component}`;
await installPackage("yarn", pkgName);
s.stop();
console.log(import_picocolors.default.green(`\u2705 Component ${component} installed!`));
} catch (err) {
s.stop();
console.error(
import_picocolors.default.red(`\u274C Failed to install component ${component}`),
err
);
}
}
// commands/init.ts
var import_picocolors2 = __toESM(require_picocolors());
import { execa as execa2 } from "execa";
import { select, text, spinner as spinner2 } from "@clack/prompts";
var TEMPLATES = [
{
id: "aristobyte-ui-template-nextjs-15-app-router",
name: "Next App Router",
desc: "A Next.js 15 with app-router directory template pre-configured with AristoByteUI.",
repo: "https://github.com/aristobyte-team/aristobyte-ui-template-nextjs-15-app-router.git"
},
{
id: "aristobyte-ui-template-nextjs-15-pages",
name: "Next Pages",
desc: "A Next.js 15 with pages directory template pre-configured with AristoByteUI.",
repo: "https://github.com/aristobyte-team/aristobyte-ui-template-nextjs-15-pages.git"
},
{
id: "aristobyte-ui-template-vite",
name: "Vite",
desc: "A Vite template pre-configured with AristoByteUI.",
repo: "https://github.com/aristobyte-team/aristobyte-ui-template-vite.git"
},
{
id: "aristobyte-ui-template-astro",
name: "Astro",
desc: "An Astro template pre-configured with AristoByteUI.",
repo: "https://github.com/aristobyte-team/aristobyte-ui-template-astro.git"
},
{
id: "aristobyte-ui-template-cra",
name: "CRA",
desc: "A Create React App template pre-configured with AristoByteUI.",
repo: "https://github.com/aristobyte-team/aristobyte-ui-template-cra.git"
}
];
var PACKAGE_MANAGERS = ["npm", "yarn", "pnpm", "bun"];
var DEFAULT_NAME = "aristobyte-ui-app";
async function init(myProjectName = DEFAULT_NAME) {
console.log(import_picocolors2.default.cyan("\u250C Create a new project"));
const projectNameResult = await text({
message: "New project name (Enter to skip with default name)",
placeholder: myProjectName
});
const projectName = (String(projectNameResult) || myProjectName).trim();
const templateIndex = await select({
message: "Select a template (Enter to select)",
options: TEMPLATES.map((t, i) => ({
value: i + "",
label: `${t.name} (${t.desc})`
}))
});
const template = TEMPLATES[Number(templateIndex)];
const packageManagerIndex = await select({
message: "Select a package manager (Enter to select)",
options: PACKAGE_MANAGERS.map((pm, i) => ({
value: i.toString(),
label: pm
}))
});
const packageManager = PACKAGE_MANAGERS[Number(packageManagerIndex)];
console.log(import_picocolors2.default.cyan("\nTemplate created successfully!\n"));
const s = spinner2();
try {
s.start(
`Preparing '${template.name}' with ${packageManager} configuration...`
);
await execa2(
"git",
[
"clone",
"--branch",
packageManager,
"--single-branch",
template.repo,
projectName
],
{
stdio: "ignore"
}
);
await execa2("rm", ["-rf", ".git"], { stdio: "ignore", cwd: projectName });
s.stop();
console.log(import_picocolors2.default.green("\u2705 Project initialized successfully!\n"));
console.log(import_picocolors2.default.cyan("Next steps:"));
console.log(import_picocolors2.default.cyan(` cd ${projectName}`));
console.log(import_picocolors2.default.cyan(` ${packageManager} install`));
console.log(import_picocolors2.default.cyan(` ${packageManager} run dev
`));
} catch (err) {
s.stop();
console.error(import_picocolors2.default.red("\u274C Failed to initialize project"), err);
}
}
// commands/remove.ts
var import_picocolors3 = __toESM(require_picocolors());
import { spinner as spinner3 } from "@clack/prompts";
import { execa as execa3 } from "execa";
async function remove(component) {
const s = spinner3();
try {
const pkgName = component === "all" ? "@aristobyte-ui/react" : `@aristobyte-ui/${component}`;
s.start(`Removing ${pkgName}...`);
await execa3("yarn", ["remove", pkgName], { stdio: "inherit" });
s.stop();
console.log(import_picocolors3.default.green(`\u2705 ${pkgName} removed successfully!`));
} catch (err) {
s.stop();
console.error(import_picocolors3.default.red(`\u274C Failed to remove component ${component}`), err);
}
}
// commands/upgrade.ts
var import_picocolors4 = __toESM(require_picocolors());
import { spinner as spinner4 } from "@clack/prompts";
import { execa as execa4 } from "execa";
async function upgrade(component) {
const s = spinner4();
try {
const pkgName = component === "all" ? "@aristobyte-ui/react" : `@aristobyte-ui/${component}`;
s.start(`Upgrading ${pkgName}...`);
await execa4("yarn", ["upgrade", pkgName], { stdio: "inherit" });
s.stop();
console.log(import_picocolors4.default.green(`\u2705 ${pkgName} upgraded successfully!`));
} catch (err) {
s.stop();
console.error(
import_picocolors4.default.red(`\u274C Failed to upgrade component ${component}`),
err
);
}
}
// commands/list.ts
var import_picocolors5 = __toESM(require_picocolors());
import fs from "fs";
async function list() {
try {
const pkgJson = JSON.parse(fs.readFileSync("package.json", "utf-8"));
const deps = pkgJson.dependencies || {};
const aristobyteDeps = Object.keys(deps).filter(
(d) => d.startsWith("@aristobyte-ui/")
);
console.log(import_picocolors5.default.blue("Installed AristoByteUI components:"));
aristobyteDeps.forEach((dep) => console.log(import_picocolors5.default.green(dep)));
} catch (err) {
console.error(import_picocolors5.default.red("\u274C Failed to list components"), err);
}
}
// commands/doctor.ts
import { execSync } from "child_process";
import { spinner as spinner5 } from "@clack/prompts";
// utils/compareVersions.ts
function compareVersions(v1, v2) {
const a = v1.replace(/^v/, "").split(".").map(Number);
const b = v2.replace(/^v/, "").split(".").map(Number);
for (let i = 0; i < 3; i++) {
if (a[i] > b[i]) return 1;
if (a[i] < b[i]) return -1;
}
return 0;
}
// commands/doctor.ts
var import_picocolors6 = __toESM(require_picocolors());
var MIN_NODE_VERSION = "20.19.0";
async function doctor() {
const s = spinner5();
try {
s.start("Running project health checks...");
let nodeVersion = "unknown";
try {
nodeVersion = execSync("node -v").toString().trim();
} catch (err) {
console.error(import_picocolors6.default.red("\u274C Failed to detect Node version:"), err);
}
let nodeStatus = "\u2705 OK";
if (nodeVersion !== "unknown" && compareVersions(nodeVersion, MIN_NODE_VERSION) < 0) {
nodeStatus = import_picocolors6.default.red(`\u274C Node >= ${MIN_NODE_VERSION} required`);
}
let yarnVersion = "unknown";
try {
yarnVersion = execSync("yarn -v").toString().trim();
} catch (err) {
console.error(import_picocolors6.default.red("\u274C Failed to detect Yarn version:"), err);
}
s.stop();
console.log(import_picocolors6.default.green(`Node version: ${nodeVersion} ${nodeStatus}`));
console.log(import_picocolors6.default.green(`Yarn version: ${yarnVersion}`));
console.log(import_picocolors6.default.green("All basic health checks completed!"));
} catch (err) {
s.stop();
console.error(import_picocolors6.default.red("\u274C Doctor check failed"), err);
}
}
// commands/env.ts
import os from "os";
import { execSync as execSync2 } from "child_process";
import { spinner as spinner6 } from "@clack/prompts";
// utils/checkVersion.ts
var import_picocolors7 = __toESM(require_picocolors());
function checkVersion(name, version, minVersion) {
if (version === "unknown" || compareVersions(version, minVersion) < 0) {
return import_picocolors7.default.red(`\u274C ${name} >= ${minVersion} required`);
}
return import_picocolors7.default.green(`\u2705 ${version}`);
}
// commands/env.ts
var import_picocolors8 = __toESM(require_picocolors());
var MIN_VERSIONS = {
node: "20.17.0",
npm: "10.8.2",
yarn: "1.22.22"
};
function getVersion(command, name) {
try {
return execSync2(command).toString().trim();
} catch (err) {
console.error(import_picocolors8.default.red(`\u274C Failed to detect ${name} version:`), err);
return "unknown";
}
}
async function env() {
const s = spinner6();
try {
s.start("Fetching system environment info...");
const nodeVersion = getVersion("node -v", "Node");
const npmVersion = getVersion("npm -v", "npm");
const yarnVersion = getVersion("yarn -v", "Yarn");
s.stop();
console.log(import_picocolors8.default.blue("System Environment Info:"));
console.log(
import_picocolors8.default.green(`OS: ${os.type()} ${os.release()} (${os.platform()})`)
);
console.log(import_picocolors8.default.green(`CPU: ${os.cpus()[0].model}`));
console.log(
import_picocolors8.default.green(`Memory: ${(os.totalmem() / 1024 / 1024).toFixed(0)} MB`)
);
console.log(
`Node: ${checkVersion("Node", nodeVersion, MIN_VERSIONS.node)}`
);
console.log(`npm: ${checkVersion("npm", npmVersion, MIN_VERSIONS.npm)}`);
console.log(
`Yarn: ${checkVersion("Yarn", yarnVersion, MIN_VERSIONS.yarn)}`
);
} catch (err) {
s.stop();
console.error(
import_picocolors8.default.red("\u274C Failed to fetch system environment info:"),
err
);
}
}
// utils/colors.ts
import chalk from "chalk";
import gradient from "gradient-string";
var LOGO_COLORS = ["#ffee27", "#fec800", "#f18e35", "#e95f32", "#e2312d"];
function logo3(text2) {
return chalk.hex(LOGO_COLORS[2])(text2);
}
function logo4(text2) {
return chalk.hex(LOGO_COLORS[3])(text2);
}
function lightGrey(text2) {
return chalk.hex("#afbfff")(text2);
}
function darkGrey(text2) {
return chalk.hex("#7580aa")(text2);
}
function logoGradient(text2) {
return gradient([
...LOGO_COLORS,
...LOGO_COLORS.reverse(),
...LOGO_COLORS,
...LOGO_COLORS.reverse(),
...LOGO_COLORS
]).multiline(text2);
}
function logoSmallGradient(text2) {
return gradient([
LOGO_COLORS[0],
LOGO_COLORS[1],
LOGO_COLORS[1],
LOGO_COLORS[0],
LOGO_COLORS[0],
LOGO_COLORS[1]
]).multiline(text2);
}
// utils/getBanner.ts
var banners = [
` \u2591\u2588\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588
\u2591\u2588\u2588\u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588
\u2591\u2588\u2588 \u2591\u2588\u2588\u2591\u2588\u2588\u2591\u2588\u2588\u2588\u2591\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588 \u2591\u2588\u2588\u2591\u2588\u2588 \u2591\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588
\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2588 \u2591\u2588\u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588
\u2591\u2588\u2588 \u2591\u2588\u2591\u2588\u2588 \u2591\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2591\u2588\u2588 \u2591\u2588\u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588
\u2591\u2588\u2588 \u2591\u2588\u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2591\u2588\u2588 \u2591\u2588\u2591\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588
\u2591\u2588\u2588 \u2591\u2588\u2591\u2588\u2588 \u2591\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588 \u2591\u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588
\u2591\u2588\u2588
\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588 `,
` \u2597\u2584\u2596\u2597\u2584\u2584\u2596\u2597\u2584\u2584\u2584\u2596\u2597\u2584\u2584\u2597\u2584\u2584\u2584\u2597\u2584\u2596\u2597\u2584\u2584\u2597\u2596 \u2597\u2597\u2584\u2584\u2584\u2597\u2584\u2584\u2584\u2596 \u2597\u2596 \u2597\u2597\u2584\u2584\u2584\u2596
\u2590\u258C \u2590\u2590\u258C \u2590\u258C \u2588 \u2590\u258C \u2588\u2590\u258C \u2590\u2590\u258C \u2590\u259D\u259A\u259E\u2598 \u2588 \u2590\u258C \u2590\u258C \u2590\u258C \u2588
\u2590\u259B\u2580\u259C\u2590\u259B\u2580\u259A\u2596 \u2588 \u259D\u2580\u259A\u2596 \u2588\u2590\u258C \u2590\u2590\u259B\u2580\u259A\u2596\u2590\u258C \u2588 \u2590\u259B\u2580\u2580\u2598 \u2590\u258C \u2590\u258C \u2588
\u2590\u258C \u2590\u2590\u258C \u2590\u2597\u2584\u2588\u2584\u2597\u2584\u2584\u259E\u2598 \u2588\u259D\u259A\u2584\u259E\u2590\u2599\u2584\u259E\u2598\u2590\u258C \u2588 \u2590\u2599\u2584\u2584\u2596 \u259D\u259A\u2584\u259E\u2597\u2584\u2588\u2584\u2596`,
` _ _ _ ___ _ _ _ ___
/_\\ _ _(_)__| |_ ___| _ )_ _| |_ ___ | | | |_ _|
/ _ \\| '_| (_-< _/ _ \\ _ \\ || | _/ -_) | |_| || |
/_/ \\_\\_| |_/__/\\__\\___/___/\\_, |\\__\\___| \\___/|___|
|__/ `,
` _____ _____
( ___ ) ( ___ )
| |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| |
| | \\ _) | __ ) | | | _ _| | |
| | _ \\ __| | __| __| _ \\ __ \\ | | __| _ \\ | | | | |
| | ___ \\ | | \\__ \\ | ( | | | | | | __/ | | | | |
| | _/ _\\ _| _| ____/ \\__| \\___/ ____/ \\__, | \\__| \\___| \\___/ ___| | |
| | ____/ | |
|___|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|___|
(_____) (_____)`,
` \\ _) | __ ) | | | _ _|
_ \\ __| | __| __| _ \\ __ \\ | | __| _ \\ | | |
___ \\ | | \\__ \\ | ( | | | | | | __/ | | |
_/ _\\ _| _| ____/ \\__| \\___/ ____/ \\__, | \\__| \\___| \\___/ ___|
____/ `,
` ___ _ __ ____ __ __ ______
/ | _____(______/ /_____ / __ )__ __/ /____ / / / / _/
/ /| | / ___/ / ___/ __/ __ \\/ __ / / / / __/ _ \\ / / / // /
/ ___ |/ / / (__ / /_/ /_/ / /_/ / /_/ / /_/ __/ / /_/ _/ /
/_/ |_/_/ /_/____/\\__/\\____/_____/\\__, /\\__/\\___/ \\____/___/
/____/ `,
` \u2588\u2588
\u2592\u2588\u2588\u2592 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2592 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588
\u2593\u2588\u2588\u2593 \u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593 \u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588
\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2592\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588
\u2588\u2588\u2588\u2588 \u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2592\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2591\u2588\u2588 \u2588\u2588\u2588\u2593 \u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2592 \u2588\u2588 \u2588\u2588 \u2588\u2588
\u2592\u2588\u2593\u2593\u2588\u2592\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2592\u2588\u2592\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2592 \u2588\u2588 \u2588\u2588 \u2588\u2588
\u2593\u2588\u2592\u2592\u2588\u2593\u2588\u2588\u2588\u2591 \u2588\u2588 \u2588\u2588\u2592 \u2591\u2592\u2588 \u2588\u2588 \u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2592 \u2588\u2588\u2591 \u2588\u2588 \u2588\u2588\u2592 \u2592\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588
\u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2593\u2591 \u2588\u2588 \u2588\u2588\u2591 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2592\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588
\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2592 \u2588\u2588 \u2588\u2588 \u2588\u2588\u2588 \u2592\u2588\u2588\u2591\u2588\u2588\u2593\u2588\u2593 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588
\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2591\u2592\u2593\u2588\u2588 \u2588\u2588 \u2588\u2588\u2591 \u2591\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2591 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588
\u2592\u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2592\u2591 \u2592\u2588\u2588 \u2588\u2588\u2591 \u2588\u2588\u2588 \u2588\u2588\u2588\u2588 \u2592\u2588\u2588 \u2592\u2588\u2588\u2588 \u2588\u2588\u2591 \u2588\u2588\u2588\u2591 \u2592\u2588 \u2588\u2588\u2593 \u2593\u2588\u2588 \u2588\u2588
\u2588\u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2593 \u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2592\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588
\u2588\u2588\u2592 \u2592\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2593\u2588\u2588\u2588\u2588\u2593 \u2591\u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2593 \u2588\u2588\u2591 \u2591\u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2588\u2588\u2592 \u2592\u2588\u2588\u2588\u2588\u2592\u2588\u2588\u2588\u2588\u2588\u2588
\u2592\u2588\u2588
\u2588\u2588\u2588\u2592
\u2588\u2588\u2588 `
];
function getBanner() {
return logoGradient(banners[0]);
}
// utils/typography.ts
function usage(params) {
return params.map((param) => `${logo4("[")} ${lightGrey(param)} ${logo4("]")}`).join(" ");
}
function description(text2) {
return darkGrey(`- ${text2}`);
}
// package.json
var package_default = {
name: "@aristobyte-ui/cli",
description: "The official AristoByteUI CLI \u2014 initialize projects, install, upgrade, remove, and manage UI components seamlessly.",
version: "1.0.76",
license: "MIT",
private: false,
author: "AristoByte <info@aristobyte.com>",
homepage: "https://www.npmjs.com/package/@aristobyte-ui/cli",
repository: {
type: "git",
url: "git+https://github.com/aristobyte-team/aristobyte-ui.git",
directory: "./"
},
bugs: {
url: "https://github.com/aristobyte-team/aristobyte-ui.git/issues"
},
engines: {
node: ">=20.17.0",
npm: ">=10.8.2",
yarn: ">=1.22.22"
},
keywords: [
"aristobyte",
"cli",
"ui",
"components",
"typescript",
"node",
"developer-tools",
"project-bootstrap",
"package-management"
],
files: [
"dist"
],
publishConfig: {
access: "public"
},
main: "dist/index.js",
module: "dist/index.mjs",
bin: {
"aristobyte-ui": "dist/index.js"
},
exports: {
".": {
import: "./dist/index.mjs",
require: "./dist/index.js"
}
},
scripts: {
build: "tsup",
"build:watch": "tsup ./index.ts --watch",
dev: "tsup && node ./bin/aristobyte-ui.js",
start: "node ./bin/aristobyte-ui.js",
lint: "eslint . --ext .ts,.tsx --max-warnings 0",
"lint:fix": "eslint . --ext .ts,.tsx --fix",
"check-types": "tsc --noEmit"
},
dependencies: {
"@aristobyte-ui/eslint-config": "^1.0.76",
"@aristobyte-ui/typescript-config": "^1.0.76",
"@clack/prompts": "^0.11.0",
axios: "^1.6.0",
chalk: "^5.6.1",
commander: "^11.0.0",
execa: "^8.0.0",
"gradient-string": "^3.0.0"
},
devDependencies: {
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.29.6",
"@types/node": "^24.3.1",
eslint: "^9.35.0",
"ts-node": "^10.9.2",
tsup: "^8.5.0",
typescript: "^5.9.2"
}
};
// index.ts
var COMMANDS = [
"init",
"add",
"remove",
"upgrade",
"list",
"doctor",
"env",
"help"
];
var aristobyteui = new Command();
aristobyteui.name("aristobyte-ui").usage(usage(["command", "options"])).description("Initialize a new AristoByteUI project").version(package_default.version, "-V, --version", "Output the CLI version").helpOption("-H, --help", "Show help information");
aristobyteui.command("init").usage(usage(["options", "myProjectName"])).description("Initialize a new AristoByteUI project").action((myProjectName) => {
init(myProjectName);
});
aristobyteui.command("add").usage(usage(["options", "components..."])).description("Add a UI component").action(add);
aristobyteui.command("remove").usage(usage(["options", "components..."])).description("Remove a UI component").action(remove);
aristobyteui.command("upgrade").usage(usage(["options", "components..."])).description("Upgrade a UI component").action(upgrade);
aristobyteui.command("list").usage(usage(["options"])).description("List installed components").action(list);
aristobyteui.command("doctor").usage(usage(["options"])).description("Check system and project health").action(doctor);
aristobyteui.command("env").usage(usage(["options"])).description("Display environment info").action(env);
aristobyteui.command("help").usage(usage(["options"])).description("Display help for command").action(env);
aristobyteui.command("help", { hidden: true });
aristobyteui.configureHelp({
formatHelp: (cmd, helper) => `
${getBanner()}
${logoSmallGradient("Usage:")}
${logo3(helper.commandUsage(cmd))}
${logoSmallGradient("Description:")}
${darkGrey(
"Create new AristoByteUI projects or manage existing projects with full control"
)}
${darkGrey("over components, dependencies, and UI stack configuration. Supports initialization,")}
${darkGrey(
"addition, removal, upgrading of components, and project diagnostics."
)}
${logoSmallGradient("Commands:")}
${helper.visibleCommands(cmd).map(
(c) => ` ${`${logo3(c.name()).padEnd(31)} ${c.usage() || "".padEnd(30)}`.padEnd(129)} ${description(c.description())}`
).join("\n")}
${logoSmallGradient("Options:")}
${helper.visibleOptions(cmd).map((option) => {
const flagsArray = option.flags.split(/,\s*/);
const styledFlags = `${logo3(flagsArray[0])}${darkGrey(", ")}${logo4(flagsArray[1])}`;
return ` ${styledFlags.padEnd(93)} ${description(option.description)}`;
}).join("\n")}
${logoSmallGradient("Tip:")}
${lightGrey("Use 'aristobyte-ui [ command ] --help' for detailed info on a command.")}
`
});
aristobyteui.exitOverride(async (err) => {
if (err.code === "commander.unknownCommand") {
console.error(
logoSmallGradient(" \u25C6 Possible commands are: \n"),
...COMMANDS.map(
(cmd) => cmd === err.message.split("Did you mean ")[1].split("?")[0] ? `${logoSmallGradient("\u2502 ")}${logo4("\u25CF aristobyte-ui")} ${logo4(`${cmd}`)}
` : `${logoSmallGradient("\u2502 \u25CB aristobyte-ui")} ${logo3(`${cmd}`)}
`
)
);
}
process.exit(1);
});
(async () => {
const args = process.argv.slice(2);
if (args.length === 0) {
aristobyteui.outputHelp();
process.exit(0);
}
try {
await aristobyteui.parseAsync(args, { from: "user" });
process.exit(1);
} catch {
process.exit(1);
}
})();
//# sourceMappingURL=index.mjs.map