Run with Docker Compose
Clone the repository and navigate into the directory:
bashgit clone https://github.com/luispater/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.)To use the Git-backed configuration store, you can add the
GITSTORE_*environment variables to yourdocker-compose.ymlfile under thecli-proxy-apiservice definition. For example:yamlservices: cli-proxy-api: image: eceasy/cli-proxy-api:latest container_name: cli-proxy-api ports: - "8317:8317" - "8085:8085" - "1455:1455" - "54545:54545" - "11451:11451" environment: - GITSTORE_GIT_URL=https://github.com/your/config-repo.git - GITSTORE_GIT_TOKEN=your_personal_access_token volumes: - ./git-store:/CLIProxyAPI/remote # GITSTORE_LOCAL_PATH restart: unless-stoppedWhen using the Git store, you may not need to mount
config.yamlorauth-dirdirectly.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-loginTo view the server logs:
bashdocker compose logs -fTo stop the application:
bashdocker compose down