ikie-cli 0.1.28 → 0.1.29
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 +100 -95
- package/package.json +1 -1
package/dist/onboarding.js
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
|
+
import { createInterface } from 'node:readline';
|
|
1
2
|
import { c, successLine, infoLine, errorLine } from './theme.js';
|
|
2
3
|
import { login } from './auth.js';
|
|
3
4
|
import { saveConfig, isLoggedIn } from './config.js';
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
function waitForEnter(message) {
|
|
6
|
+
const msg = message || 'Press Enter to continue...';
|
|
6
7
|
return new Promise((resolve) => {
|
|
7
8
|
const iface = createInterface({ input: process.stdin, output: process.stdout });
|
|
8
|
-
iface.question(
|
|
9
|
+
iface.question('\n ' + c.muted('\u25b8') + ' ' + c.dim(msg) + ' ', () => {
|
|
10
|
+
iface.close();
|
|
11
|
+
resolve();
|
|
12
|
+
});
|
|
9
13
|
});
|
|
10
14
|
}
|
|
11
15
|
function askYesNo(question, defaultYes = true) {
|
|
12
16
|
return new Promise((resolve) => {
|
|
13
17
|
const iface = createInterface({ input: process.stdin, output: process.stdout });
|
|
14
|
-
const hint = defaultYes
|
|
15
|
-
|
|
18
|
+
const hint = defaultYes
|
|
19
|
+
? c.success('Y') + '/' + c.dim('n')
|
|
20
|
+
: c.dim('y') + '/' + c.error('N');
|
|
21
|
+
iface.question('\n ' + c.primary('?') + ' ' + c.white(question) + ' ' + hint + ' ', (answer) => {
|
|
16
22
|
iface.close();
|
|
17
23
|
const a = answer.trim().toLowerCase();
|
|
18
24
|
if (!a)
|
|
@@ -23,45 +29,47 @@ function askYesNo(question, defaultYes = true) {
|
|
|
23
29
|
});
|
|
24
30
|
}
|
|
25
31
|
function displayWelcome() {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
const border = c.primary.bold('\u2550'.repeat(60));
|
|
33
|
+
console.log();
|
|
34
|
+
console.log(c.primary.bold('\u2554') + border + c.primary.bold('\u2557'));
|
|
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."));
|
|
44
|
+
console.log();
|
|
38
45
|
}
|
|
39
46
|
async function stepAuthentication(config) {
|
|
40
|
-
console.log(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
`);
|
|
47
|
+
console.log();
|
|
48
|
+
console.log(c.primary.bold('Step 1 of 3:') + ' ' + c.white.bold('Sign In'));
|
|
49
|
+
console.log(c.muted('\u2501'.repeat(60)));
|
|
50
|
+
console.log();
|
|
51
|
+
console.log(c.white('To use ikie, you need a free ikie account:'));
|
|
52
|
+
console.log();
|
|
53
|
+
console.log(' ' + c.success('\u2713') + ' Access to powerful AI models');
|
|
54
|
+
console.log(' ' + c.success('\u2713') + ' Web search capabilities');
|
|
55
|
+
console.log(' ' + c.success('\u2713') + ' Session sync across devices');
|
|
56
|
+
console.log(' ' + c.success('\u2713') + ' Weekly free credit limits');
|
|
57
|
+
console.log();
|
|
52
58
|
if (isLoggedIn(config)) {
|
|
53
59
|
console.log(successLine('You are already signed in!'));
|
|
54
60
|
return waitForEnter();
|
|
55
61
|
}
|
|
56
62
|
const shouldLogin = await askYesNo('Would you like to sign in now?', true);
|
|
57
63
|
if (shouldLogin) {
|
|
58
|
-
console.log(
|
|
64
|
+
console.log();
|
|
65
|
+
console.log(c.muted(' Opening login in your browser...'));
|
|
66
|
+
console.log();
|
|
59
67
|
try {
|
|
60
68
|
await login();
|
|
61
69
|
console.log(successLine('Successfully signed in!'));
|
|
62
70
|
}
|
|
63
71
|
catch (err) {
|
|
64
|
-
console.log(errorLine(
|
|
72
|
+
console.log(errorLine('Login failed: ' + (err instanceof Error ? err.message : String(err))));
|
|
65
73
|
console.log(infoLine('You can sign in later with: ikie login'));
|
|
66
74
|
}
|
|
67
75
|
}
|
|
@@ -71,75 +79,72 @@ ${c.white('To use ikie, you need a free ikie account:')}
|
|
|
71
79
|
await waitForEnter();
|
|
72
80
|
}
|
|
73
81
|
async function stepFeatureTour() {
|
|
74
|
-
console.log(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
`);
|
|
82
|
+
console.log();
|
|
83
|
+
console.log(c.primary.bold('Step 2 of 3:') + ' ' + c.white.bold('What Can ikie Do?'));
|
|
84
|
+
console.log(c.muted('\u2501'.repeat(60)));
|
|
85
|
+
console.log();
|
|
86
|
+
console.log(c.secondary.bold('Tools'));
|
|
87
|
+
console.log(' ' + c.muted('\u2022') + ' Read, write, and edit files');
|
|
88
|
+
console.log(' ' + c.muted('\u2022') + ' Run shell commands');
|
|
89
|
+
console.log(' ' + c.muted('\u2022') + ' Git operations (status, diff, commit, branch)');
|
|
90
|
+
console.log(' ' + c.muted('\u2022') + ' Search the web and fetch URLs');
|
|
91
|
+
console.log(' ' + c.muted('\u2022') + ' Save persistent memory notes');
|
|
92
|
+
console.log();
|
|
93
|
+
console.log(c.secondary.bold('Two Interaction Modes'));
|
|
94
|
+
console.log(' ' + c.muted('\u2022') + ' ' + c.success('Agent mode') + ' \u2014 Full execution, makes changes');
|
|
95
|
+
console.log(' ' + c.muted('\u2022') + ' ' + c.warning('Plan mode') + ' \u2014 Read-only, proposes plans');
|
|
96
|
+
console.log();
|
|
97
|
+
console.log(c.secondary.bold('Extensible'));
|
|
98
|
+
console.log(' ' + c.muted('\u2022') + ' Skills system (reusable instructions)');
|
|
99
|
+
console.log(' ' + c.muted('\u2022') + ' MCP servers (Model Context Protocol)');
|
|
100
|
+
console.log(' ' + c.muted('\u2022') + ' Spawn sub-agents for parallel work');
|
|
101
|
+
console.log();
|
|
95
102
|
await waitForEnter();
|
|
96
103
|
}
|
|
97
104
|
async function stepQuickStart() {
|
|
98
|
-
console.log(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
`);
|
|
105
|
+
console.log();
|
|
106
|
+
console.log(c.primary.bold('Step 3 of 3:') + ' ' + c.white.bold('Getting Started'));
|
|
107
|
+
console.log(c.muted('\u2501'.repeat(60)));
|
|
108
|
+
console.log();
|
|
109
|
+
console.log(c.accent('1.') + ' ' + c.white('Ask a question'));
|
|
110
|
+
console.log(' ' + c.dim('ikie "explain this codebase"'));
|
|
111
|
+
console.log();
|
|
112
|
+
console.log(c.accent('2.') + ' ' + c.white('One-shot commands'));
|
|
113
|
+
console.log(' ' + c.dim('ikie "add error handling to api.ts"'));
|
|
114
|
+
console.log();
|
|
115
|
+
console.log(c.accent('3.') + ' ' + c.white('Interactive mode'));
|
|
116
|
+
console.log(' ' + c.dim('ikie'));
|
|
117
|
+
console.log(' ' + c.dim('Chat back and forth with the AI'));
|
|
118
|
+
console.log();
|
|
119
|
+
console.log(c.accent('4.') + ' ' + c.white('Slash commands'));
|
|
120
|
+
console.log(' ' + c.white('/help') + ' \u2014 Show all commands');
|
|
121
|
+
console.log(' ' + c.white('/memory save') + ' \u2014 Save persistent notes');
|
|
122
|
+
console.log(' ' + c.white('/session load') + ' \u2014 Resume previous conversation');
|
|
123
|
+
console.log(' ' + c.white('/plan') + ' \u2014 Read-only planning mode');
|
|
124
|
+
console.log(' ' + c.white('/theme') + ' \u2014 Change color theme');
|
|
125
|
+
console.log();
|
|
126
|
+
console.log(c.white.bold('Pro Tips:'));
|
|
127
|
+
console.log(' ' + c.success('\u2022') + ' Type ' + c.white('!') + ' before a command to run shell directly: ' + c.dim('!ls -la'));
|
|
128
|
+
console.log(' ' + c.success('\u2022') + ' Press ' + c.white('Shift+Tab') + ' to toggle agent/plan modes');
|
|
129
|
+
console.log(' ' + c.success('\u2022') + ' Press ' + c.white('Esc') + ' during execution to cancel');
|
|
130
|
+
console.log();
|
|
125
131
|
await waitForEnter();
|
|
126
132
|
}
|
|
127
133
|
function displayCompletion() {
|
|
128
|
-
console.log(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
`);
|
|
134
|
+
console.log();
|
|
135
|
+
console.log(c.success.bold('All Set!'));
|
|
136
|
+
console.log(c.muted('\u2501'.repeat(60)));
|
|
137
|
+
console.log();
|
|
138
|
+
console.log(c.white.bold("You're ready to start coding with ikie!"));
|
|
139
|
+
console.log();
|
|
140
|
+
console.log(c.primary('1.') + ' Type ' + c.accent('ikie') + ' to start interactive mode');
|
|
141
|
+
console.log(c.primary('2.') + ' Type ' + c.accent('/help') + ' to see all commands');
|
|
142
|
+
console.log(c.primary('3.') + ' Start building something amazing!');
|
|
143
|
+
console.log();
|
|
144
|
+
console.log(c.muted('Dashboard:') + ' ' + c.dim('http://140.245.26.210:3000/dashboard'));
|
|
145
|
+
console.log();
|
|
146
|
+
console.log(c.success.bold('Happy coding!'));
|
|
147
|
+
console.log();
|
|
143
148
|
}
|
|
144
149
|
export async function runOnboarding(config) {
|
|
145
150
|
try {
|
|
@@ -153,7 +158,7 @@ export async function runOnboarding(config) {
|
|
|
153
158
|
await waitForEnter('Press Enter to start ikie...');
|
|
154
159
|
}
|
|
155
160
|
catch (err) {
|
|
156
|
-
console.log(errorLine(
|
|
161
|
+
console.log(errorLine('Onboarding error: ' + (err instanceof Error ? err.message : String(err))));
|
|
157
162
|
saveConfig({ hasCompletedOnboarding: true });
|
|
158
163
|
}
|
|
159
164
|
}
|