aether-hub 1.0.6 → 1.1.1

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/index.js CHANGED
@@ -1,326 +1,371 @@
1
- #!/usr/bin/env node
2
- /**
3
- * aether-cli - AeTHer Validator Command Line Interface
4
- *
5
- * Main entry point for the validator CLI tool.
6
- * Provides onboarding, system checks, validator management, and KYC integration.
7
- */
8
-
9
- const { doctorCommand } = require('./commands/doctor');
10
- const { validatorStart } = require('./commands/validator-start');
11
- const { validatorStatus } = require('./commands/validator-status');
12
- const { init } = require('./commands/init');
13
- const { monitorLoop } = require('./commands/monitor');
14
- const { logsCommand } = require('./commands/logs');
15
- const { sdkCommand } = require('./commands/sdk');
16
- const { walletCommand } = require('./commands/wallet');
17
- const readline = require('readline');
18
-
19
- // CLI version
20
- const VERSION = '1.0.4';
21
-
22
- // Parse args early to support flags on commands
23
- function getCommandArgs() {
24
- return process.argv.slice(2);
25
- }
26
-
27
- // Tier colours
28
- const TIER_COLORS = {
29
- FULL: '\x1b[36m', // cyan
30
- LITE: '\x1b[33m', // yellow
31
- OBSERVER: '\x1b[32m', // green
32
- reset: '\x1b[0m',
33
- };
34
-
35
- /**
36
- * Display the interactive main menu
37
- */
38
- async function showMenu() {
39
- const rl = readline.createInterface({
40
- input: process.stdin,
41
- output: process.stdout,
42
- });
43
-
44
- const prompt = (q) => new Promise((res) => rl.question(q, res));
45
-
46
- console.log(
47
- TIER_COLORS.FULL + '\n ╔═══════════════════════════════════════════════╗\n' +
48
- ' ║ AETHER CHAIN — Validator Setup Wizard ║\n' +
49
- ' ╚═══════════════════════════════════════════════╝' + TIER_COLORS.reset + '\n'
50
- );
51
-
52
- console.log(' Welcome to AeTHer Chain. What would you like to do?\n');
53
- console.log(' ' + TIER_COLORS.FULL + '1)' + TIER_COLORS.reset + ' 🩺 Doctor — Check if your system meets requirements');
54
- console.log(' ' + TIER_COLORS.FULL + '2)' + TIER_COLORS.reset + ' 🚀 Start — Begin validator onboarding (recommended)');
55
- console.log(' ' + TIER_COLORS.FULL + '3)' + TIER_COLORS.reset + ' 📊 Monitor — Watch live validator stats');
56
- console.log(' ' + TIER_COLORS.FULL + '4)' + TIER_COLORS.reset + ' 📋 Logs — Tail and colourise validator logs');
57
- console.log(' ' + TIER_COLORS.FULL + '5)' + TIER_COLORS.reset + ' 📦 SDK — Get SDK links and install tools');
58
- console.log(' ' + TIER_COLORS.FULL + '6)' + TIER_COLORS.reset + ' Help Show all commands\n');
59
- console.log(' ' + TIER_COLORS.reset + ' Type a number or command name. Press Ctrl+C to exit.\n');
60
-
61
- const VALID_CHOICES = ['1', '2', '3', '4', '5', '6', 'doctor', 'init', 'monitor', 'logs', 'sdk', 'help'];
62
-
63
- while (true) {
64
- const answer = (await prompt(` > `)).trim().toLowerCase();
65
-
66
- if (answer === '' || answer === '1' || answer === 'doctor') {
67
- rl.close();
68
- const { doctorCommand } = require('./commands/doctor');
69
- doctorCommand({ autoFix: false, tier: 'full' });
70
- return;
71
- }
72
-
73
- if (answer === '2' || answer === 'init' || answer === 'start') {
74
- rl.close();
75
- const { init } = require('./commands/init');
76
- init();
77
- return;
78
- }
79
-
80
- if (answer === '3' || answer === 'monitor') {
81
- rl.close();
82
- const { main } = require('./commands/monitor');
83
- main();
84
- return;
85
- }
86
-
87
- if (answer === '4' || answer === 'logs') {
88
- rl.close();
89
- const { logsCommand } = require('./commands/logs');
90
- logsCommand();
91
- return;
92
- }
93
-
94
- if (answer === '5' || answer === 'sdk') {
95
- rl.close();
96
- const { sdkCommand } = require('./commands/sdk');
97
- sdkCommand();
98
- return;
99
- }
100
-
101
- if (answer === '6' || answer === 'help') {
102
- showHelp();
103
- console.log(" Press Ctrl+C to exit or select an option above.\n");
104
- continue;
105
- }
106
-
107
- console.log(`\n ⚠️ Unknown option: "${answer}". Type 1-6 or a command name.\n`);
108
- }
109
- }
110
-
111
- // Available commands
112
- const COMMANDS = {
113
- start: {
114
- description: 'Launch interactive menu (default if no args) — same as running aether-cli with no arguments',
115
- handler: () => showMenu(),
116
- },
117
- doctor: {
118
- description: 'Run system requirements checks (CPU/RAM/Disk/Network/Firewall)',
119
- handler: () => {
120
- const args = getCommandArgs();
121
- const autoFix = args.includes('--fix') || args.includes('-f');
122
-
123
- // Parse --tier flag
124
- let tier = 'full';
125
- const tierIndex = args.findIndex(arg => arg === '--tier');
126
- if (tierIndex !== -1 && args[tierIndex + 1]) {
127
- tier = args[tierIndex + 1].toLowerCase();
128
- }
129
-
130
- doctorCommand({ autoFix, tier });
131
- },
132
- },
133
- init: {
134
- description: 'Start onboarding wizard (generate identity, create stake account, connect to testnet)',
135
- handler: init,
136
- },
137
- 'kyc generate': {
138
- description: 'Generate pre-filled KYC link with pubkey, node ID, signature',
139
- handler: () => console.log('🚧 kyc generate command under development'),
140
- },
141
- monitor: {
142
- description: 'Real-time validator dashboard (slot, block height, peers, TPS)',
143
- handler: () => {
144
- // monitor command runs its own loop
145
- const { main } = require('./commands/monitor');
146
- main();
147
- },
148
- },
149
- logs: {
150
- description: 'Tail validator logs with colour-coded output (ERROR=red, WARN=yellow, INFO=green)',
151
- handler: logsCommand,
152
- },
153
- sdk: {
154
- description: 'Aether SDK download links and install instructions (JS, Rust, FLUX/ATH tokens)',
155
- handler: sdkCommand,
156
- },
157
- wallet: {
158
- description: 'Wallet management create, import, list, default, connect, balance, stake, transfer',
159
- handler: () => {
160
- const { walletCommand } = require('./commands/wallet');
161
- walletCommand();
162
- },
163
- },
164
- stake: {
165
- description: 'Stake AETH to a validator — aether stake --validator <addr> --amount <aeth>',
166
- handler: () => {
167
- const { walletCommand } = require('./commands/wallet');
168
- // Intercept argv so walletCommand receives 'stake' as the subcmd
169
- const originalArgv = process.argv;
170
- process.argv = [...originalArgv.slice(0, 2), 'wallet', 'stake', ...originalArgv.slice(3)];
171
- walletCommand();
172
- process.argv = originalArgv;
173
- },
174
- },
175
- transfer: {
176
- description: 'Transfer AETH to another address — aether transfer --to <addr> --amount <aeth>',
177
- handler: () => {
178
- const { walletCommand } = require('./commands/wallet');
179
- const originalArgv = process.argv;
180
- process.argv = [...originalArgv.slice(0, 2), 'wallet', 'transfer', ...originalArgv.slice(3)];
181
- walletCommand();
182
- process.argv = originalArgv;
183
- },
184
- },
185
- tx: {
186
- description: 'Transaction history — aether tx history --address <addr> [--limit 20] [--json]',
187
- handler: () => {
188
- const { walletCommand } = require('./commands/wallet');
189
- const originalArgv = process.argv;
190
- process.argv = [...originalArgv.slice(0, 2), 'wallet', 'history', ...originalArgv.slice(3)];
191
- walletCommand();
192
- process.argv = originalArgv;
193
- },
194
- },
195
- history: {
196
- description: 'Transaction history for an address — alias for tx history',
197
- handler: () => {
198
- const { walletCommand } = require('./commands/wallet');
199
- const originalArgv = process.argv;
200
- process.argv = [...originalArgv.slice(0, 2), 'wallet', 'history', ...originalArgv.slice(3)];
201
- walletCommand();
202
- process.argv = originalArgv;
203
- },
204
- },
205
- validator: {
206
- description: 'Validator node management',
207
- handler: () => {
208
- // Handle validator subcommands
209
- const subcmd = process.argv[3];
210
-
211
- if (!subcmd) {
212
- console.log('Usage: aether-cli validator <command>');
213
- console.log('');
214
- console.log('Commands:');
215
- console.log(' start Start the validator node');
216
- console.log(' status Check validator status');
217
- console.log('');
218
- return;
219
- }
220
-
221
- switch (subcmd) {
222
- case 'start':
223
- validatorStart();
224
- break;
225
- case 'status':
226
- validatorStatus();
227
- break;
228
- default:
229
- console.error(`Unknown validator command: ${subcmd}`);
230
- console.error('Valid commands: start, status');
231
- process.exit(1);
232
- }
233
- },
234
- },
235
- help: {
236
- description: 'Show this help message',
237
- handler: showHelp,
238
- },
239
- version: {
240
- description: 'Show version number',
241
- handler: () => console.log(`aether-cli v${VERSION}`),
242
- },
243
- };
244
-
245
- /**
246
- * Display help message with ASCII art
247
- */
248
- function showHelp() {
249
- const header = `
250
- ███╗ ███╗██╗███████╗███████╗██╗ ██████╗ ███╗ ██╗
251
- ████╗ ████║██║██╔════╝██╔════╝██║██╔═══██╗████╗ ██║
252
- ██╔████╔██║██║███████╗███████╗██║██║ ██║██╔██╗ ██║
253
- ██║╚██╔╝██║██║╚════██║╚════██║██║██║ ██║██║╚██╗██║
254
- ██║ ╚═╝ ██║██║███████║███████║██║╚██████╔╝██║ ╚████║
255
- ╚═╝ ╚═╝╚═╝╚══════╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝
256
-
257
- Validator CLI v${VERSION}
258
- `.trim();
259
-
260
- console.log(header);
261
- console.log('\nUsage: aether-cli <command> [options]\n');
262
- console.log('Commands:');
263
- Object.entries(COMMANDS).forEach(([cmd, info]) => {
264
- console.log(` ${cmd.padEnd(18)} ${info.description}`);
265
- });
266
- console.log('\nExamples:');
267
- console.log(' aether-cli doctor # Check system requirements');
268
- console.log(' aether-cli init # Start onboarding wizard');
269
- console.log(' aether-cli monitor # Real-time validator dashboard');
270
- console.log(' aether-cli validator start # Start validator node');
271
- console.log(' aether-cli validator status # Check validator status');
272
- console.log(' aether-cli wallet balance # Query AETH balance');
273
- console.log(' aether-cli tx history # Show transaction history');
274
- console.log(' aether-cli --version # Show version');
275
- console.log('\nDocumentation: https://github.com/jelly-legs-ai/Jelly-legs-unsteady-workshop');
276
- console.log('Spec: docs/MINING_VALIDATOR_TOOLS.md\n');
277
- }
278
-
279
- /**
280
- * Parse command line arguments
281
- */
282
- function parseArgs() {
283
- const args = process.argv.slice(2);
284
-
285
- // Handle flags
286
- if (args.includes('--version') || args.includes('-v')) {
287
- return 'version';
288
- }
289
- if (args.includes('--help') || args.includes('-h')) {
290
- return 'help';
291
- }
292
-
293
- // No args → interactive menu
294
- if (args.length === 0) {
295
- return 'start';
296
- }
297
-
298
- // Handle multi-word commands (e.g., "validator start", "kyc generate")
299
- if (args.length >= 2) {
300
- const multiCmd = `${args[0]} ${args[1]}`;
301
- if (COMMANDS[multiCmd]) {
302
- return multiCmd;
303
- }
304
- }
305
-
306
- // Single word command
307
- return args[0] || 'help';
308
- }
309
-
310
- /**
311
- * Main CLI entry point
312
- */
313
- function main() {
314
- const command = parseArgs();
315
-
316
- if (COMMANDS[command]) {
317
- COMMANDS[command].handler();
318
- } else {
319
- console.error(`❌ Unknown command: ${command}`);
320
- console.error('Run "aether-cli help" for usage.\n');
321
- process.exit(1);
322
- }
323
- }
324
-
325
- // Run CLI
326
- main();
1
+ #!/usr/bin/env node
2
+ /**
3
+ * aether-cli - AeTHer Validator Command Line Interface
4
+ *
5
+ * Main entry point for the validator CLI tool.
6
+ * Provides onboarding, system checks, validator management, and KYC integration.
7
+ */
8
+
9
+ const { doctorCommand } = require('./commands/doctor');
10
+ const { validatorStart } = require('./commands/validator-start');
11
+ const { validatorStatus } = require('./commands/validator-status');
12
+ const { init } = require('./commands/init');
13
+ const { monitorLoop } = require('./commands/monitor');
14
+ const { logsCommand } = require('./commands/logs');
15
+ const { sdkCommand } = require('./commands/sdk');
16
+ const { snapshotCommand } = require('./commands/snapshot');
17
+ const { walletCommand } = require('./commands/wallet');
18
+ const { networkCommand } = require('./commands/network');
19
+ const { validatorsListCommand } = require('./commands/validators');
20
+ const { delegationsCommand } = require('./commands/delegations');
21
+ const { rewardsCommand } = require('./commands/rewards');
22
+ const readline = require('readline');
23
+
24
+ // CLI version
25
+ const VERSION = '1.0.5';
26
+
27
+ // Parse args early to support flags on commands
28
+ function getCommandArgs() {
29
+ return process.argv.slice(2);
30
+ }
31
+
32
+ // Tier colours
33
+ const TIER_COLORS = {
34
+ FULL: '\x1b[36m', // cyan
35
+ LITE: '\x1b[33m', // yellow
36
+ OBSERVER: '\x1b[32m', // green
37
+ reset: '\x1b[0m',
38
+ };
39
+
40
+ /**
41
+ * Display the interactive main menu
42
+ */
43
+ async function showMenu() {
44
+ const rl = readline.createInterface({
45
+ input: process.stdin,
46
+ output: process.stdout,
47
+ });
48
+
49
+ const prompt = (q) => new Promise((res) => rl.question(q, res));
50
+
51
+ console.log(
52
+ TIER_COLORS.FULL + '\n ╔═══════════════════════════════════════════════╗\n' +
53
+ ' ║ AETHER CHAIN Validator Setup Wizard ║\n' +
54
+ ' ╚═══════════════════════════════════════════════╝' + TIER_COLORS.reset + '\n'
55
+ );
56
+
57
+ console.log(' Welcome to AeTHer Chain. What would you like to do?\n');
58
+ console.log(' ' + TIER_COLORS.FULL + '1)' + TIER_COLORS.reset + ' 🩺 Doctor Check if your system meets requirements');
59
+ console.log(' ' + TIER_COLORS.FULL + '2)' + TIER_COLORS.reset + ' 🚀 Start — Begin validator onboarding (recommended)');
60
+ console.log(' ' + TIER_COLORS.FULL + '3)' + TIER_COLORS.reset + ' 📊 Monitor — Watch live validator stats');
61
+ console.log(' ' + TIER_COLORS.FULL + '4)' + TIER_COLORS.reset + ' 📋 Logs — Tail and colourise validator logs');
62
+ console.log(' ' + TIER_COLORS.FULL + '5)' + TIER_COLORS.reset + ' 📦 SDK — Get SDK links and install tools');
63
+ console.log(' ' + TIER_COLORS.FULL + '6)' + TIER_COLORS.reset + ' 🌐 Network — Aether network status (slot, peers, TPS)');
64
+ console.log(' ' + TIER_COLORS.FULL + '7)' + TIER_COLORS.reset + ' ❓ Help — Show all commands\n');
65
+ console.log(' ' + TIER_COLORS.reset + ' Type a number or command name. Press Ctrl+C to exit.\n');
66
+
67
+ const VALID_CHOICES = ['1', '2', '3', '4', '5', '6', '7', 'doctor', 'init', 'monitor', 'logs', 'sdk', 'network', 'help'];
68
+
69
+ while (true) {
70
+ const answer = (await prompt(` > `)).trim().toLowerCase();
71
+
72
+ if (answer === '' || answer === '1' || answer === 'doctor') {
73
+ rl.close();
74
+ const { doctorCommand } = require('./commands/doctor');
75
+ doctorCommand({ autoFix: false, tier: 'full' });
76
+ return;
77
+ }
78
+
79
+ if (answer === '2' || answer === 'init' || answer === 'start') {
80
+ rl.close();
81
+ const { init } = require('./commands/init');
82
+ init();
83
+ return;
84
+ }
85
+
86
+ if (answer === '3' || answer === 'monitor') {
87
+ rl.close();
88
+ const { main } = require('./commands/monitor');
89
+ main();
90
+ return;
91
+ }
92
+
93
+ if (answer === '4' || answer === 'logs') {
94
+ rl.close();
95
+ const { logsCommand } = require('./commands/logs');
96
+ logsCommand();
97
+ return;
98
+ }
99
+
100
+ if (answer === '5' || answer === 'sdk') {
101
+ rl.close();
102
+ const { sdkCommand } = require('./commands/sdk');
103
+ const { snapshotCommand } = require('./commands/snapshot');
104
+ sdkCommand();
105
+ return;
106
+ }
107
+
108
+ if (answer === '6' || answer === 'network') {
109
+ rl.close();
110
+ const { networkCommand } = require('./commands/network');
111
+ networkCommand();
112
+ return;
113
+ }
114
+
115
+ if (answer === '7' || answer === 'help') {
116
+ showHelp();
117
+ console.log(" Press Ctrl+C to exit or select an option above.\n");
118
+ continue;
119
+ }
120
+
121
+ console.log(`\n ⚠️ Unknown option: "${answer}". Type 1-6 or a command name.\n`);
122
+ }
123
+ }
124
+
125
+ // Available commands
126
+ const COMMANDS = {
127
+ start: {
128
+ description: 'Launch interactive menu (default if no args) — same as running aether-cli with no arguments',
129
+ handler: () => showMenu(),
130
+ },
131
+ doctor: {
132
+ description: 'Run system requirements checks (CPU/RAM/Disk/Network/Firewall)',
133
+ handler: () => {
134
+ const args = getCommandArgs();
135
+ const autoFix = args.includes('--fix') || args.includes('-f');
136
+
137
+ // Parse --tier flag
138
+ let tier = 'full';
139
+ const tierIndex = args.findIndex(arg => arg === '--tier');
140
+ if (tierIndex !== -1 && args[tierIndex + 1]) {
141
+ tier = args[tierIndex + 1].toLowerCase();
142
+ }
143
+
144
+ doctorCommand({ autoFix, tier });
145
+ },
146
+ },
147
+ init: {
148
+ description: 'Start onboarding wizard (generate identity, create stake account, connect to testnet)',
149
+ handler: init,
150
+ },
151
+ 'kyc generate': {
152
+ description: 'Generate pre-filled KYC link with pubkey, node ID, signature',
153
+ handler: () => console.log('🚧 kyc generate command under development'),
154
+ },
155
+ monitor: {
156
+ description: 'Real-time validator dashboard (slot, block height, peers, TPS)',
157
+ handler: () => {
158
+ // monitor command runs its own loop
159
+ const { main } = require('./commands/monitor');
160
+ main();
161
+ },
162
+ },
163
+ logs: {
164
+ description: 'Tail validator logs with colour-coded output (ERROR=red, WARN=yellow, INFO=green)',
165
+ handler: logsCommand,
166
+ },
167
+ sdk: {
168
+ description: 'Aether SDK download links and install instructions (JS, Rust, FLUX/ATH tokens)',
169
+ handler: sdkCommand,
170
+ },
171
+ wallet: {
172
+ description: 'Wallet management — create, import, list, default, connect, balance, stake, transfer',
173
+ handler: () => {
174
+ const { walletCommand } = require('./commands/wallet');
175
+ walletCommand();
176
+ },
177
+ },
178
+ stake: {
179
+ description: 'Stake AETH to a validator — aether stake --validator <addr> --amount <aeth>',
180
+ handler: () => {
181
+ const { walletCommand } = require('./commands/wallet');
182
+ // Intercept argv so walletCommand receives 'stake' as the subcmd
183
+ const originalArgv = process.argv;
184
+ process.argv = [...originalArgv.slice(0, 2), 'wallet', 'stake', ...originalArgv.slice(3)];
185
+ walletCommand();
186
+ process.argv = originalArgv;
187
+ },
188
+ },
189
+ transfer: {
190
+ description: 'Transfer AETH to another address — aether transfer --to <addr> --amount <aeth>',
191
+ handler: () => {
192
+ const { walletCommand } = require('./commands/wallet');
193
+ const originalArgv = process.argv;
194
+ process.argv = [...originalArgv.slice(0, 2), 'wallet', 'transfer', ...originalArgv.slice(3)];
195
+ walletCommand();
196
+ process.argv = originalArgv;
197
+ },
198
+ },
199
+ tx: {
200
+ description: 'Transaction history aether tx history --address <addr> [--limit 20] [--json]',
201
+ handler: () => {
202
+ const { walletCommand } = require('./commands/wallet');
203
+ const originalArgv = process.argv;
204
+ process.argv = [...originalArgv.slice(0, 2), 'wallet', 'history', ...originalArgv.slice(3)];
205
+ walletCommand();
206
+ process.argv = originalArgv;
207
+ },
208
+ },
209
+ network: {
210
+ description: 'Aether network status — slot, block height, peers, TPS, epoch info',
211
+ handler: () => {
212
+ const { networkCommand } = require('./commands/network');
213
+ networkCommand();
214
+ },
215
+ },
216
+ history: {
217
+ description: 'Transaction history for an address — alias for tx history',
218
+ handler: () => {
219
+ const { walletCommand } = require('./commands/wallet');
220
+ const originalArgv = process.argv;
221
+ process.argv = [...originalArgv.slice(0, 2), 'wallet', 'history', ...originalArgv.slice(3)];
222
+ walletCommand();
223
+ process.argv = originalArgv;
224
+ },
225
+ },
226
+ validator: {
227
+ description: 'Validator node management',
228
+ handler: () => {
229
+ // Handle validator subcommands
230
+ const subcmd = process.argv[3];
231
+
232
+ if (!subcmd) {
233
+ console.log('Usage: aether-cli validator <command>');
234
+ console.log('');
235
+ console.log('Commands:');
236
+ console.log(' start Start the validator node');
237
+ console.log(' status Check validator status');
238
+ console.log('');
239
+ return;
240
+ }
241
+
242
+ switch (subcmd) {
243
+ case 'start':
244
+ validatorStart();
245
+ break;
246
+ case 'status':
247
+ validatorStatus();
248
+ break;
249
+ default:
250
+ console.error(`Unknown validator command: ${subcmd}`);
251
+ console.error('Valid commands: start, status');
252
+ process.exit(1);
253
+ }
254
+ },
255
+ },
256
+ delegations: {
257
+ description: 'List/claim stake delegations — aether delegations list --address <addr>',
258
+ handler: () => {
259
+ delegationsCommand();
260
+ },
261
+ },
262
+ rewards: {
263
+ description: 'View staking rewards — aether rewards list --address <addr> | rewards summary | rewards claim',
264
+ handler: () => {
265
+ rewardsCommand();
266
+ },
267
+ },
268
+ snapshot: {
269
+ description: 'Node sync status, snapshot slot info, and network slot comparison',
270
+ handler: () => {
271
+ const { snapshotCommand } = require('./commands/snapshot');
272
+ snapshotCommand();
273
+ },
274
+ },
275
+ validators: {
276
+ description: 'List active validators — aether validators list [--tier full|lite|observer] [--json]',
277
+ handler: () => {
278
+ validatorsListCommand();
279
+ },
280
+ },
281
+ help: {
282
+ description: 'Show this help message',
283
+ handler: showHelp,
284
+ },
285
+ version: {
286
+ description: 'Show version number',
287
+ handler: () => console.log(`aether-cli v${VERSION}`),
288
+ },
289
+ };
290
+
291
+ /**
292
+ * Display help message with ASCII art
293
+ */
294
+ function showHelp() {
295
+ const header = `
296
+ ███╗ ███╗██╗███████╗███████╗██╗ ██████╗ ███╗ ██╗
297
+ ████╗ ████║██║██╔════╝██╔════╝██║██╔═══██╗████╗ ██║
298
+ ██╔████╔██║██║███████╗███████╗██║██║ ██║██╔██╗ ██║
299
+ ██║╚██╔╝██║██║╚════██║╚════██║██║██║ ██║██║╚██╗██║
300
+ ██║ ╚═╝ ██║██║███████║███████║██║╚██████╔╝██║ ╚████║
301
+ ╚═╝ ╚═╝╚═╝╚══════╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝
302
+
303
+ Validator CLI v${VERSION}
304
+ `.trim();
305
+
306
+ console.log(header);
307
+ console.log('\nUsage: aether-cli <command> [options]\n');
308
+ console.log('Commands:');
309
+ Object.entries(COMMANDS).forEach(([cmd, info]) => {
310
+ console.log(` ${cmd.padEnd(18)} ${info.description}`);
311
+ });
312
+ console.log('\nExamples:');
313
+ console.log(' aether-cli doctor # Check system requirements');
314
+ console.log(' aether-cli init # Start onboarding wizard');
315
+ console.log(' aether-cli monitor # Real-time validator dashboard');
316
+ console.log(' aether-cli validator start # Start validator node');
317
+ console.log(' aether-cli validator status # Check validator status');
318
+ console.log(' aether-cli wallet balance # Query AETH balance');
319
+ console.log(' aether-cli network # Network status, peers, slot info');
320
+ console.log(' aether-cli network --peers # Detailed peer list');
321
+ console.log(' aether-cli tx history # Show transaction history');
322
+ console.log(' aether-cli --version # Show version');
323
+ console.log('\nDocumentation: https://github.com/jelly-legs-ai/Jelly-legs-unsteady-workshop');
324
+ console.log('Spec: docs/MINING_VALIDATOR_TOOLS.md\n');
325
+ }
326
+
327
+ /**
328
+ * Parse command line arguments
329
+ */
330
+ function parseArgs() {
331
+ const args = process.argv.slice(2);
332
+
333
+ // Handle version flag
334
+ if (args.includes('--version') || args.includes('-v')) {
335
+ return 'version';
336
+ }
337
+
338
+ // No args → interactive menu
339
+ if (args.length === 0) {
340
+ return 'start';
341
+ }
342
+
343
+ // Handle multi-word commands (e.g., "validator start", "kyc generate")
344
+ if (args.length >= 2) {
345
+ const multiCmd = `${args[0]} ${args[1]}`;
346
+ if (COMMANDS[multiCmd]) {
347
+ return multiCmd;
348
+ }
349
+ }
350
+
351
+ // Single word command
352
+ return args[0] || 'help';
353
+ }
354
+
355
+ /**
356
+ * Main CLI entry point
357
+ */
358
+ function main() {
359
+ const command = parseArgs();
360
+
361
+ if (COMMANDS[command]) {
362
+ COMMANDS[command].handler();
363
+ } else {
364
+ console.error(`❌ Unknown command: ${command}`);
365
+ console.error('Run "aether-cli help" for usage.\n');
366
+ process.exit(1);
367
+ }
368
+ }
369
+
370
+ // Run CLI
371
+ main();