From 2a2a276e3be28da3fb00fc38635bcd6b2abba6f6 Mon Sep 17 00:00:00 2001 From: hkfires <10558748+hkfires@users.noreply.github.com> Date: Sun, 7 Sep 2025 11:58:43 +0800 Subject: [PATCH] Update README --- README.md | 40 ++++++++++++++++++++++++++-------------- README_CN.md | 40 ++++++++++++++++++++++++++-------------- 2 files changed, 52 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 5aadbd24..10cff67d 100644 --- a/README.md +++ b/README.md @@ -497,26 +497,38 @@ docker run --rm -p 8317:8317 -v /path/to/your/config.yaml:/CLIProxyAPI/config.ya ## Run with Docker Compose -1. Clone the repository: +1. Clone the repository and navigate into the directory: ```bash git clone https://github.com/luispater/CLIProxyAPI.git cd CLIProxyAPI ``` -2. Create a `config.yaml` from `config.example.yaml` and customize it. +2. Prepare the configuration file: + Create a `config.yaml` file by copying the example and customize it to your needs. + ```bash + cp config.example.yaml config.yaml + ``` + *(Note for Windows users: You can use `copy config.example.yaml config.yaml` in CMD or PowerShell.)* -3. Run the interactive script to start the service: - - For Windows (PowerShell): - ```powershell - .\docker-build.ps1 - ``` - - For Linux/macOS: - ```bash - bash docker-build.sh - ``` - The script will prompt you to choose how to run the application: - - **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. +3. 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 + ``` + The script will prompt you to choose how to run the application: + - **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. 4. To authenticate with providers, run the login command inside the container: - **Gemini**: `docker compose exec cli-proxy-api /CLIProxyAPI/CLIProxyAPI -no-browser --login` diff --git a/README_CN.md b/README_CN.md index 59461d02..18a49323 100644 --- a/README_CN.md +++ b/README_CN.md @@ -512,26 +512,38 @@ docker run --rm -p 8317:8317 -v /path/to/your/config.yaml:/CLIProxyAPI/config.ya ## 使用 Docker Compose 运行 -1. 克隆仓库: +1. 克隆仓库并进入目录: ```bash git clone https://github.com/luispater/CLIProxyAPI.git cd CLIProxyAPI ``` -2. 从 `config.example.yaml` 创建一个 `config.yaml` 文件并进行自定义。 +2. 准备配置文件: + 通过复制示例文件来创建 `config.yaml` 文件,并根据您的需求进行自定义。 + ```bash + cp config.example.yaml config.yaml + ``` + *(Windows 用户请注意:您可以在 CMD 或 PowerShell 中使用 `copy config.example.yaml config.yaml`。)* -3. 运行交互式脚本以启动服务: - - Windows (PowerShell): - ```powershell - .\docker-build.ps1 - ``` - - Linux/macOS: - ```bash - bash docker-build.sh - ``` - 脚本将提示您选择运行方式: - - **选项 1:使用预构建的镜像运行 (推荐)**:从镜像仓库拉取最新的官方镜像并启动容器。这是最简单的开始方式。 - - **选项 2:从源码构建并运行 (适用于开发者)**:从本地源代码构建镜像,将其标记为 `cli-proxy-api:local`,然后启动容器。如果您需要修改源代码,此选项很有用。 +3. 启动服务: + - **适用于大多数用户(推荐):** + 运行以下命令,使用 Docker Hub 上的预构建镜像启动服务。服务将在后台运行。 + ```bash + docker compose up -d + ``` + - **适用于进阶用户:** + 如果您修改了源代码并需要构建新镜像,请使用交互式辅助脚本: + - 对于 Windows (PowerShell): + ```powershell + .\docker-build.ps1 + ``` + - 对于 Linux/macOS: + ```bash + bash docker-build.sh + ``` + 脚本将提示您选择运行方式: + - **选项 1:使用预构建的镜像运行 (推荐)**:从镜像仓库拉取最新的官方镜像并启动容器。这是最简单的开始方式。 + - **选项 2:从源码构建并运行 (适用于开发者)**:从本地源代码构建镜像,将其标记为 `cli-proxy-api:local`,然后启动容器。如果您需要修改源代码,此选项很有用。 4. 要在容器内运行登录命令进行身份验证: - **Gemini**: `docker compose exec cli-proxy-api /CLIProxyAPI/CLIProxyAPI -no-browser --login`