@spfunctions/cli 1.5.1 → 1.5.2

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -518,6 +518,15 @@ async function run(fn) {
518
518
  }
519
519
  catch (err) {
520
520
  const msg = err instanceof Error ? err.message : String(err);
521
+ // If --json flag is present, output structured JSON error
522
+ if (process.argv.includes('--json')) {
523
+ console.log(JSON.stringify({
524
+ error: msg,
525
+ code: err.code || 'CLI_ERROR',
526
+ status: err.status || 1,
527
+ }));
528
+ process.exit(1);
529
+ }
521
530
  (0, utils_js_1.die)(msg);
522
531
  }
523
532
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spfunctions/cli",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "Prediction market intelligence CLI. Causal thesis model, 24/7 Kalshi/Polymarket scan, live orderbook, edge detection. Interactive agent mode with tool calling.",
5
5
  "bin": {
6
6
  "sf": "./dist/index.js"