@kibibot/cli 1.0.8 → 1.0.10

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/README.md CHANGED
@@ -112,6 +112,8 @@ kibi skills # list all agent capabilities
112
112
  kibi config get # show all config
113
113
  kibi config get apiKey # show specific key
114
114
  kibi config set apiKey kb_YOUR_KEY
115
+
116
+ kibi about # version, links, branding
115
117
  ```
116
118
 
117
119
  ## Global Flags
@@ -0,0 +1,5 @@
1
+ /**
2
+ * kibi about — branded info card
3
+ */
4
+ import { Command } from 'commander';
5
+ export declare function registerAbout(program: Command): void;
@@ -0,0 +1,51 @@
1
+ import chalk from 'chalk';
2
+ import { readFileSync } from 'node:fs';
3
+ import { join, dirname } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ function getVersion() {
6
+ try {
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ const pkg = JSON.parse(readFileSync(join(__dirname, '..', '..', 'package.json'), 'utf-8'));
9
+ return pkg.version || 'unknown';
10
+ }
11
+ catch {
12
+ return 'unknown';
13
+ }
14
+ }
15
+ export function registerAbout(program) {
16
+ program
17
+ .command('about')
18
+ .description('About KibiBot CLI')
19
+ .action(() => {
20
+ const version = getVersion();
21
+ const W = 43; // inner width between ║ borders
22
+ function pad(text, displayWidth) {
23
+ // displayWidth accounts for emojis/wide chars taking 2 columns
24
+ const dw = displayWidth ?? text.length;
25
+ const padding = W - dw;
26
+ return text + ' '.repeat(Math.max(0, padding));
27
+ }
28
+ const lines = [
29
+ '',
30
+ ' K I B I B O T',
31
+ '',
32
+ ' Deploy tokens. Earn fees.',
33
+ ' Power your AI agent.',
34
+ '',
35
+ ` Version ${version}`,
36
+ ' Website kibi.bot',
37
+ ' Docs kibi.bot/docs/agent',
38
+ ' GitHub github.com/KibiAgent',
39
+ '',
40
+ ' Base · BSC · Solana',
41
+ '',
42
+ ];
43
+ console.log();
44
+ console.log(chalk.cyan(` ╔${'═'.repeat(W)}╗`));
45
+ for (const line of lines) {
46
+ console.log(chalk.cyan(' ║') + pad(line) + chalk.cyan('║'));
47
+ }
48
+ console.log(chalk.cyan(` ╚${'═'.repeat(W)}╝`));
49
+ console.log();
50
+ });
51
+ }
@@ -27,17 +27,51 @@ export function registerLogin(program) {
27
27
  }
28
28
  let apiKey = opts.apiKey;
29
29
  if (!apiKey) {
30
- // Interactive prompt
31
- const readline = await import('node:readline');
32
- const rl = readline.createInterface({
33
- input: process.stdin,
34
- output: process.stdout,
35
- });
30
+ // Interactive prompt with masked input
31
+ process.stdout.write('Enter your API key: ');
36
32
  apiKey = await new Promise((resolve) => {
37
- rl.question('Enter your API key: ', (answer) => {
38
- rl.close();
39
- resolve(answer.trim());
40
- });
33
+ let input = '';
34
+ const stdin = process.stdin;
35
+ const wasRaw = stdin.isRaw;
36
+ if (stdin.isTTY) {
37
+ stdin.setRawMode(true);
38
+ }
39
+ stdin.resume();
40
+ stdin.setEncoding('utf8');
41
+ const onData = (ch) => {
42
+ const c = ch.toString();
43
+ if (c === '\n' || c === '\r') {
44
+ // Enter
45
+ stdin.removeListener('data', onData);
46
+ if (stdin.isTTY)
47
+ stdin.setRawMode(wasRaw ?? false);
48
+ stdin.pause();
49
+ process.stdout.write('\n');
50
+ resolve(input.trim());
51
+ }
52
+ else if (c === '\u0003') {
53
+ // Ctrl+C
54
+ process.stdout.write('\n');
55
+ process.exit(0);
56
+ }
57
+ else if (c === '\u007f' || c === '\b') {
58
+ // Backspace
59
+ if (input.length > 0) {
60
+ input = input.slice(0, -1);
61
+ process.stdout.write('\b \b');
62
+ }
63
+ }
64
+ else if (c.length === 1 && c >= ' ') {
65
+ input += c;
66
+ process.stdout.write('*');
67
+ }
68
+ else if (c.length > 1) {
69
+ // Pasted text
70
+ input += c;
71
+ process.stdout.write('*'.repeat(c.length));
72
+ }
73
+ };
74
+ stdin.on('data', onData);
41
75
  });
42
76
  }
43
77
  if (!apiKey || !apiKey.startsWith('kb_')) {
package/dist/index.js CHANGED
@@ -19,6 +19,7 @@ import { registerQuota } from './commands/quota.js';
19
19
  import { registerSkills } from './commands/skills.js';
20
20
  import { registerLlm } from './commands/llm.js';
21
21
  import { registerConfig } from './commands/config.js';
22
+ import { registerAbout } from './commands/about.js';
22
23
  // Read version from package.json
23
24
  const __filename = fileURLToPath(import.meta.url);
24
25
  const __dirname = dirname(__filename);
@@ -47,4 +48,5 @@ registerQuota(program);
47
48
  registerSkills(program);
48
49
  registerLlm(program);
49
50
  registerConfig(program);
51
+ registerAbout(program);
50
52
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kibibot/cli",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "KibiBot CLI — deploy tokens, check balances, and manage your AI agent from the terminal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,7 +15,8 @@
15
15
  "scripts": {
16
16
  "build": "tsc",
17
17
  "dev": "tsc --watch",
18
- "prepublishOnly": "npm run build"
18
+ "prepublishOnly": "npm run build",
19
+ "postinstall": "node dist/index.js about 2>/dev/null || true"
19
20
  },
20
21
  "engines": {
21
22
  "node": ">=18.0.0"