@echo off :: Start CLIProxyAPI Docker Container and Cloudflare Tunnel :: Run this at Windows startup for permanent API access echo Starting CLIProxyAPI... :: Check if Docker is running docker info >nul 2>&1 if errorlevel 1 ( echo Docker is not running. Please start Docker Desktop first. pause exit /b 1 ) :: Stop existing container if running docker stop cliproxy-api 2>nul docker rm cliproxy-api 2>nul :: Start the container docker run -d --name cliproxy-api -p 8317:8317 --restart unless-stopped cliproxy-api:latest echo Container started. Waiting 5 seconds... timeout /t 5 /nobreak >nul :: Start Cloudflare tunnel echo Starting Cloudflare tunnel... start /min cmd /c "cloudflared tunnel --url http://localhost:8317 2>&1 | tee %TEMP%\cloudflared-tunnel.log" timeout /t 10 /nobreak >nul :: Show tunnel URL echo. echo ============================================ echo API is running! echo. echo Check %TEMP%\cloudflared-tunnel.log for the public URL echo. echo API Key: sk-cItvhSBsi7KWnTDZqfFX5gzuVURodOL8pPj1CbyJreAk3HYG echo ============================================ echo. pause