ikie-cli 0.1.29 → 0.1.31
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/dist/onboarding.js +15 -21
- package/package.json +1 -1
package/dist/onboarding.js
CHANGED
|
@@ -1,46 +1,39 @@
|
|
|
1
1
|
import { createInterface } from 'node:readline';
|
|
2
|
-
import { c, successLine, infoLine, errorLine } from './theme.js';
|
|
2
|
+
import { c, drawBanner, successLine, infoLine, errorLine } from './theme.js';
|
|
3
3
|
import { login } from './auth.js';
|
|
4
4
|
import { saveConfig, isLoggedIn } from './config.js';
|
|
5
5
|
function waitForEnter(message) {
|
|
6
6
|
const msg = message || 'Press Enter to continue...';
|
|
7
7
|
return new Promise((resolve) => {
|
|
8
|
-
const iface = createInterface({ input: process.stdin, output: process.stdout });
|
|
8
|
+
const iface = createInterface({ input: process.stdin, output: process.stdout, terminal: false });
|
|
9
9
|
iface.question('\n ' + c.muted('\u25b8') + ' ' + c.dim(msg) + ' ', () => {
|
|
10
10
|
iface.close();
|
|
11
|
-
resolve();
|
|
11
|
+
setTimeout(() => resolve(), 50);
|
|
12
12
|
});
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
function askYesNo(question, defaultYes = true) {
|
|
16
16
|
return new Promise((resolve) => {
|
|
17
|
-
const iface = createInterface({ input: process.stdin, output: process.stdout });
|
|
17
|
+
const iface = createInterface({ input: process.stdin, output: process.stdout, terminal: false });
|
|
18
18
|
const hint = defaultYes
|
|
19
19
|
? c.success('Y') + '/' + c.dim('n')
|
|
20
20
|
: c.dim('y') + '/' + c.error('N');
|
|
21
21
|
iface.question('\n ' + c.primary('?') + ' ' + c.white(question) + ' ' + hint + ' ', (answer) => {
|
|
22
22
|
iface.close();
|
|
23
23
|
const a = answer.trim().toLowerCase();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
if (!a)
|
|
26
|
+
resolve(defaultYes);
|
|
27
|
+
else
|
|
28
|
+
resolve(a === 'y' || a === 'yes');
|
|
29
|
+
}, 50);
|
|
28
30
|
});
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
|
-
function displayWelcome() {
|
|
32
|
-
|
|
33
|
+
function displayWelcome(config) {
|
|
34
|
+
drawBanner(config.model);
|
|
33
35
|
console.log();
|
|
34
|
-
console.log(c.
|
|
35
|
-
console.log(c.primary.bold('\u2551') + ' ' + c.primary.bold('\u2551'));
|
|
36
|
-
console.log(c.primary.bold('\u2551') + ' ' + c.accent.bold('Welcome to') + ' ' + c.primary.bold('ikie') + ' ' + c.muted('\u2014 Your AI Pair Programmer') + ' ' + c.primary.bold('\u2551'));
|
|
37
|
-
console.log(c.primary.bold('\u2551') + ' ' + c.muted('Agentic Coding in Your Terminal') + ' ' + c.primary.bold('\u2551'));
|
|
38
|
-
console.log(c.primary.bold('\u2551') + ' ' + c.primary.bold('\u2551'));
|
|
39
|
-
console.log(c.primary.bold('\u255a') + border + c.primary.bold('\u255d'));
|
|
40
|
-
console.log();
|
|
41
|
-
console.log(c.white.bold('Hey there! \u{1F44B}'));
|
|
42
|
-
console.log();
|
|
43
|
-
console.log(c.white("Let's get you set up in just a few steps."));
|
|
36
|
+
console.log(c.white.bold('Welcome to ikie! Let\'s get you set up in a few steps.'));
|
|
44
37
|
console.log();
|
|
45
38
|
}
|
|
46
39
|
async function stepAuthentication(config) {
|
|
@@ -67,6 +60,7 @@ async function stepAuthentication(config) {
|
|
|
67
60
|
try {
|
|
68
61
|
await login();
|
|
69
62
|
console.log(successLine('Successfully signed in!'));
|
|
63
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
70
64
|
}
|
|
71
65
|
catch (err) {
|
|
72
66
|
console.log(errorLine('Login failed: ' + (err instanceof Error ? err.message : String(err))));
|
|
@@ -148,7 +142,7 @@ function displayCompletion() {
|
|
|
148
142
|
}
|
|
149
143
|
export async function runOnboarding(config) {
|
|
150
144
|
try {
|
|
151
|
-
displayWelcome();
|
|
145
|
+
displayWelcome(config);
|
|
152
146
|
await waitForEnter();
|
|
153
147
|
await stepAuthentication(config);
|
|
154
148
|
await stepFeatureTour();
|