srpllm 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,193 +1,143 @@
1
- [![npm version][npm-version-src]][npm-version-href]
2
- [![npm downloads][npm-downloads-src]][npm-downloads-href]
3
- [![License][license-src]][license-href]
4
- [![Claude Code][claude-code-src]][claude-code-href]
5
- [![codecov][codecov-src]][codecov-href]
6
- [![JSDocs][jsdocs-src]][jsdocs-href]
7
- [![Ask DeepWiki][deepwiki-src]][deepwiki-href]
8
-
9
- <div align="center">
10
- <img src="./src/assets/banner.webp" alt="Banner"/>
11
-
12
- <h1>
13
- ZCF - Zero-Config Code Flow
14
- </h1>
15
-
16
- <p align="center">
17
- <b>English</b> | <a href="README_zh-CN.md">中文</a> | <a href="README_ja-JP.md">日本語</a> | <a href="CHANGELOG.md">Changelog</a>
18
-
19
- **✨ Full Documentation**: [ZCF Docs](https://zcf.ufomiao.com/)
20
-
21
- > Zero-config, one-click setup for Claude Code & Codex with bilingual support, intelligent agent system and personalized AI assistant
22
- </p>
23
- </div>
24
-
25
- ## ♥️ Sponsors
26
-
27
- [![GLM](./src/assets/GLM-en.png)](https://z.ai/subscribe?ic=8JVLJQFSKB)
28
-
29
- This project is sponsored by Z.ai, supporting us with their GLM CODING PLAN.
30
- GLM CODING PLAN is a subscription service designed for AI coding, starting at just $10/month. It provides access to their flagship GLM-4.7 & (GLM-5 Only Available for Pro Users)model across 10+ popular AI coding tools (Claude Code, Cline, Roo Code, etc.), offering developers top-tier, fast, and stable coding experiences.
31
- Get 10% OFF GLM CODING PLAN:https://z.ai/subscribe?ic=8JVLJQFSKB
32
-
33
- ---
34
-
35
- [![Sponsor PatewayAI](./src/assets/pateway.ai-en.png)](https://pateway.ai/?ch=vnr0h5&aff=9AWWH87C)
36
- PatewayAI is a high-quality model API relay service provider focused on official direct connections for serious AI developers, offering the full range of Claude and Codex series models. 100% official source supply with no adulteration — open to inspection. Transparent billing with token-level invoices auditable line by line. Enterprise-grade concurrency support with a dedicated management platform for enterprise customers, including formal contracts and invoicing. PatewayAI offers an exclusive benefit for ZCF users: register via <a href="https://pateway.ai/?ch=vnr0h5&aff=9AWWH87C">this link</a> to get $3 free trial credit, recharges as low as 60% off, with bilateral invite rewards up to $150!
37
-
38
- ---
39
-
40
- [![Sponsor AI API](./src/assets/302.ai-en.jpg)](https://share.302.ai/gAT9VG)
41
- [302.AI](https://share.302.ai/gAT9VG) is a pay-as-you-go enterprise AI resource hub that offers the latest and most comprehensive AI models and APIs on the market, along with a variety of ready-to-use online AI applications.
42
-
43
- ---
44
-
45
- <table>
46
- <tbody>
47
- <tr>
48
- <td width="180"><a href="https://www.packyapi.com/register?aff=zcf"><img src="./src/assets/packycode.png" alt="PackyCode" width="150"></a></td>
49
- <td>Thanks to PackyCode for sponsoring this project! PackyCode is a reliable and efficient API relay service provider, offering relay services for Claude Code, Codex, Gemini, and more. PackyCode provides special discounts for our software users: register using <a href="https://www.packyapi.com/register?aff=zcf">this link</a> and enter the "zcf" promo code during recharge to get 10% off.</td>
50
- </tr>
51
- <tr>
52
- <td width="180"><a href="https://apikey.fun/register?aff=ZCFZCF"><img src="./src/assets/apikey-fun.png" alt="APIKEY.FUN" width="150"></a></td>
53
- <td>Thanks to APIKEY.FUN for sponsoring this project! APIKEY.FUN is a professional enterprise-grade AI relay platform dedicated to providing stable, efficient, and low-cost API access for both companies and individual developers. The platform supports popular models including Claude, OpenAI, and Gemini, with pricing as low as 7% of official rates. Register via <a href="https://apikey.fun/register?aff=ZCFZCF">this link</a> to enjoy an exclusive offer of up to permanent 95% recharge pricing (5% off).</td>
54
- </tr>
55
- <tr>
56
- <td width="180"><a href="https://www.aicodemirror.com/register?invitecode=ZCFZCF"><img src="./src/assets/AICodeMirror.jpg" alt="AICodeMirror" width="150"></a></td>
57
- <td>Thanks to AICodeMirror for sponsoring this project! AICodeMirror provides official high-stability relay services for Claude Code/Codex/Gemini CLI, supporting enterprise-level high concurrency, fast invoicing, and 7x24 dedicated technical support. Official channels for Claude Code/Codex/Gemini at discounts as low as 38%/2%/10.9% off, with additional discounts on top-ups! AICodeMirror offers special benefits for ZCF users: users who register through <a href="https://www.aicodemirror.com/register?invitecode=ZCFZCF">this link</a> can enjoy 20% off on first top-up, and enterprise customers can get up to 25% off!</td>
58
- </tr>
59
- <tr>
60
- <td width="180"><a href="https://crazyrouter.com/?utm_source=github&utm_medium=sponsor&utm_campaign=zcf&aff=yJFo"><img src="./src/assets/crazyrouter.svg" alt="Crazyrouter" width="150"></a></td>
61
- <td>Thanks to Crazyrouter for sponsoring this project! Crazyrouter is a high-performance AI API aggregation gateway — one API key for 300+ models (GPT, Claude, Gemini, DeepSeek, and more). All models at 55% of official pricing with auto-failover, smart routing, and unlimited concurrency. Fully OpenAI-compatible, works seamlessly with Claude Code, Codex, and Gemini CLI. Crazyrouter offers an exclusive deal for ZCF users: register via <a href="https://crazyrouter.com/?utm_source=github&utm_medium=sponsor&utm_campaign=zcf&aff=yJFo">this link</a> to get $2 free credit instantly!</td>
62
- </tr>
63
- </tbody>
64
- </table>
65
-
66
- ## 🚀 Quick Start
67
-
68
- - Recommended: `npx zcf` opens the interactive menu — pick what you need.
69
- - Common commands:
70
-
71
- ```bash
72
- npx zcf i # Full initialization: install + workflows + API/CCR + MCP
73
- npx zcf u # Update workflows only
74
- npx zcf --lang zh-CN # Switch interface language (example)
75
- ```
76
-
77
- - Non-interactive example (provider preset):
78
-
79
- ```bash
80
- npx zcf i -s -p 302ai -k "sk-xxx"
81
- ```
82
-
83
- More usage, options, and workflows: see documentation.
84
-
85
- ## 📖 Full Documentation
86
-
87
- - https://zcf.ufomiao.com/
88
-
89
- ## 💬 Community
90
-
91
- Join our Telegram group for support, discussions, and updates:
92
-
93
- [![Telegram](https://img.shields.io/badge/Telegram-Join%20Chat-blue?style=flat&logo=telegram)](https://t.me/ufomiao_zcf)
94
-
95
- ## 🙏 Acknowledgments
96
-
97
- This project is inspired by and incorporates work from:
98
-
99
- - [LINUX DO - New Ideal Community](https://linux.do)
100
- - [CCR](https://github.com/musistudio/claude-code-router)
101
- - [CCometixLine](https://github.com/Haleclipse/CCometixLine)
102
- - [ccusage](https://github.com/ryoppippi/ccusage)
103
- - [BMad Method](https://github.com/bmad-code-org/BMAD-METHOD)
104
-
105
- Thanks to these community contributors for sharing!
106
-
107
- ## ❤️ Support & Sponsors
108
-
109
- If you find this project helpful, please consider sponsoring its development. Your support is greatly appreciated!
110
-
111
- [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/UfoMiao)
112
-
113
- <table>
114
- <tr>
115
- <td><img src="/src/assets/alipay.webp" width="200" alt="Alipay" /></td>
116
- <td><img src="/src/assets/wechat.webp" width="200" alt="WeChat Pay" /></td>
117
- </tr>
118
- </table>
119
-
120
- ### Our Sponsors
121
-
122
- A huge thank you to all our sponsors for their generous support!
123
-
124
- 【Corporate Sponsors】
125
-
126
- - [302.AI](https://share.302.ai/gAT9VG) (first corporate sponsorship 🤠)
127
- - [GLM](https://z.ai/subscribe?ic=8JVLJQFSKB) (first AI model sponsorship 🤖)
128
- - [PackyCode](https://www.packyapi.com/register?aff=zcf) (first API proxy service sponsor 🧝🏻‍♀️)
129
- - [APIKEY.FUN](https://apikey.fun/register?aff=ZCFZCF) (enterprise AI relay sponsor 🎁)
130
- - [AICodeMirror](https://www.aicodemirror.com/register?invitecode=ZCFZCF) (official high-stability relay service sponsor 🪞)
131
- - [UUCode](https://www.uucode.org/auth?ref=JQ2DJ1T8) (sponsored $100 proxy credits 💰)
132
- - [Crazyrouter](https://crazyrouter.com/?utm_source=github&utm_medium=sponsor&utm_campaign=zcf&aff=yJFo) (AI API aggregation gateway sponsor 🚀)
133
- - [PatewayAI](https://pateway.ai/?ch=vnr0h5&aff=9AWWH87C) (official direct-connect relay service sponsor 🛡️)
134
-
135
- 【Individual Sponsors】
136
-
137
- - Tc (first sponsor)
138
- - Argolinhas (first ko-fi sponsor ٩(•̤̀ᵕ•̤́๑))
139
- - r\*r (first anonymous sponsor 🤣)
140
- - \*\*康 (first KFC sponsor 🍗)
141
- - \*东 (first coffee sponsor ☕️)
142
- - 炼\*3 (first Termux user sponsor 📱)
143
- - [chamo101](https://github.com/chamo101) (first GitHub issue sponsor 🎉)
144
- - 初屿贤 (first Codex user sponsor 🙅🏻‍♂️)
145
- - Protein (first 1688 sponsor 😏)
146
- - [musistudio](https://github.com/musistudio) (first open source project author sponsor, the author of [CCR](https://github.com/musistudio/claude-code-router) 🤩)
147
- - \*年 (first 100 CNY sponsor 💴)
148
- - [BeatSeat](https://github.com/BeatSeat) (community expert 😎, provided $1000 Claude credits)
149
- - [wenwen](https://github.com/wenwen12345) (community expert 🤓, provided daily $100 Claude&GPT credits)
150
- - 16°C coffee (My best friend 🤪, offered ChatGPT Pro $200 package)
151
-
152
- ### Promotion Thanks
153
-
154
- Thanks to the following authors for promoting this project:
155
-
156
- - 逛逛 GitHub, article: https://mp.weixin.qq.com/s/phqwSRb16MKCHHVozTFeiQ
157
- - Geek, tweet: https://x.com/geekbb/status/1955174718618866076
158
-
159
- ## 📄 License
160
-
161
- [MIT License](LICENSE)
162
-
163
- ---
164
-
165
- ## 🚀 Contributors
166
-
167
- <a href="https://github.com/UfoMiao/zcf/graphs/contributors">
168
- <img src="https://contrib.rocks/image?repo=UfoMiao/zcf" />
169
- </a>
170
- <br /><br />
171
-
172
- ## ⭐️ Star History
173
-
174
- If this project helps you, please give me a ⭐️ Star!
175
-
176
- [![Star History Chart](https://api.star-history.com/svg?repos=UfoMiao/zcf&type=Date)](https://star-history.com/#UfoMiao/zcf&Date)
177
-
178
- <!-- Badges -->
179
-
180
- [npm-version-src]: https://img.shields.io/npm/v/zcf?style=flat&colorA=080f12&colorB=1fa669
181
- [npm-version-href]: https://npmjs.com/package/zcf
182
- [npm-downloads-src]: https://img.shields.io/npm/dm/zcf?style=flat&colorA=080f12&colorB=1fa669
183
- [npm-downloads-href]: https://npmjs.com/package/zcf
184
- [license-src]: https://img.shields.io/github/license/ufomiao/zcf.svg?style=flat&colorA=080f12&colorB=1fa669
185
- [license-href]: https://github.com/ufomiao/zcf/blob/main/LICENSE
186
- [claude-code-src]: https://img.shields.io/badge/Claude-Code-1fa669?style=flat&colorA=080f12&colorB=1fa669
187
- [claude-code-href]: https://claude.ai/code
188
- [codecov-src]: https://codecov.io/gh/UfoMiao/zcf/graph/badge.svg?token=HZI6K4Y7D7&style=flat&colorA=080f12&colorB=1fa669
189
- [codecov-href]: https://codecov.io/gh/UfoMiao/zcf
190
- [jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-1fa669?style=flat&colorA=080f12&colorB=1fa669
191
- [jsdocs-href]: https://www.jsdocs.io/package/zcf
192
- [deepwiki-src]: https://img.shields.io/badge/Ask-DeepWiki-1fa669?style=flat&colorA=080f12&colorB=1fa669
193
- [deepwiki-href]: https://deepwiki.com/UfoMiao/zcf
1
+ <div align="center">
2
+
3
+ # SrP-LLM 配置工具
4
+
5
+ 中转站客户端一键配置:安装 Claude Code / Codex · 填写 base_url 与 api_token · 从 litellm 拉取并选择模型
6
+
7
+ [![npm version](https://img.shields.io/npm/v/srpllm.svg)](https://www.npmjs.com/package/srpllm)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
9
+
10
+ </div>
11
+
12
+ ## 简介
13
+
14
+ `srpllm` 是为 **SrP-LLM 中转站**(基于 litellm 后端)准备的客户端配置脚本。一条命令即可:
15
+
16
+ 1. 安装 Claude Code / Codex CLI
17
+ 2. 引导填写中转站的 `base_url` `api_token`
18
+ 3. 从中转站后端 `GET {base_url}/v1/models` 拉取可用模型列表并选择
19
+ 4. 把配置写入对应客户端的配置文件(Claude Code `settings.json` / Codex 的 `config.toml` + `auth.json`)
20
+
21
+ 仅做「安装 + 配置接入中转站」这一件事,不做更多设置。
22
+
23
+ ## 快速开始
24
+
25
+ 无需全局安装,直接用 `npx` 运行:
26
+
27
+ ```bash
28
+ npx srpllm
29
+ ```
30
+
31
+ 按提示选择工具、输入中转站地址和 token、选择模型即可完成。
32
+
33
+ ## 命令
34
+
35
+ ```bash
36
+ npx srpllm # 交互式引导配置(默认)
37
+ npx srpllm init # 安装 CLI 并配置中转站(同上)
38
+ npx srpllm uninstall # 清除中转站配置(可选同时卸载 CLI)
39
+ ```
40
+
41
+ ### 非交互模式(CI / 脚本)
42
+
43
+ ```bash
44
+ npx srpllm init -s \
45
+ -T claude-code \
46
+ -u https://api.srpllm.com \
47
+ -k sk-xxxx \
48
+ -m glm-5.2 \
49
+ -O glm-5.2 \
50
+ -S glm-5-turbo \
51
+ -H glm-5-turbo
52
+ ```
53
+
54
+ ### 参数
55
+
56
+ | 参数 | 简写 | 说明 |
57
+ |------|------|------|
58
+ | `--code-type` | `-T` | 工具类型:`claude-code` / `codex`(简写 `cc` / `cx`) |
59
+ | `--base-url` | `-u` | 中转站 base_url(例如 `https://api.srpllm.com`) |
60
+ | `--token` | `-k` | api_token |
61
+ | `--model` | `-m` | 主模型,写入 `ANTHROPIC_MODEL` |
62
+ | `--opus-model` | `-O` | Opus 档模型,写入 `ANTHROPIC_DEFAULT_OPUS_MODEL` |
63
+ | `--sonnet-model` | `-S` | Sonnet 档模型,写入 `ANTHROPIC_DEFAULT_SONNET_MODEL` |
64
+ | `--haiku-model` | `-H` | Haiku 档模型,写入 `ANTHROPIC_DEFAULT_HAIKU_MODEL` |
65
+ | `--skip-prompt` | `-s` | 非交互模式,跳过所有交互提示 |
66
+ | `--help` | `-h` | 显示帮助 |
67
+ | `--version` | `-v` | 显示版本 |
68
+
69
+ > Opus / Sonnet / Haiku 三档模型参数仅对 Claude Code 生效;Codex 只使用 `--model`。
70
+
71
+ ## 配置写入位置
72
+
73
+ ### Claude Code
74
+
75
+ 写入 `~/.claude/settings.json` 的 `env` 段(合并式,保留其它字段):
76
+
77
+ ```json
78
+ {
79
+ "env": {
80
+ "ANTHROPIC_BASE_URL": "https://api.srpllm.com",
81
+ "ANTHROPIC_AUTH_TOKEN": "sk-xxxx",
82
+ "ANTHROPIC_MODEL": "glm-5.2",
83
+ "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.2",
84
+ "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5-turbo",
85
+ "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5-turbo",
86
+ "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000",
87
+ "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
88
+ }
89
+ }
90
+ ```
91
+
92
+ - 统一使用 `ANTHROPIC_AUTH_TOKEN`(Bearer token 鉴权),清除原 `ANTHROPIC_API_KEY`
93
+ - 额外附加 `CLAUDE_CODE_AUTO_COMPACT_WINDOW` 与 `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` 两个默认值
94
+
95
+ ### Codex
96
+
97
+ 写入 `~/.codex/config.toml`(合并式,保留用户其它 provider / mcp / projects 等配置,修改前自动备份):
98
+
99
+ ```toml
100
+ # --- SrP-LLM 中转站配置 ---
101
+ model = "gpt-5.2"
102
+ model_provider = "srpllm"
103
+
104
+ [model_providers.srpllm]
105
+ name = "SrP-LLM"
106
+ base_url = "https://api.srpllm.com"
107
+ wire_api = "responses"
108
+ temp_env_key = "SRPLLM_API_KEY"
109
+ requires_openai_auth = false
110
+ ```
111
+
112
+ 并把 `~/.codex/auth.json` 中的 `SRPLLM_API_KEY` 与 `OPENAI_API_KEY` 设为 token(合并保留其它 key)。
113
+
114
+ ## 卸载
115
+
116
+ ```bash
117
+ npx srpllm uninstall
118
+ ```
119
+
120
+ - Claude Code:从 `settings.json` 清除中转站相关 env 字段,保留其它设置
121
+ - Codex:移除 `[model_providers.srpllm]` 段与顶层 `model`/`model_provider`,保留其它配置(修改前自动备份)
122
+ - 可选择同时卸载 Claude Code / Codex CLI
123
+
124
+ ## 模型列表获取
125
+
126
+ 模型列表从中转站后端 litellm 的标准接口拉取:
127
+
128
+ ```
129
+ GET {base_url}/v1/models
130
+ Authorization: Bearer {api_token}
131
+ ```
132
+
133
+ 返回 `data: [{ id, owned_by, ... }]` 格式,工具会列出全部模型供选择。若拉取失败(网络不通 / token 无效),交互模式下可手动输入模型名,非交互模式下跳过模型配置。
134
+
135
+ ## 平台支持
136
+
137
+ - macOS / Linux / Windows / WSL / Termux
138
+ - Claude Code 安装方式:npm / Homebrew / curl / PowerShell
139
+ - Codex 安装方式:npm / Homebrew
140
+
141
+ ## License
142
+
143
+ [MIT](./LICENSE)
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import cac from 'cac';
3
3
  import ansis from 'ansis';
4
- import { i as init, u as uninstall, G as version } from './shared/srpllm.BB4ML_UM.mjs';
4
+ import { i as init, u as uninstall, G as version } from './shared/srpllm.gk7klSey.mjs';
5
5
  import 'node:process';
6
6
  import 'inquirer';
7
7
  import 'ora';
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { C as CLAUDE_DIR, b as CLAUDE_SETTINGS_FILE, f as CODEX_AUTH_FILE, e as CODEX_CONFIG_FILE, d as CODEX_DIR, j as CODE_TOOL_ALIASES, k as CODE_TOOL_LABELS, h as CODE_TOOL_TYPES, D as DEFAULT_CODE_TOOL_TYPE, R as RELAY_PROVIDER_ID, F as buildModelsChoices, o as clearClaudeApiConfig, t as clearCodexApiConfig, c as commandExists, y as detectInstalledVersion, p as displayClaudeConfig, v as displayCodexConfig, l as ensureClaudeDir, E as fetchModels, n as getExistingClaudeApiConfig, q as getExistingCodexConfig, g as getPlatform, i as init, A as installTool, x as isToolInstalled, a as isWindows, m as readClaudeSettings, r as resolveCodeToolType, z as selectInstallMethod, u as uninstall, B as uninstallTool, w as writeClaudeApiConfig, s as writeCodexApiConfig } from './shared/srpllm.BB4ML_UM.mjs';
1
+ export { C as CLAUDE_DIR, b as CLAUDE_SETTINGS_FILE, f as CODEX_AUTH_FILE, e as CODEX_CONFIG_FILE, d as CODEX_DIR, j as CODE_TOOL_ALIASES, k as CODE_TOOL_LABELS, h as CODE_TOOL_TYPES, D as DEFAULT_CODE_TOOL_TYPE, R as RELAY_PROVIDER_ID, F as buildModelsChoices, o as clearClaudeApiConfig, t as clearCodexApiConfig, c as commandExists, y as detectInstalledVersion, p as displayClaudeConfig, v as displayCodexConfig, l as ensureClaudeDir, E as fetchModels, n as getExistingClaudeApiConfig, q as getExistingCodexConfig, g as getPlatform, i as init, A as installTool, x as isToolInstalled, a as isWindows, m as readClaudeSettings, r as resolveCodeToolType, z as selectInstallMethod, u as uninstall, B as uninstallTool, w as writeClaudeApiConfig, s as writeCodexApiConfig } from './shared/srpllm.gk7klSey.mjs';
2
2
  import 'node:process';
3
3
  import 'ansis';
4
4
  import 'inquirer';
@@ -518,7 +518,7 @@ function buildModelsChoices(models) {
518
518
  }));
519
519
  }
520
520
 
521
- const version = "1.0.0";
521
+ const version = "1.0.1";
522
522
 
523
523
  function displayBanner(codeTool) {
524
524
  const tool = codeTool ? ` ${ansis.gray(`\xB7 ${CODE_TOOL_LABELS[codeTool]}`)}` : "";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srpllm",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "packageManager": "pnpm@10.17.1",
6
6
  "description": "SrP-LLM 中转站客户端一键配置工具:安装 Claude Code / Codex 并引导填写 base_url、api_token 与模型",
7
7
  "author": {