@@ -7,6 +7,7 @@ import { serve, type ServerHandler } from "srvx"
77import invariant from "tiny-invariant"
88
99import { ensurePaths } from "./lib/paths"
10+ import { initProxyFromEnv } from "./lib/proxy"
1011import { generateEnvScript } from "./lib/shell"
1112import { state } from "./lib/state"
1213import { setupCopilotToken , setupGitHubToken } from "./lib/token"
@@ -23,9 +24,14 @@ interface RunServerOptions {
2324 githubToken ? : string
2425 claudeCode: boolean
2526 showToken: boolean
27+ proxyEnv: boolean
2628}
2729
2830export async function runServer ( options : RunServerOptions ) : Promise < void > {
31+ if ( options . proxyEnv ) {
32+ initProxyFromEnv ( )
33+ }
34+
2935 if ( options . verbose ) {
3036 consola . level = 5
3137 consola . info ( "Verbose logging enabled" )
@@ -173,6 +179,11 @@ export const start = defineCommand({
173179 default : false ,
174180 description : "Show GitHub and Copilot tokens on fetch and refresh" ,
175181 } ,
182+ "proxy-env" : {
183+ type : "boolean" ,
184+ default : false ,
185+ description : "Initialize proxy from environment variables" ,
186+ } ,
176187 } ,
177188 run ( { args } ) {
178189 const rateLimitRaw = args [ "rate-limit" ]
@@ -190,6 +201,7 @@ export const start = defineCommand({
190201 githubToken : args [ "github-token" ] ,
191202 claudeCode : args [ "claude-code" ] ,
192203 showToken : args [ "show-token" ] ,
204+ proxyEnv : args [ "proxy-env" ] ,
193205 } )
194206 } ,
195207} )
0 commit comments