11#!/usr/bin/env node
2+ import { createRequire } from "node:module" ;
23import dotenv from "dotenv" ;
4+ import pc from "picocolors" ;
35import { init } from "./init.js" ;
46
57dotenv . config ( ) ;
68
9+ const require = createRequire ( import . meta. url ) ;
10+ const { version : VERSION } = require ( "../../package.json" ) ;
11+
712const args = process . argv . slice ( 2 ) ;
813const command = args [ 0 ] ;
914
@@ -43,9 +48,11 @@ function printSplash() {
4348async function main ( ) {
4449 switch ( command ) {
4550 case "init" :
46- case undefined :
4751 await init ( ) ;
4852 break ;
53+ case undefined :
54+ printSplash ( ) ;
55+ break ;
4956 case "start" :
5057 await import ( "./start.js" ) . then ( ( m ) => m . start ( ) ) ;
5158 break ;
@@ -65,53 +72,26 @@ async function main() {
6572 case "pairing" :
6673 await import ( "./pairing.js" ) . then ( ( m ) => m . pairingCommand ( args . slice ( 1 ) ) ) ;
6774 break ;
75+ case "service" :
76+ await import ( "./service.js" ) . then ( ( m ) => m . serviceCommand ( args . slice ( 1 ) ) ) ;
77+ break ;
6878 case "help" :
6979 case "--help" :
7080 case "-h" :
71- printHelp ( ) ;
81+ printSplash ( ) ;
7282 break ;
7383 case "version" :
7484 case "--version" :
7585 case "-v" :
76- printVersion ( ) ;
86+ console . log ( `adk-claw v ${ VERSION } ` ) ;
7787 break ;
7888 default :
7989 console . error ( `Unknown command: ${ command } ` ) ;
80- printHelp ( ) ;
90+ printSplash ( ) ;
8191 process . exit ( 1 ) ;
8292 }
8393}
8494
85- function printHelp ( ) {
86- console . log ( `
87- adk-claw - Personal AI Assistant Setup
88-
89- Usage:
90- adk-claw [command]
91-
92- Commands:
93- init Initialize ADK Claw (default)
94- start Start the Telegram bot
95- skill <cmd> Manage skills (add, list, remove)
96- pairing <cmd> Manage user pairing (list, approve, deny, users, remove)
97- help Show this help message
98- version Show version
99-
100- Examples:
101- adk-claw # Run setup wizard
102- adk-claw init # Same as above
103- adk-claw start # Launch Telegram bot
104- adk-claw skill add anthropics/skills --skill frontend-design # Install a skill
105- adk-claw skill list # List installed skills
106- adk-claw pairing list telegram # List pending pairing requests
107- adk-claw pairing approve telegram ABC12DEF # Approve a user
108- ` ) ;
109- }
110-
111- function printVersion ( ) {
112- console . log ( "adk-claw v0.1.0" ) ;
113- }
114-
11595main ( ) . catch ( ( err ) => {
11696 console . error ( err ) ;
11797 process . exit ( 1 ) ;
0 commit comments