forked from ericc-ch/copilot-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
50 lines (43 loc) · 1.68 KB
/
Copy pathstart.bat
File metadata and controls
50 lines (43 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
@echo off
TITLE Copilot API Proxy
echo ================================================
echo GitHub Copilot API Proxy (HTTP Mode)
echo ================================================
echo.
:: Load environment variables from .env if it exists
if exist .env (
echo Loading environment from .env...
for /f "usebackq tokens=1,* delims==" %%A in (".env") do (
if not "%%A"=="" if not "%%A:~0,1%"=="#" (
set "%%A=%%B"
)
)
echo.
)
:: --- Network configuration --------------------------------------------
:: LAN IP the other laptop uses to reach this PC.
set "LAN_IP=192.168.0.105"
:: Build if dist/ doesn't exist
if not exist dist (
echo Building project...
bun run build
echo.
)
if defined TAVILY_API_KEY (
echo Web search: enabled ^(Tavily^)
) else if defined BRAVE_API_KEY (
echo Web search: enabled ^(Brave^)
) else (
echo Web search: disabled ^(set TAVILY_API_KEY or BRAVE_API_KEY in .env to enable^)
)
echo.
echo Starting server on http://localhost:4141
echo Reachable from other machines at http://%LAN_IP%:4141
echo.
echo To launch Claude Code, run in a new terminal:
:: echo set ANTHROPIC_BASE_URL=http://localhost:4141 ^& set ANTHROPIC_AUTH_TOKEN=dummy ^& set ANTHROPIC_MODEL=claude-opus-4.6 ^& set ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-4.6 ^& set ANTHROPIC_SMALL_FAST_MODEL=gpt-4o-mini ^& set ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-opus-4.6 ^& set DISABLE_NON_ESSENTIAL_MODEL_CALLS=1 ^& set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 ^& claude
echo.
start "" "https://ericc-ch.github.io/copilot-api?endpoint=http://%LAN_IP%:4141/usage"
:: bun run ./src/main.ts start --burst-count 10 --burst-window 30
bun run ./src/main.ts start
pause