dave-code 1.0.1 → 1.0.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/cliMenu.js +7 -13
- package/bin/install.js +50 -0
- package/package.json +4 -1
package/bin/cliMenu.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import readline from 'readline';
|
|
11
|
+
import ora from 'ora';
|
|
11
12
|
|
|
12
13
|
export function selectMenu(title, description, options, defaultIndex = 0) {
|
|
13
14
|
return new Promise((resolve) => {
|
|
@@ -302,21 +303,14 @@ export function waitForEnter(promptText) {
|
|
|
302
303
|
}
|
|
303
304
|
|
|
304
305
|
export function startSpinner(prefixText) {
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
const interval = setInterval(() => {
|
|
312
|
-
i = (i + 1) % frames.length;
|
|
313
|
-
process.stdout.write(`\r\x1b[K\x1b[36m${prefixText} ${frames[i]}\x1b[0m`);
|
|
314
|
-
}, 80);
|
|
306
|
+
const spinner = ora({
|
|
307
|
+
text: prefixText,
|
|
308
|
+
color: 'cyan',
|
|
309
|
+
spinner: 'dots'
|
|
310
|
+
}).start();
|
|
315
311
|
|
|
316
312
|
return () => {
|
|
317
|
-
|
|
318
|
-
process.stdout.write('\r\x1b[K');
|
|
319
|
-
process.stdout.write('\x1b[?25h');
|
|
313
|
+
spinner.stop();
|
|
320
314
|
};
|
|
321
315
|
}
|
|
322
316
|
|
package/bin/install.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import ora from 'ora';
|
|
2
|
+
|
|
3
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
4
|
+
|
|
5
|
+
async function runInstallationAnimation() {
|
|
6
|
+
console.log('\n\x1b[1;38;2;250;100;30m=== Dave Code Installer ===\x1b[0m\n');
|
|
7
|
+
|
|
8
|
+
// Stage 1: Environment Check
|
|
9
|
+
const spinner1 = ora({
|
|
10
|
+
text: 'Checking system environment & configurations...',
|
|
11
|
+
color: 'yellow',
|
|
12
|
+
spinner: 'dots'
|
|
13
|
+
}).start();
|
|
14
|
+
await sleep(1500);
|
|
15
|
+
spinner1.succeed('\x1b[32mEnvironment check completed! (Node.js ' + process.version + ')\x1b[0m');
|
|
16
|
+
|
|
17
|
+
// Stage 2: Downloading assets
|
|
18
|
+
const spinner2 = ora({
|
|
19
|
+
text: 'Downloading Dave Code core assets...',
|
|
20
|
+
color: 'cyan',
|
|
21
|
+
spinner: 'line'
|
|
22
|
+
}).start();
|
|
23
|
+
await sleep(2000);
|
|
24
|
+
spinner2.succeed('\x1b[32mAssets successfully downloaded!\x1b[0m');
|
|
25
|
+
|
|
26
|
+
// Stage 3: Initializing database
|
|
27
|
+
const spinner3 = ora({
|
|
28
|
+
text: 'Building local database & cache indices...',
|
|
29
|
+
color: 'magenta',
|
|
30
|
+
spinner: 'circle'
|
|
31
|
+
}).start();
|
|
32
|
+
await sleep(1500);
|
|
33
|
+
spinner3.succeed('\x1b[32mDatabase initialized!\x1b[0m');
|
|
34
|
+
|
|
35
|
+
// Stage 4: Success art and message
|
|
36
|
+
console.log('\n\x1b[38;2;140;90;240m' +
|
|
37
|
+
` ____ ______ __
|
|
38
|
+
/ __ \\____ __ _____ / ____/___ ____/ /__
|
|
39
|
+
/ / / / __ \`/ | / / _ \\ / / / __ \\/ __ / _ \\
|
|
40
|
+
/ /_/ / /_/ /| |/ / __// /___/ /_/ / /_/ / __/
|
|
41
|
+
/_____/\\__,_/ |___/\\___/ \\____/\\____/\\__,_/\\___/ ` + '\x1b[0m\n');
|
|
42
|
+
|
|
43
|
+
console.log('\x1b[1;32m✔ Installation completed successfully! 🎉\x1b[0m');
|
|
44
|
+
console.log('\x1b[90m--------------------------------------------------\x1b[0m');
|
|
45
|
+
console.log('🚀 \x1b[1;36mDave Code\x1b[0m is now ready for use!');
|
|
46
|
+
console.log('💡 Type \x1b[33mcalldave\x1b[0m in your terminal to start pair programming.');
|
|
47
|
+
console.log('\x1b[90m--------------------------------------------------\x1b[0m\n');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
runInstallationAnimation().catch(console.error);
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dave-code",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "A terminal-based AI coding assistant CLI similar to Claude Code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "bin/index.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"calldave": "bin/index.js"
|
|
9
9
|
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"postinstall": "node bin/install.js"
|
|
12
|
+
},
|
|
10
13
|
"keywords": [
|
|
11
14
|
"cli",
|
|
12
15
|
"ai",
|