Gcli2api
将 GeminiCLI 和 Antigravity 转换为 OpenAI 、GEMINI 和 Claude API 接口
Works with Claude Code · 5,253 GitHub stars
Install
docker run -d --name gcli2api --network host -e PASSWORD=pwd -e PORT=7861 -v $(pwd)/data/creds:/app/creds ghcr.io/su-kaka/gcli2api:latestInstall command taken from the project's README or registry entry. Always review code before running it.
README excerpt
Read full README on GitHub →GeminiCLI to API
将 GeminiCLI 和 Antigravity 转换为 OpenAI 、GEMINI 和 Claude API 兼容接口
🚀 快速部署
安装指南
Termux 环境
初始安装
curl -o termux-install.sh "https://raw.githubusercontent.com/su-kaka/gcli2api/refs/heads/master/termux-install.sh" && chmod +x termux-install.sh && ./termux-install.sh
重启服务
cd gcli2api
bash termux-start.sh
Windows 环境
初始安装
iex (iwr "https://raw.githubusercontent.com/su-kaka/gcli2api/refs/heads/master/install.ps1" -UseBasicParsing).Content
重启服务
双击执行 start.bat
Linux 环境
初始安装
curl -o install.sh "https://raw.githubusercontent.com/su-kaka/gcli2api/refs/heads/master/install.sh" && chmod +x install.sh && ./install.sh
重启服务
cd gcli2api
bash start.sh
macOS 环境
初始安装
curl -o darwin-install.sh "https://raw.githubusercontent.com/su-kaka/gcli2api/refs/heads/master/darwin-install.sh" && chmod +x darwin-install.sh && ./darwin-install.sh
重启服务
cd gcli2api
bash start.sh
Docker 环境
Docker 运行命令
# 使用通用密码
docker run -d --name gcli2api --network host -e PASSWORD=pwd -e PORT=7861 -v $(pwd)/data/creds:/app/creds ghcr.io/su-kaka/gcli2api:latest
# 使用分离密码
docker run -d --name gcli2api --network host -e API_PASSWORD=api_pwd -e PANEL_PASSWORD=panel_pwd -e PORT=7861 -v $(pwd)/data/creds:/app/creds ghcr.io/su-kaka/gcli2api:latest
Docker Mac
# 使用通用密码
docker run -d \
--name gcli2api \
-p 7861:7861 \
-p 8080:8080 \
-e PASSWORD=pwd \
-e PORT=7861 \
-v "$(pwd)/data/creds":/app/creds \
ghcr.io/su-kaka/gcli2api:latest
# 使用分离密码
docker run -d \
--name gcli2api \
-p 7861:7861 \
-p 8080:8080 \
-e API_PASSWORD=api_pwd \
-e PANEL_PASSWORD=panel_pwd \
-e PORT=7861 \
-v $(pwd)/data/creds:/app/creds \
ghcr.io/su-kaka/gcli2api:latest
Docker Compose 运行命令
- 将以下内容保存为
docker-compose.yml文件:version: '3.8' services: gcli2api: image: ghcr.io/su-kaka/gcli2api:latest container_name: gcli2api restart: unless-stopped network_mode: host environment: # 使用通用密码(推荐用于简单部署) - PASSWORD=pwd - PORT=7861 # 或使用分离密码(推荐用于生产环境) # - API_PASSWORD=your_api_password # - PANEL_PASSWORD=your_panel_password volumes: - ./data/creds:/app/creds healthcheck: test: ["CMD-SHELL", "python -c \"import sys, urllib.request, os; port = os.environ.get('PORT', '7861'); req = urllib.request.Request(f'http://localhost:{port}/v1/models', headers={'Authorization': 'Bearer ' + os.environ.get('PASSWORD', 'pwd')}); sys.exit(0 if urllib.request.urlopen(req, timeout=5).getcode() == 200 else 1)\""] interval: 30s timeout: 10s retries: 3 start_period: 40s - 启动服务:
docker-compose up -d
核心功能
🔄 API 端点和格式支持
Similar plugs
CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies
Bash is all you need - A nano claude code, like 「agent harness」, built from 0 to 1
Documented system prompts from Anthropic - Claude Fable 5.1, Opus 5.5, Claude Design, Claude Code. OpenAI - ChatGPT GPT-6-Astra, Codex. Google - Gemini 3.8 Flash, 3.1 Pro…
Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build, Muse Code, Devin as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini…