三种安装方式
# 1. 已有 Node.js(最快,24KB)
npm install -g geekapi-cli
# 2. macOS / Linux 一键脚本
curl -fsSL https://raw.githubusercontent.com/CoderKuo/geekapi-cli/main/install.sh | bash
# 3. Windows PowerShell 一键脚本
irm https://raw.githubusercontent.com/CoderKuo/geekapi-cli/main/install.ps1 | iex新增功能
配置后自动健康检查
配完 Claude / Codex 立即调 /v1/models 验证 key 是否可用:
- 401/403:API Key 错误或分组不支持
- 404:Base URL / 路由不对
- 网络错误:中转站不可达
针对性提示,不再让用户配错后跑claude黑盒撞墙。
余额查询
菜单新增"查询余额 / 用量",调 /v1/usage 显示剩余额度。
打开 GeekAPI 控制台
菜单新增"打开 GeekAPI 控制台",自动调用系统浏览器。
原子写入 + 滚动备份
- 写配置先写
.tmp再 rename,防止崩溃留半截文件 - 备份命名为
<file>.bak.<timestamp>,自动保留最近 5 份
一键安装脚本
install.sh(macOS/Linux):自动检测平台架构,拉 GitHub Releases 最新版install.ps1(Windows):自动加 PATH,UTF-8 with BOM 保证中文不乱码
发布到 npm
- 包名:
geekapi-cli - 大小:24KB(gzip)
- 支持 Node 18+
- 用
child_process替换Bun.spawn,Node/Bun 双兼容
直接下载
| 系统 | 文件 |
|---|---|
| Windows 10/11 x64 | geekapi-win.exe |
| macOS(Intel) | geekapi-mac |
| macOS(Apple Silicon) | geekapi-mac-arm |
| Linux x64 | geekapi-linux |