Run with Docker Compose
Clone the repository and navigate into the directory:
bashgit clone https://github.com/router-for-me/CLIProxyAPI.git cd CLIProxyAPIPrepare the configuration file: Create a
config.yamlfile by copying the example and customize it to your needs.bashcp config.example.yaml config.yaml(Note for Windows users: You can use
copy config.example.yaml config.yamlin CMD or PowerShell.)Start the service:
- For most users (recommended): Run the following command to start the service using the pre-built image from Docker Hub. The service will run in the background.bash
docker compose up -d - For advanced users: If you have modified the source code and need to build a new image, use the interactive helper scripts:
- For Windows (PowerShell):powershell
.\docker-build.ps1 - For Linux/macOS:bash
bash docker-build.sh
- Option 1: Run using Pre-built Image (Recommended): Pulls the latest official image from the registry and starts the container. This is the easiest way to get started.
- Option 2: Build from Source and Run (For Developers): Builds the image from the local source code, tags it as
cli-proxy-api:local, and then starts the container. This is useful if you are making changes to the source code.
- For Windows (PowerShell):
- For most users (recommended): Run the following command to start the service using the pre-built image from Docker Hub. The service will run in the background.
To authenticate with providers, run the login command inside the container:
- Gemini:
bashdocker compose exec cli-proxy-api /CLIProxyAPI/CLIProxyAPI -no-browser --login- OpenAI (Codex):
bashdocker compose exec cli-proxy-api /CLIProxyAPI/CLIProxyAPI -no-browser --codex-login- Claude:
bashdocker compose exec cli-proxy-api /CLIProxyAPI/CLIProxyAPI -no-browser --claude-login- Qwen:
bashdocker compose exec cli-proxy-api /CLIProxyAPI/CLIProxyAPI -no-browser --qwen-login- iFlow:
bashdocker compose exec cli-proxy-api /CLIProxyAPI/CLIProxyAPI -no-browser --iflow-login- Antigravity:
bashdocker compose exec cli-proxy-api /CLIProxyAPI/CLIProxyAPI -no-browser --antigravity-loginTo view the server logs:
bashdocker compose logs -fTo stop the application:
bashdocker compose down