-
Notifications
You must be signed in to change notification settings - Fork 0
feat(cli): Add styled splash screen with ASCII art logo #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,50 @@ | ||
| #!/usr/bin/env node | ||
| import dotenv from "dotenv"; | ||
| import pc from "picocolors"; | ||
| import { init } from "./init.js"; | ||
|
|
||
| dotenv.config(); | ||
|
|
||
| const args = process.argv.slice(2); | ||
| const command = args[0]; | ||
|
|
||
| const VERSION = "0.1.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 +58,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}`); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| 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 <cmd> Manage skills (add, list, remove) | ||
| pairing <cmd> 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); | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoding the
VERSIONconstant here can lead to inconsistencies if the project's version inpackage.jsonis updated but this file is not. It's best practice to derive the version directly frompackage.jsonto maintain a single source of truth and ensure all parts of the application reflect the correct version.