by su-kaka
将 GeminiCLI 和 Antigravity 转换为 OpenAI 、GEMINI 和 Claude API 接口
# Add to your Claude Code skills
git clone https://github.com/su-kaka/gcli2apiGuides for using cli tools skills like gcli2api.
Last scanned: 4/19/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-04-19T06:02:00.825Z",
"semgrepRan": false,
"npmAuditRan": true,
"pipAuditRan": false
}gcli2api is an open-source cli tools skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by su-kaka. 将 GeminiCLI 和 Antigravity 转换为 OpenAI 、GEMINI 和 Claude API 接口. It has 4,967 GitHub stars.
Yes. gcli2api passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/su-kaka/gcli2api" and add it to your Claude Code skills directory (see the Installation section above).
gcli2api is primarily written in Python. It is open-source under su-kaka on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other CLI Tools skills you can browse and compare side by side. Open the CLI Tools category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh gcli2api against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
将 GeminiCLI 和 Antigravity 转换为 OpenAI 、GEMINI 和 Claude API 兼容接口
初始安装
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
初始安装
iex (iwr "https://raw.githubusercontent.com/su-kaka/gcli2api/refs/heads/master/install.ps1" -UseBasicParsing).Content
重启服务
双击执行 start.bat
初始安装
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
初始安装
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 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
多端点多格式支持
/v1/chat/completions 和 /v1/models
/v1/models/{model}:generateContent 和 streamGenerateContent
/v1/messages(遵循 Claude API 规范)/antigravity/v1/chat/completions/antigravity/v1/models/{model}:generateContent 和 streamGenerateContent/antigravity/v1/messages灵活的密码管理
高级凭证管理
凭证状态监控
多种流式支持
响应优化
全功能 Web 界面
批量操作支持
实时监控
网络和代理配置
性能和稳定性配置
日志和调试
灵活的配置方式
所有模型均具备 1M 上下文窗口容量。每个凭证文件提供 1000 次请求额度。
gemini-2.5-progemini-3-pro-previewgemini-3.1-pro-previewgemini-2.5-pro-high:思考模式gemini-2.5-pro-low:低思考模式gemini-2.5-pro-search:集成搜索功能的模型gemini-3.1-flash-image:基础图像生成模型-2k:2K 分辨率-4k:4K 高清分辨率-1x1:正方形(头像)-16x9:横屏(电脑壁纸)-9x16:竖屏(手机壁纸)-21x9:超宽屏(带鱼屏)-4x3:传统显示器-3x4:竖版海报gemini-3.1-flash-image-4k-16x9:4K 横屏gemini-3.1-flash-image-2k-9x16:2K 竖屏-假流式 后缀
gemini-2.5-pro-假流式流式抗截断/ 前缀
流式抗截断/gemini-2.5-prohttp://127.0.0.1:7861 (默认端口,可通过 PORT 环境变量修改)pwd,可通过环境变量修改)
OpenAI 兼容客户端:
http://127.0.0.1:7861/v1pwd(默认值,可通过 API_PASSWORD 或 PASSWORD 环境变量修改)Gemini 原生客户端:
http://127.0.0.1:7861Authorization: Bearer your_api_passwordx-goog-api-key: your_api_password?key=your_api_passwordGCLI 认证模式
Antigravity 认证模式
统一管理界面
gcli2api 支持两种存储后端:本地 SQLite(默认) 和 MongoDB(云端分布式存储)
默认存储方式
云端分布式存储方案
当需要多实例部署或云端存储时,可以启用 MongoDB 存储模式。
步骤 1: 配置 MongoDB 连接
# 本地 MongoDB
export MONGODB_URI="mongodb://localhost:27017"
# MongoDB Atlas 云服务
export MONGODB_URI="mongodb+srv://username:password@cluster.mongodb.net"
# 带认证的 MongoDB
export MONGODB_URI="mongodb://admin:password@localhost:27017/admin"
# 可选:自定义数据库名称(默认: gcli2api)
export MONGODB_DATABASE="my_gcli_db"
步骤 2: 启动应用
# 应用会自动检测 MongoDB 配置并使用 MongoDB 存储
python web.py
Docker 环境使用 MongoDB
# 单机 MongoDB 部署
docker run -d --name gcli2api \
-e MONGODB_URI="mongodb://mongodb:27017" \
-e API_PASSWORD=your_password \
--network your_network \
ghcr.io/su-kaka/gcli2api:latest
# 使用 MongoDB Atlas
docker run -d --name gcli2api \
-e MONGODB_URI="mongodb+srv://user:pass@cluster.mongodb.net/gcli2api" \
-e API_PASSWORD=your_password \
-p 7861:7861 \
ghcr.io/su-kaka/gcli2api:latest
Docker Compose 示例
version: '3.8'
services:
mongodb:
image: mongo:7
container_name: gcli2api-mongodb
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: password123
volumes:
- mongodb_data:/data/db
ports:
- "27017:27017"
gcli2api:
image: ghcr.io/su-kaka/gcli2api:latest
container_name: gcli2api
restart: unless-stopped
depends_on:
- mongodb
environment:
- MONGODB_URI=mongodb://admin:password123@mongodb:27017/admin
- MONGODB_DATABASE=gcli2api
- API_PASSWORD=your_api_password
- PORT=7861
ports:
- "7861:7861"
volumes:
mongodb_data:
MongoDB 连接优化
# 连接池和超时配置
export MONGODB_URI="mongodb://localhost:27017?maxPoolSize=10&serverSelectionTimeoutMS=5000"
# 副本集配置
export MONGODB_URI="mongodb://host1:27017,host2:27017,host3:27017/gcli2api?replicaSet=myReplicaSet"
# 读写分离配置
export MONGODB_URI="mongodb://localhost:27017/gcli2api?readPreference=secondaryPreferred"
基础配置
PORT: 服务端口(默认:7861)HOST: 服务器监听地址(默认:0.0.0.0)密码配置
API_PASSWORD: 聊天 API 访问密码(默认:继承 PASSWORD 或 pwd)PANEL_PASSWORD: 控制面板访问密码(默认:继承 PASSWORD 或 pwd)PASSWORD: 通用密码,设置后覆盖上述两个(默认:pwd)性能和稳定性配置
RETRY_429_ENABLED: 启用 429 错误自动重试(默认:true)RETRY_429_MAX_RETRIES: 429 错误最大重试次数(默认:3)RETRY_429_INTERVAL: 429 错误重试间隔,秒(默认:1.0)ANTI_TRUNCATION_MAX_ATTEMPTS: 抗截断最大重试次数(默认:3)网络和代理配置
PROXY: