@dboio/cli 0.6.2 → 0.6.3

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/bin/dbo.js CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  import { Command } from 'commander';
4
4
  import { createRequire } from 'module';
5
+ import { existsSync, writeFileSync } from 'fs';
6
+ import { homedir } from 'os';
7
+ import { join } from 'path';
5
8
 
6
9
  const require = createRequire(import.meta.url);
7
10
  const packageJson = require('../package.json');
@@ -28,6 +31,36 @@ import { diffCommand } from '../src/commands/diff.js';
28
31
  import { rmCommand } from '../src/commands/rm.js';
29
32
  import { mvCommand } from '../src/commands/mv.js';
30
33
 
34
+ // First-run welcome message
35
+ function checkFirstRun() {
36
+ const markerFile = join(homedir(), '.dbo-cli-welcomed');
37
+
38
+ if (!existsSync(markerFile)) {
39
+ const RESET = '\x1b[0m';
40
+ const BOLD = '\x1b[1m';
41
+ const DIM = '\x1b[2m';
42
+ const CYAN = '\x1b[36m';
43
+ const YELLOW = '\x1b[33m';
44
+
45
+ console.log('');
46
+ console.log(`${BOLD}${CYAN} Welcome to DBO.io CLI!${RESET}`);
47
+ console.log('');
48
+ console.log(` ${DIM}Available plugins:${RESET}`);
49
+ console.log(` ${YELLOW}Claude Code — /dbo slash command${RESET}`);
50
+ console.log(` ${DIM}dbo install --claudecommand dbo${RESET}`);
51
+ console.log('');
52
+ console.log(` To install all plugins at once, run:`);
53
+ console.log(` ${BOLD}dbo install plugins${RESET}`);
54
+ console.log('');
55
+
56
+ try {
57
+ writeFileSync(markerFile, new Date().toISOString());
58
+ } catch {
59
+ // Ignore write errors
60
+ }
61
+ }
62
+ }
63
+
31
64
  const program = new Command();
32
65
 
33
66
  program
@@ -57,4 +90,7 @@ program.addCommand(diffCommand);
57
90
  program.addCommand(rmCommand);
58
91
  program.addCommand(mvCommand);
59
92
 
93
+ // Show welcome message on first run
94
+ checkFirstRun();
95
+
60
96
  program.parse();
@@ -3,25 +3,15 @@
3
3
  // Post-install hook for `npm i @dboio/cli`
4
4
  // Interactive plugin picker when TTY is available, static message otherwise.
5
5
 
6
- import { openSync, writeSync, closeSync } from 'fs';
7
-
8
6
  const RESET = '\x1b[0m';
9
7
  const BOLD = '\x1b[1m';
10
8
  const DIM = '\x1b[2m';
11
9
  const CYAN = '\x1b[36m';
12
10
  const YELLOW = '\x1b[33m';
13
11
 
14
- // Write to TTY directly to bypass npm's output suppression
12
+ // Simple log function - console.log works fine in postinstall
15
13
  function write(message) {
16
- try {
17
- // Try to write directly to /dev/tty (works on Unix-like systems)
18
- const fd = openSync('/dev/tty', 'w');
19
- writeSync(fd, message);
20
- closeSync(fd);
21
- } catch {
22
- // Fallback to console.error if /dev/tty is not available
23
- console.error(message);
24
- }
14
+ console.log(message);
25
15
  }
26
16
 
27
17
  // Available plugins — add new entries here as plugins are created
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dboio/cli",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "CLI for the DBO.io framework",
5
5
  "type": "module",
6
6
  "bin": {