kob-cli 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kob-cli",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "KOB CLI — AI-powered code generation tool. Built by Kob AI, made in Thailand.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  #!/usr/bin/env bun
2
2
 
3
3
  import { Command } from 'commander';
4
- import chalk from 'chalk';
4
+ import { readFileSync } from 'fs';
5
+ import { fileURLToPath } from 'url';
6
+ import { dirname, join } from 'path';
5
7
  import { authVerifyCommand, balanceCommand } from './commands/auth.js';
6
8
  import { modelsCommand } from './commands/models.js';
7
9
  import { chatCommand, chatInteractiveCommand } from './commands/chat.js';
@@ -9,13 +11,22 @@ import { streamCommand } from './commands/stream.js';
9
11
  import { askCommand } from './commands/ask.js';
10
12
  import { codeCommand } from './commands/code.js';
11
13
  import { skillsCommand } from './commands/skills.js';
14
+ import { runCodeTui } from './ui/code-tui.js';
15
+
16
+ // Read version from package.json so it stays in sync with releases
17
+ const __filename = fileURLToPath(import.meta.url);
18
+ const __dirname = dirname(__filename);
19
+ const pkg = JSON.parse(
20
+ readFileSync(join(__dirname, '..', 'package.json'), 'utf-8')
21
+ );
22
+ const VERSION: string = pkg.version;
12
23
 
13
24
  const program = new Command();
14
25
 
15
26
  program
16
- .name('kob')
17
- .description('KOB CLI - Command-line interface for Kob AI')
18
- .version('1.0.0');
27
+ .name('kob')
28
+ .description('KOB CLI - Command-line interface for Kob AI')
29
+ .version(VERSION);
19
30
 
20
31
  program.addCommand(authVerifyCommand);
21
32
  program.addCommand(balanceCommand);
@@ -27,58 +38,10 @@ program.addCommand(codeCommand);
27
38
  program.addCommand(skillsCommand);
28
39
  program.addCommand(modelsCommand);
29
40
 
30
- function showWelcome(): void {
31
- const line = chalk.dim('─'.repeat(58));
32
- const accent = chalk.hex('#a78bfa');
33
- const subtle = chalk.dim;
34
- const label = chalk.hex('#fbbf24');
35
- const green = chalk.hex('#34d399');
36
- const blue = chalk.hex('#38bdf8');
37
- const pink = chalk.hex('#f472b6');
38
-
39
- console.log(`
40
-
41
- ${blue.bold(' ██╗ ██╗ ██████╗ ██████╗ ')}${pink.bold(' ██████╗██╗ ██╗')}
42
- ${green.bold(' ██║ ██╔╝██╔═══██╗██╔══██╗')}${pink.bold(' ██╔════╝██║ ██║')}
43
- ${blue.bold(' █████╔╝ ██║ ██║██████╔╝')}${pink.bold(' ██║ ██║ ██║')}
44
- ${accent.bold(' ██╔═██╗ ██║ ██║██╔══██╗')}${pink.bold(' ██║ ██║ ██║')}
45
- ${pink.bold(' ██║ ██╗╚██████╔╝██████╔╝')}${pink.bold(' ╚██████╗███████╗██║')}
46
- ${subtle(' ╚═╝ ╚═╝ ╚═════╝ ╚═════╝')}${subtle(' ╚═════╝╚══════╝╚═╝')}
47
-
48
- ${subtle('╭' + '─'.repeat(56) + '╮')}
49
- ${subtle('│')} ${chalk.bold('KOB CLI')} ${subtle('·')} ${blue.bold('powered by')} ${green.bold('Kob AI')} ${subtle('·')} ${pink.bold('made in Thailand')} ${chalk.bold('🇹🇭')} ${subtle('│')}
50
- ${subtle('│')} ${subtle.italic('v1.0.0')} ${subtle('·')} ${subtle('www.kob-ai.dev')} ${subtle('·')} ${subtle('AI Command-Line Interface')} ${subtle('│')}
51
- ${subtle('╰' + '─'.repeat(56) + '╯')}
52
-
53
- ${line}
54
- ${label.bold(' 🚀 QUICK START')}
55
- ${line}
56
-
57
- ${accent('kob ask "What is AI?"')} ${subtle('Ask anything to AI')}
58
- ${accent('kob code "REST API"')} ${subtle('Generate code')}
59
- ${accent('kob skills')} ${subtle('List all available skills')}
60
-
61
- ${line}
62
- ${label.bold(' 📋 COMMANDS')}
63
- ${line}
64
-
65
- ${chalk.hex('#f97316')('🔐')} ${accent.bold('auth:verify')} ${accent('balance')} ${subtle('Authentication')}
66
- ${chalk.hex('#22d3ee')('💡')} ${accent.bold('ask')} ${subtle('Ask questions')}
67
- ${chalk.hex('#34d399')('💻')} ${accent.bold('code')} ${accent('--lang python')} ${subtle('Generate code')}
68
- ${chalk.hex('#38bdf8')('💬')} ${accent.bold('chat')} ${accent('chat:interactive')} ${accent('stream')} ${subtle('AI Chat')}
69
- ${chalk.hex('#a78bfa')('🤖')} ${accent.bold('models')} ${accent('--provider DeepSeek')} ${subtle('AI Models')}
70
- ${chalk.hex('#f472b6')('🧠')} ${accent.bold('skills')} ${subtle('All skills')}
71
-
72
- ${line}
73
- ${subtle('💡')} ${subtle.italic('kob <command> --help for detailed options')}
74
- ${chalk.dim('─').repeat(58)}
75
- `);
76
- }
77
-
78
- // Display welcome if no command provided
41
+ // Launch the Code TUI when no subcommand is given — `kob` becomes the entry point
79
42
  if (process.argv.length <= 2) {
80
- showWelcome();
81
- process.exit(0);
43
+ await runCodeTui();
44
+ process.exit(0);
82
45
  }
83
46
 
84
47
  program.parse(process.argv);