propelix-cli 0.2.0 → 0.3.0-dev1
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/index.cjs +20 -3
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -21338,13 +21338,30 @@ function registerTestCommand(program3) {
|
|
|
21338
21338
|
});
|
|
21339
21339
|
}
|
|
21340
21340
|
|
|
21341
|
+
// src/lib/proxy.ts
|
|
21342
|
+
function setupProxy(proxyUrl) {
|
|
21343
|
+
if (proxyUrl) {
|
|
21344
|
+
process.env.HTTPS_PROXY = proxyUrl;
|
|
21345
|
+
process.env.HTTP_PROXY = proxyUrl;
|
|
21346
|
+
}
|
|
21347
|
+
const effectiveProxy = proxyUrl || process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy;
|
|
21348
|
+
if (!effectiveProxy) {
|
|
21349
|
+
return;
|
|
21350
|
+
}
|
|
21351
|
+
const { EnvHttpProxyAgent, setGlobalDispatcher } = require("undici");
|
|
21352
|
+
const agent = new EnvHttpProxyAgent();
|
|
21353
|
+
setGlobalDispatcher(agent);
|
|
21354
|
+
}
|
|
21355
|
+
|
|
21341
21356
|
// src/index.ts
|
|
21342
21357
|
var program2 = new Command();
|
|
21343
|
-
program2.name("propelix").description("Propelix CLI").version("0.
|
|
21358
|
+
program2.name("propelix").description("Propelix CLI").version("0.3.0-dev1").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
21359
|
program2.hook("preAction", () => {
|
|
21345
|
-
|
|
21360
|
+
const globalOpts = program2.opts();
|
|
21361
|
+
if (globalOpts.insecure) {
|
|
21346
21362
|
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
|
|
21347
21363
|
}
|
|
21364
|
+
setupProxy(globalOpts.proxy);
|
|
21348
21365
|
});
|
|
21349
21366
|
registerAuthCommand(program2);
|
|
21350
21367
|
registerConfigCommand(program2);
|
|
@@ -21360,7 +21377,7 @@ registerImageCommand(program2);
|
|
|
21360
21377
|
registerChatCommand(program2);
|
|
21361
21378
|
registerTestCommand(program2);
|
|
21362
21379
|
program2.command("version").description("Print version number").action(() => {
|
|
21363
|
-
console.log("0.
|
|
21380
|
+
console.log("0.3.0-dev1");
|
|
21364
21381
|
});
|
|
21365
21382
|
program2.command("whoami").description("Show the currently authenticated user").action(async () => {
|
|
21366
21383
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "propelix-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-dev1",
|
|
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",
|