icoa-cli 1.5.1 → 1.6.0
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/index.js +23 -26
- package/dist/repl.js +26 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,33 +14,31 @@ import { registerSetupCommand } from './commands/setup.js';
|
|
|
14
14
|
import { registerEnvCommand } from './commands/env.js';
|
|
15
15
|
import { getConfig, saveConfig } from './lib/config.js';
|
|
16
16
|
import { startRepl } from './repl.js';
|
|
17
|
-
import { checkTerminal } from './lib/terminal.js';
|
|
18
17
|
import { setTerminalTheme } from './lib/theme.js';
|
|
19
|
-
|
|
20
|
-
const B = chalk.cyan('║');
|
|
18
|
+
const LINE = chalk.cyan(' ─────────────────────────────────────────────────────');
|
|
21
19
|
const BANNER = `
|
|
22
|
-
${
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
${
|
|
20
|
+
${LINE}
|
|
21
|
+
|
|
22
|
+
${chalk.bold.white('██╗ ██████╗ ██████╗ █████╗')}
|
|
23
|
+
${chalk.bold.white('██║██╔════╝██╔═══██╗██╔══██╗')}
|
|
24
|
+
${chalk.bold.white('██║██║ ██║ ██║███████║')}
|
|
25
|
+
${chalk.bold.white('██║██║ ██║ ██║██╔══██║')}
|
|
26
|
+
${chalk.bold.white('██║╚██████╗╚██████╔╝██║ ██║')}
|
|
27
|
+
${chalk.bold.white('╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝')}
|
|
28
|
+
|
|
29
|
+
${chalk.yellow('International Cyber Olympiad in AI 2026')}
|
|
30
|
+
${chalk.bold.magenta("The World's First AI Security Olympiad")}
|
|
31
|
+
|
|
32
|
+
${chalk.green.bold('AI4CTF')}${chalk.gray('[Day 1]')} ${chalk.white('AI as your teammate')}
|
|
33
|
+
${chalk.red.bold('CTF4AI')}${chalk.gray('[Day 2]')} ${chalk.white('Hack & evaluate AI systems')}
|
|
34
|
+
${chalk.bold.yellow('AI is your ally. AI is your target.')}
|
|
35
|
+
|
|
36
|
+
${chalk.white('Sydney, Australia')} ${chalk.gray('Jun 27 - Jul 2, 2026')}
|
|
37
|
+
${chalk.cyan.underline('https://icoa2026.au')}
|
|
38
|
+
|
|
39
|
+
${chalk.gray('CLI-Native Competition Terminal v1.6.0')}
|
|
40
|
+
|
|
41
|
+
${LINE}
|
|
44
42
|
`;
|
|
45
43
|
// Global error handlers
|
|
46
44
|
process.on('uncaughtException', (err) => {
|
|
@@ -66,7 +64,6 @@ program
|
|
|
66
64
|
// Force hacker theme: black background + green text
|
|
67
65
|
setTerminalTheme();
|
|
68
66
|
console.log(BANNER);
|
|
69
|
-
checkTerminal();
|
|
70
67
|
// If running interactively (no extra args or --resume), start REPL
|
|
71
68
|
if (process.argv.length <= 2 || opts.resume) {
|
|
72
69
|
startRepl(program, !!opts.resume);
|
package/dist/repl.js
CHANGED
|
@@ -17,34 +17,44 @@ export function startRepl(program, resumeMode) {
|
|
|
17
17
|
if (info) {
|
|
18
18
|
const mins = Math.floor(info.awaySeconds / 60);
|
|
19
19
|
const secs = info.awaySeconds % 60;
|
|
20
|
-
console.log(chalk.yellow(`
|
|
21
|
-
|
|
22
|
-
else {
|
|
23
|
-
console.log(chalk.gray(' No previous session to resume.'));
|
|
20
|
+
console.log(chalk.yellow(` Session resumed. Away: ${mins}m ${secs}s | Total exits: ${info.exitCount}`));
|
|
21
|
+
console.log();
|
|
24
22
|
}
|
|
25
|
-
console.log();
|
|
26
23
|
}
|
|
27
24
|
// Device mismatch check
|
|
28
25
|
if (activated && !isDeviceMatch()) {
|
|
29
|
-
console.log(chalk.red('
|
|
30
|
-
console.log(chalk.gray('
|
|
26
|
+
console.log(chalk.red(' Token was activated on a different device.'));
|
|
27
|
+
console.log(chalk.gray(' Contact organizer for assistance.'));
|
|
31
28
|
console.log();
|
|
32
|
-
// Fall through to restricted mode
|
|
33
29
|
}
|
|
34
30
|
else if (connected) {
|
|
35
|
-
console.log(chalk.
|
|
36
|
-
console.log(chalk.gray(
|
|
31
|
+
console.log(chalk.green(` Welcome back, ${config.userName}!`));
|
|
32
|
+
console.log(chalk.gray(` Connected to ${config.ctfdUrl}`));
|
|
33
|
+
console.log();
|
|
37
34
|
}
|
|
38
35
|
else if (activated) {
|
|
39
|
-
console.log(chalk.green('
|
|
36
|
+
console.log(chalk.green(' Welcome, competitor! Ready to hack.'));
|
|
37
|
+
console.log();
|
|
38
|
+
console.log(chalk.gray(' Quick Start'));
|
|
39
|
+
console.log(chalk.gray(' ─────────────'));
|
|
40
|
+
console.log(chalk.white(' join <url> ') + chalk.gray('Connect to competition'));
|
|
41
|
+
console.log(chalk.white(' challenges ') + chalk.gray('View challenges'));
|
|
42
|
+
console.log(chalk.white(' hint <question> ') + chalk.gray('Ask AI for help'));
|
|
43
|
+
console.log(chalk.white(' env ') + chalk.gray('Check your tools'));
|
|
44
|
+
console.log(chalk.white(' help ') + chalk.gray('All commands'));
|
|
45
|
+
console.log();
|
|
40
46
|
}
|
|
41
47
|
else {
|
|
42
|
-
console.log(chalk.
|
|
43
|
-
console.log(
|
|
48
|
+
console.log(chalk.white(' Welcome to ICOA CLI!'));
|
|
49
|
+
console.log();
|
|
50
|
+
console.log(chalk.gray(' Quick Start'));
|
|
51
|
+
console.log(chalk.gray(' ─────────────'));
|
|
52
|
+
console.log(chalk.white(' activate <token> ') + chalk.gray('Unlock with your access token'));
|
|
53
|
+
console.log(chalk.white(' ref <topic> ') + chalk.gray('Browse tool references'));
|
|
54
|
+
console.log(chalk.white(' env ') + chalk.gray('Check your tools'));
|
|
55
|
+
console.log(chalk.white(' help ') + chalk.gray('All commands'));
|
|
56
|
+
console.log();
|
|
44
57
|
}
|
|
45
|
-
console.log();
|
|
46
|
-
console.log(chalk.gray(' Type ') + chalk.white('help') + chalk.gray(' for commands, ') + chalk.white('exit') + chalk.gray(' to quit.'));
|
|
47
|
-
console.log();
|
|
48
58
|
program.exitOverride();
|
|
49
59
|
program.configureOutput({
|
|
50
60
|
writeErr: () => { },
|