@trading-boy/cli 1.2.14 → 1.2.15

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.
@@ -50252,6 +50252,7 @@ function registerLoginCommand(program2) {
50252
50252
 
50253
50253
  // dist/commands/logout.js
50254
50254
  init_source();
50255
+ init_esm15();
50255
50256
  var logger20 = createLogger("cli-logout");
50256
50257
  async function executeLogout() {
50257
50258
  const existing = await loadCredentials();
@@ -50263,15 +50264,28 @@ async function executeLogout() {
50263
50264
  function registerLogoutCommand(program2) {
50264
50265
  program2.command("logout").description("Clear stored API key and credentials").action(async () => {
50265
50266
  try {
50266
- const result = await executeLogout();
50267
- console.log("");
50268
- if (result.wasAuthenticated) {
50269
- console.log(source_default.green(` Logged out successfully.`));
50270
- console.log(` ${source_default.gray("Cleared key:")} ${result.redactedKey}`);
50271
- } else {
50267
+ const existing = await loadCredentials();
50268
+ if (!existing) {
50269
+ console.log("");
50272
50270
  console.log(source_default.dim(" No credentials found \u2014 already logged out."));
50271
+ console.log("");
50272
+ return;
50273
50273
  }
50274
50274
  console.log("");
50275
+ console.log(source_default.yellow(" Warning: Your API key will be cleared from this machine."));
50276
+ console.log(source_default.yellow(" You will need your API key to log back in."));
50277
+ console.log(source_default.yellow(" There is no way to recover a lost key \u2014 a new one must be provisioned."));
50278
+ console.log("");
50279
+ const proceed = await esm_default4({ message: "Are you sure you want to logout?" });
50280
+ if (!proceed) {
50281
+ console.log(source_default.dim(" Logout cancelled."));
50282
+ return;
50283
+ }
50284
+ const result = await executeLogout();
50285
+ console.log("");
50286
+ console.log(source_default.green(` Logged out successfully.`));
50287
+ console.log(` ${source_default.gray("Cleared key:")} ${result.redactedKey}`);
50288
+ console.log("");
50275
50289
  } catch (error49) {
50276
50290
  const message = error49 instanceof Error ? error49.message : String(error49);
50277
50291
  logger20.error({ error: message }, "Logout failed");
@@ -1,6 +1,7 @@
1
1
  import chalk from 'chalk';
2
2
  import { createLogger } from '@trading-boy/core';
3
3
  import { clearCredentials, loadCredentials, redactApiKey } from '../credentials.js';
4
+ import { confirm } from '@inquirer/prompts';
4
5
  const logger = createLogger('cli-logout');
5
6
  // ─── Logout Logic ───
6
7
  export async function executeLogout() {
@@ -17,15 +18,27 @@ export function registerLogoutCommand(program) {
17
18
  .description('Clear stored API key and credentials')
18
19
  .action(async () => {
19
20
  try {
20
- const result = await executeLogout();
21
- console.log('');
22
- if (result.wasAuthenticated) {
23
- console.log(chalk.green(` Logged out successfully.`));
24
- console.log(` ${chalk.gray('Cleared key:')} ${result.redactedKey}`);
25
- }
26
- else {
21
+ const existing = await loadCredentials();
22
+ if (!existing) {
23
+ console.log('');
27
24
  console.log(chalk.dim(' No credentials found — already logged out.'));
25
+ console.log('');
26
+ return;
27
+ }
28
+ console.log('');
29
+ console.log(chalk.yellow(' Warning: Your API key will be cleared from this machine.'));
30
+ console.log(chalk.yellow(' You will need your API key to log back in.'));
31
+ console.log(chalk.yellow(' There is no way to recover a lost key — a new one must be provisioned.'));
32
+ console.log('');
33
+ const proceed = await confirm({ message: 'Are you sure you want to logout?' });
34
+ if (!proceed) {
35
+ console.log(chalk.dim(' Logout cancelled.'));
36
+ return;
28
37
  }
38
+ const result = await executeLogout();
39
+ console.log('');
40
+ console.log(chalk.green(` Logged out successfully.`));
41
+ console.log(` ${chalk.gray('Cleared key:')} ${result.redactedKey}`);
29
42
  console.log('');
30
43
  }
31
44
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trading-boy/cli",
3
- "version": "1.2.14",
3
+ "version": "1.2.15",
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": {