propelix-cli 0.2.0 → 0.3.0

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.cjs +23 -3
  2. package/package.json +3 -2
package/dist/index.cjs CHANGED
@@ -19562,6 +19562,9 @@ function handleError(error) {
19562
19562
  console.error(import_chalk.default.red("API Error:"), messages);
19563
19563
  } else {
19564
19564
  console.error(import_chalk.default.red("Error:"), error.message);
19565
+ if (error.cause) {
19566
+ console.error(import_chalk.default.dim("Cause:"), error.cause instanceof Error ? error.cause.message : String(error.cause));
19567
+ }
19565
19568
  }
19566
19569
  } else {
19567
19570
  console.error(import_chalk.default.red("Error:"), String(error));
@@ -21338,13 +21341,30 @@ function registerTestCommand(program3) {
21338
21341
  });
21339
21342
  }
21340
21343
 
21344
+ // src/lib/proxy.ts
21345
+ function setupProxy(proxyUrl) {
21346
+ if (proxyUrl) {
21347
+ process.env.HTTPS_PROXY = proxyUrl;
21348
+ process.env.HTTP_PROXY = proxyUrl;
21349
+ }
21350
+ const effectiveProxy = proxyUrl || process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy;
21351
+ if (!effectiveProxy) {
21352
+ return;
21353
+ }
21354
+ const { EnvHttpProxyAgent, setGlobalDispatcher } = require("undici");
21355
+ const agent = new EnvHttpProxyAgent();
21356
+ setGlobalDispatcher(agent);
21357
+ }
21358
+
21341
21359
  // src/index.ts
21342
21360
  var program2 = new Command();
21343
- program2.name("propelix").description("Propelix CLI").version("0.2.0").option("--base-url <url>", "API base URL (default: https://propelix.ai)").option("--token <token>", "Auth token (overrides stored config)").option("--project-id <id>", "Project ID (overrides stored config)").option("--insecure", "Disable TLS certificate verification (for local dev)").option("--json", "Output as JSON (deprecated, use --format json)").option("--format <fmt>", "Output format: json (default) | table");
21361
+ program2.name("propelix").description("Propelix CLI").version("0.3.0").option("--base-url <url>", "API base URL (default: https://propelix.ai)").option("--token <token>", "Auth token (overrides stored config)").option("--project-id <id>", "Project ID (overrides stored config)").option("--insecure", "Disable TLS certificate verification (for local dev)").option("--proxy <url>", "HTTP(S) proxy URL (overrides HTTPS_PROXY / HTTP_PROXY env vars)").option("--json", "Output as JSON (deprecated, use --format json)").option("--format <fmt>", "Output format: json (default) | table");
21344
21362
  program2.hook("preAction", () => {
21345
- if (program2.opts().insecure) {
21363
+ const globalOpts = program2.opts();
21364
+ if (globalOpts.insecure) {
21346
21365
  process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
21347
21366
  }
21367
+ setupProxy(globalOpts.proxy);
21348
21368
  });
21349
21369
  registerAuthCommand(program2);
21350
21370
  registerConfigCommand(program2);
@@ -21360,7 +21380,7 @@ registerImageCommand(program2);
21360
21380
  registerChatCommand(program2);
21361
21381
  registerTestCommand(program2);
21362
21382
  program2.command("version").description("Print version number").action(() => {
21363
- console.log("0.2.0");
21383
+ console.log("0.3.0");
21364
21384
  });
21365
21385
  program2.command("whoami").description("Show the currently authenticated user").action(async () => {
21366
21386
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "propelix-cli",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "CLI for Propelix",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {
@@ -14,7 +14,8 @@
14
14
  "commander": "^12.1.0",
15
15
  "graphql-request": "^7.1.2",
16
16
  "gray-matter": "^4.0.3",
17
- "ora": "^5.4.1"
17
+ "ora": "^5.4.1",
18
+ "undici": "^6.19.8"
18
19
  },
19
20
  "devDependencies": {
20
21
  "tsup": "^8.3.5",