@trading-boy/cli 1.2.13 → 1.2.14
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 +20 -6
- package/dist/commands/config-cmd.js +25 -7
- package/package.json +1 -1
package/dist/cli.bundle.js
CHANGED
|
@@ -49898,8 +49898,13 @@ function writeEnvValue(filePath, key, value) {
|
|
|
49898
49898
|
function registerConfigCommand(program2) {
|
|
49899
49899
|
const configCmd = program2.command("config").description("Configuration management commands");
|
|
49900
49900
|
configCmd.command("show").description("Display current configuration (sensitive values redacted)").addOption(new Option("--format <format>", "Output format").choices(["text", "json"]).default("text")).action((options) => {
|
|
49901
|
+
let config2 = null;
|
|
49901
49902
|
try {
|
|
49902
|
-
|
|
49903
|
+
config2 = getConfig();
|
|
49904
|
+
} catch {
|
|
49905
|
+
config2 = null;
|
|
49906
|
+
}
|
|
49907
|
+
if (config2) {
|
|
49903
49908
|
if (options.format === "json") {
|
|
49904
49909
|
const configRecord = config2;
|
|
49905
49910
|
const redacted = {};
|
|
@@ -49911,11 +49916,20 @@ function registerConfigCommand(program2) {
|
|
|
49911
49916
|
} else {
|
|
49912
49917
|
console.log(formatConfigOutput(config2));
|
|
49913
49918
|
}
|
|
49914
|
-
}
|
|
49915
|
-
|
|
49916
|
-
|
|
49917
|
-
|
|
49918
|
-
|
|
49919
|
+
} else {
|
|
49920
|
+
console.log(source_default.yellow(" Note: Full config validation unavailable (server env vars not set)\n"));
|
|
49921
|
+
const redacted = {};
|
|
49922
|
+
for (const key of VALID_KEYS) {
|
|
49923
|
+
const value = process.env[key];
|
|
49924
|
+
redacted[key] = value !== void 0 ? redactValue(key, value) : source_default.dim("(not set)");
|
|
49925
|
+
}
|
|
49926
|
+
if (options.format === "json") {
|
|
49927
|
+
console.log(JSON.stringify(redacted, null, 2));
|
|
49928
|
+
} else {
|
|
49929
|
+
for (const [key, value] of Object.entries(redacted)) {
|
|
49930
|
+
console.log(` ${source_default.cyan(key.padEnd(30))} ${value}`);
|
|
49931
|
+
}
|
|
49932
|
+
}
|
|
49919
49933
|
}
|
|
49920
49934
|
});
|
|
49921
49935
|
configCmd.command("set <key> <value>").description("Set a config value in the .env file").action((key, value) => {
|
|
@@ -222,10 +222,17 @@ export function registerConfigCommand(program) {
|
|
|
222
222
|
.description('Display current configuration (sensitive values redacted)')
|
|
223
223
|
.addOption(new Option('--format <format>', 'Output format').choices(['text', 'json']).default('text'))
|
|
224
224
|
.action((options) => {
|
|
225
|
+
let config = null;
|
|
225
226
|
try {
|
|
226
|
-
|
|
227
|
+
config = getConfig();
|
|
228
|
+
}
|
|
229
|
+
catch {
|
|
230
|
+
// Config validation failed (e.g. missing DB passwords in CLI-only mode)
|
|
231
|
+
// Fall back to showing raw env vars
|
|
232
|
+
config = null;
|
|
233
|
+
}
|
|
234
|
+
if (config) {
|
|
227
235
|
if (options.format === 'json') {
|
|
228
|
-
// Build a redacted config object for JSON output
|
|
229
236
|
const configRecord = config;
|
|
230
237
|
const redacted = {};
|
|
231
238
|
for (const key of VALID_KEYS) {
|
|
@@ -238,11 +245,22 @@ export function registerConfigCommand(program) {
|
|
|
238
245
|
console.log(formatConfigOutput(config));
|
|
239
246
|
}
|
|
240
247
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
248
|
+
else {
|
|
249
|
+
// Graceful fallback: show available env vars without full validation
|
|
250
|
+
console.log(chalk.yellow(' Note: Full config validation unavailable (server env vars not set)\n'));
|
|
251
|
+
const redacted = {};
|
|
252
|
+
for (const key of VALID_KEYS) {
|
|
253
|
+
const value = process.env[key];
|
|
254
|
+
redacted[key] = value !== undefined ? redactValue(key, value) : chalk.dim('(not set)');
|
|
255
|
+
}
|
|
256
|
+
if (options.format === 'json') {
|
|
257
|
+
console.log(JSON.stringify(redacted, null, 2));
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
for (const [key, value] of Object.entries(redacted)) {
|
|
261
|
+
console.log(` ${chalk.cyan(key.padEnd(30))} ${value}`);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
246
264
|
}
|
|
247
265
|
});
|
|
248
266
|
// ─── config set ───
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trading-boy/cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.14",
|
|
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": {
|