diff --git a/src/cli/index.ts b/src/cli/index.ts index 958a8cc..7f87de9 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -1,18 +1,52 @@ #!/usr/bin/env node +import { createRequire } from "node:module"; import dotenv from "dotenv"; +import pc from "picocolors"; import { init } from "./init.js"; dotenv.config(); +const require = createRequire(import.meta.url); +const { version: VERSION } = require("../../package.json"); + const args = process.argv.slice(2); const command = args[0]; +const LOGO = ` +${pc.magenta(" █████╗ ██████╗ ██╗ ██╗ ██████╗██╗ █████╗ ██╗ ██╗")} +${pc.magenta(" ██╔══██╗██╔══██╗██║ ██╔╝ ██╔════╝██║ ██╔══██╗██║ ██║")} +${pc.magenta(" ███████║██║ ██║█████╔╝ ██║ ██║ ███████║██║ █╗ ██║")} +${pc.magenta(" ██╔══██║██║ ██║██╔═██╗ ██║ ██║ ██╔══██║██║███╗██║")} +${pc.magenta(" ██║ ██║██████╔╝██║ ██╗ ╚██████╗███████╗██║ ██║╚███╔███╔╝")} +${pc.magenta(" ╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝╚═╝ ╚═╝ ╚══╝╚══╝")}`; + +function printSplash() { + console.log(LOGO); + console.log(); + console.log( + pc.dim(" Personal AI assistant with memory, Telegram & skills."), + ); + console.log(); + console.log(pc.dim(` v${VERSION}`)); + console.log(); + console.log(` ${pc.magenta("init")} Create a new ADK Claw project`); + console.log(` ${pc.magenta("start")} Start the AI agent`); + console.log(` ${pc.magenta("skill")} Manage agent skills`); + console.log(` ${pc.magenta("pairing")} Manage Telegram user pairing`); + console.log(); + console.log(pc.dim(` Docs: https://github.com/IQAIcom/adk-claw`)); + console.log(pc.dim(` GitHub: https://github.com/IQAIcom/adk-claw`)); + console.log(); +} + async function main() { switch (command) { case "init": - case undefined: await init(); break; + case undefined: + printSplash(); + break; case "start": await import("./start.js").then((m) => m.start()); break; @@ -26,50 +60,20 @@ async function main() { case "help": case "--help": case "-h": - printHelp(); + printSplash(); break; case "version": case "--version": case "-v": - printVersion(); + console.log(`adk-claw v${VERSION}`); break; default: console.error(`Unknown command: ${command}`); - printHelp(); + printSplash(); process.exit(1); } } -function printHelp() { - console.log(` -adk-claw - Personal AI Assistant Setup - -Usage: - adk-claw [command] - -Commands: - init Initialize ADK Claw (default) - start Start the Telegram bot - skill Manage skills (add, list, remove) - pairing Manage user pairing (list, approve, deny, users, remove) - help Show this help message - version Show version - -Examples: - adk-claw # Run setup wizard - adk-claw init # Same as above - adk-claw start # Launch Telegram bot - adk-claw skill add anthropics/skills --skill frontend-design # Install a skill - adk-claw skill list # List installed skills - adk-claw pairing list telegram # List pending pairing requests - adk-claw pairing approve telegram ABC12DEF # Approve a user -`); -} - -function printVersion() { - console.log("adk-claw v0.1.0"); -} - main().catch((err) => { console.error(err); process.exit(1);