@@ -7,6 +7,7 @@ import { serve, type ServerHandler } from "srvx"
7
7
import invariant from "tiny-invariant"
8
8
9
9
import { ensurePaths } from "./lib/paths"
10
+ import { initProxyFromEnv } from "./lib/proxy"
10
11
import { generateEnvScript } from "./lib/shell"
11
12
import { state } from "./lib/state"
12
13
import { setupCopilotToken , setupGitHubToken } from "./lib/token"
@@ -23,9 +24,14 @@ interface RunServerOptions {
23
24
githubToken ? : string
24
25
claudeCode: boolean
25
26
showToken: boolean
27
+ proxyEnv: boolean
26
28
}
27
29
28
30
export async function runServer ( options : RunServerOptions ) : Promise < void > {
31
+ if ( options . proxyEnv ) {
32
+ initProxyFromEnv ( )
33
+ }
34
+
29
35
if ( options . verbose ) {
30
36
consola . level = 5
31
37
consola . info ( "Verbose logging enabled" )
@@ -173,6 +179,11 @@ export const start = defineCommand({
173
179
default : false ,
174
180
description : "Show GitHub and Copilot tokens on fetch and refresh" ,
175
181
} ,
182
+ "proxy-env" : {
183
+ type : "boolean" ,
184
+ default : false ,
185
+ description : "Initialize proxy from environment variables" ,
186
+ } ,
176
187
} ,
177
188
run ( { args } ) {
178
189
const rateLimitRaw = args [ "rate-limit" ]
@@ -190,6 +201,7 @@ export const start = defineCommand({
190
201
githubToken : args [ "github-token" ] ,
191
202
claudeCode : args [ "claude-code" ] ,
192
203
showToken : args [ "show-token" ] ,
204
+ proxyEnv : args [ "proxy-env" ] ,
193
205
} )
194
206
} ,
195
207
} )
0 commit comments