@forge/cli

12.10.1-next.512.10.1-next.6-experimental-a8bc05b
out/command-line/index.js
out/command-line/index.js
+12
Index: package/out/command-line/index.js
===================================================================
--- package/out/command-line/index.js
+++ package/out/command-line/index.js
@@ -1,8 +1,9 @@
 "use strict";
 Object.defineProperty(exports, "__esModule", { value: true });
 exports.main = exports.registerCommands = void 0;
 const cli_shared_1 = require("@forge/cli-shared");
+const global_agent_1 = require("global-agent");
 const dependency_injection_1 = require("./dependency-injection");
 const version_info_1 = require("./version-info");
 const register_app_commands_1 = require("./register-app-commands");
 const register_authentication_command_1 = require("./register-authentication-command");
@@ -26,8 +27,18 @@
 const register_show_commands_1 = require("./register-show-commands");
 const register_assistant_commands_1 = require("./register-assistant-commands");
 const register_repositories_commands_1 = require("./register-repositories-commands");
 const register_custom_scopes_commands_1 = require("./register-custom-scopes-commands");
+const cli_shared_2 = require("@forge/cli-shared");
+function setupProxy() {
+    const cachedConf = cli_shared_2.CachedConf.getCache(cli_shared_2.CONFIG_PROJECT_NAME);
+    const proxyUrl = cachedConf.get('proxy');
+    if (proxyUrl) {
+        console.log(`⚠️ Using proxy: ${proxyUrl}`);
+        (0, global_agent_1.bootstrap)();
+        globalThis.GLOBAL_AGENT.HTTP_PROXY = proxyUrl;
+    }
+}
 async function registerCommands(deps) {
     (0, register_autocomplete_commands_1.registerCommands)(deps);
     (0, register_authentication_command_1.registerCommands)(deps);
     await (0, register_app_commands_1.registerCommands)(deps);
@@ -58,8 +69,9 @@
         await (0, cli_shared_1.exitOnError)(ui, reason);
     });
 };
 const main = async () => {
+    setupProxy();
     const cliDetails = (0, version_info_1.getCLIDetails)();
     const deps = await (0, dependency_injection_1.getDependencies)(cliDetails);
     registerEvents(deps);
     await registerCommands(deps);