@trading-boy/cli 1.4.0 → 1.4.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/dist/cli.bundle.js +22 -4
- package/dist/commands/subscribe.js +10 -3
- package/dist/commands/whoami.js +14 -0
- package/package.json +1 -1
package/dist/cli.bundle.js
CHANGED
|
@@ -54633,9 +54633,21 @@ function formatWhoamiOutput(result) {
|
|
|
54633
54633
|
return lines.join("\n");
|
|
54634
54634
|
}
|
|
54635
54635
|
function registerWhoamiCommand(program2) {
|
|
54636
|
-
program2.command("whoami").description("Show current authentication status").addOption(new Option("--format <format>", "Output format").choices(["text", "json"]).default("text")).action(async (options) => {
|
|
54636
|
+
program2.command("whoami").description("Show current authentication status").addOption(new Option("--format <format>", "Output format").choices(["text", "json"]).default("text")).addOption(new Option("--show-key", "Show full API key (for Telegram setup)")).action(async (options) => {
|
|
54637
54637
|
try {
|
|
54638
54638
|
const result = await executeWhoami();
|
|
54639
|
+
if (options.showKey && result.authenticated) {
|
|
54640
|
+
const envKey = process.env.TRADING_BOY_API_KEY;
|
|
54641
|
+
if (envKey) {
|
|
54642
|
+
console.log(envKey);
|
|
54643
|
+
return;
|
|
54644
|
+
}
|
|
54645
|
+
const creds = await loadCredentials();
|
|
54646
|
+
if (creds) {
|
|
54647
|
+
console.log(creds.apiKey);
|
|
54648
|
+
return;
|
|
54649
|
+
}
|
|
54650
|
+
}
|
|
54639
54651
|
if (options.format === "json") {
|
|
54640
54652
|
console.log(JSON.stringify(result, null, 2));
|
|
54641
54653
|
} else {
|
|
@@ -55046,12 +55058,18 @@ function formatSubscribeSuccess(result) {
|
|
|
55046
55058
|
if (result.plan) {
|
|
55047
55059
|
lines.push(` ${source_default.bold("Plan:")} ${result.plan}`);
|
|
55048
55060
|
}
|
|
55049
|
-
if (result.
|
|
55061
|
+
if (result.apiKey) {
|
|
55062
|
+
lines.push(` ${source_default.bold("API Key:")} ${source_default.yellow(result.apiKey)}`);
|
|
55063
|
+
lines.push("");
|
|
55064
|
+
lines.push(source_default.dim(" \u26A0\uFE0F Copy this key now \u2014 it will not be shown again."));
|
|
55065
|
+
lines.push(source_default.dim(" Use it to connect Telegram: send /start to @TradingBoyBot"));
|
|
55066
|
+
lines.push(source_default.dim(" and paste the key when prompted."));
|
|
55067
|
+
} else if (result.keyPrefix) {
|
|
55050
55068
|
lines.push(` ${source_default.bold("Key ID:")} ${result.keyPrefix}`);
|
|
55051
55069
|
}
|
|
55052
55070
|
lines.push("");
|
|
55053
|
-
lines.push(source_default.dim(" Your API key has been stored
|
|
55054
|
-
lines.push(source_default.dim(" You can
|
|
55071
|
+
lines.push(source_default.dim(" Your API key has been stored locally."));
|
|
55072
|
+
lines.push(source_default.dim(" You can also view it anytime: trading-boy whoami --show-key"));
|
|
55055
55073
|
lines.push("");
|
|
55056
55074
|
lines.push(source_default.cyan(" Try it: trading-boy context SOL"));
|
|
55057
55075
|
lines.push("");
|
|
@@ -213,12 +213,19 @@ export function formatSubscribeSuccess(result) {
|
|
|
213
213
|
if (result.plan) {
|
|
214
214
|
lines.push(` ${chalk.bold('Plan:')} ${result.plan}`);
|
|
215
215
|
}
|
|
216
|
-
if (result.
|
|
216
|
+
if (result.apiKey) {
|
|
217
|
+
lines.push(` ${chalk.bold('API Key:')} ${chalk.yellow(result.apiKey)}`);
|
|
218
|
+
lines.push('');
|
|
219
|
+
lines.push(chalk.dim(' ⚠️ Copy this key now — it will not be shown again.'));
|
|
220
|
+
lines.push(chalk.dim(' Use it to connect Telegram: send /start to @TradingBoyBot'));
|
|
221
|
+
lines.push(chalk.dim(' and paste the key when prompted.'));
|
|
222
|
+
}
|
|
223
|
+
else if (result.keyPrefix) {
|
|
217
224
|
lines.push(` ${chalk.bold('Key ID:')} ${result.keyPrefix}`);
|
|
218
225
|
}
|
|
219
226
|
lines.push('');
|
|
220
|
-
lines.push(chalk.dim(' Your API key has been stored
|
|
221
|
-
lines.push(chalk.dim(' You can
|
|
227
|
+
lines.push(chalk.dim(' Your API key has been stored locally.'));
|
|
228
|
+
lines.push(chalk.dim(' You can also view it anytime: trading-boy whoami --show-key'));
|
|
222
229
|
lines.push('');
|
|
223
230
|
lines.push(chalk.cyan(' Try it: trading-boy context SOL'));
|
|
224
231
|
lines.push('');
|
package/dist/commands/whoami.js
CHANGED
|
@@ -68,9 +68,23 @@ export function registerWhoamiCommand(program) {
|
|
|
68
68
|
.command('whoami')
|
|
69
69
|
.description('Show current authentication status')
|
|
70
70
|
.addOption(new Option('--format <format>', 'Output format').choices(['text', 'json']).default('text'))
|
|
71
|
+
.addOption(new Option('--show-key', 'Show full API key (for Telegram setup)'))
|
|
71
72
|
.action(async (options) => {
|
|
72
73
|
try {
|
|
73
74
|
const result = await executeWhoami();
|
|
75
|
+
// Show full key if requested
|
|
76
|
+
if (options.showKey && result.authenticated) {
|
|
77
|
+
const envKey = process.env.TRADING_BOY_API_KEY;
|
|
78
|
+
if (envKey) {
|
|
79
|
+
console.log(envKey);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const creds = await loadCredentials();
|
|
83
|
+
if (creds) {
|
|
84
|
+
console.log(creds.apiKey);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
74
88
|
if (options.format === 'json') {
|
|
75
89
|
console.log(JSON.stringify(result, null, 2));
|
|
76
90
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trading-boy/cli",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Trading Boy CLI — crypto context intelligence for traders and AI agents. Query real-time prices, funding rates, whale activity, and DeFi risk for 100+ Solana tokens and 229 Hyperliquid perpetuals.",
|
|
5
5
|
"homepage": "https://cabal.ventures",
|
|
6
6
|
"repository": {
|