@tokenaut/opentoken 1.4.6 → 1.4.7

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.
Files changed (2) hide show
  1. package/README.md +21 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -25,6 +25,7 @@ npm install -g @tokenaut/opentoken
25
25
  | 应用 | 子命令(别名) | 配置文件 |
26
26
  |------|----------------|----------|
27
27
  | **Claude Code** | `cc`、`claude` | `~/.claude/settings.json`(环境变量:`ANTHROPIC_AUTH_TOKEN`、`ANTHROPIC_BASE_URL`、`ANTHROPIC_MODEL`) |
28
+ | **Claude Desktop** | `claude_desktop`、`cd` | `~/Library/Application Support/Claude-3p/configLibrary/*.json`(`inferenceGatewayApiKey`、`inferenceGatewayBaseUrl`) |
28
29
  | **Atomcode** | `atomcode`、`ac` | `~/.atomcode/config.toml` |
29
30
  | **OpenClaw** | `openclaw`、`oc` | `~/.openclaw/openclaw.json`(合并写入 Opentoken:`models.providers.opentoken`、`agents.defaults.model.primary` 等) |
30
31
  | **Hermes** | `hermes`、`hm` | `~/.hermes/config.yaml`(`model.provider`、`model.base_url`、`model.default`)与 `~/.hermes/.env`(`OPENTOKEN_API_KEY`) |
@@ -39,11 +40,13 @@ OpenCode 会为 **`opentoken`** 提供方写入 **`npm`**(`@ai-sdk/anthropic`
39
40
 
40
41
  Codex 会为 **`opentoken`** 提供方写入 **`base_url`**(默认 `https://gw.opentoken.io/v1`)与 **`wire_api = "responses"`**(不写 `env_key`),并只从模型列表中选择 `supported_endpoint_types` 包含 `responses` 的模型。API Key 写入 **`~/.codex/auth.json`** 的 **`OPENAI_API_KEY`**,Codex 命令行与 IDE 插件共用,无需再 export 环境变量。
41
42
 
43
+ Claude Desktop 会写入 **`inferenceGatewayApiKey`**(API Key)与 **`inferenceGatewayBaseUrl`**(Base URL,默认 `https://gw.opentoken.io`),同时设置 **`inferenceProvider: "gateway"`** 与 **`inferenceGatewayAuthScheme: "bearer"`**。配置文件位于 `configLibrary/` 目录下,通过 UUID 标识的 JSON 文件管理;本工具会自动复用现有配置或创建新条目。Windows 下路径为 `%APPDATA%\Claude\configLibrary\*.json`。
44
+
42
45
  ---
43
46
 
44
47
  ## 快捷一键配置(非交互)
45
48
 
46
- 以下为各应用在命令行直接写入配置的用法。选项可单独或组合使用:**`--key` / `-k`**,**`--url` / `-u`**(仅 Claude Code),**`--model` / `-m`**。
49
+ 以下为各应用在命令行直接写入配置的用法。选项可单独或组合使用:**`--key` / `-k`**,**`--url` / `-u`**(Claude Code、Claude Desktop、Codex),**`--model` / `-m`**。
47
50
 
48
51
  ### Claude Code
49
52
 
@@ -61,6 +64,23 @@ opentoken cc -k sk-xxx
61
64
  opentoken cc -k sk-xxx -u https://gw.opentoken.io -m claude-opus-4-5
62
65
  ```
63
66
 
67
+ ### Claude Desktop
68
+
69
+ 写入(或合并)`configLibrary/*.json` 中的第三方推理配置:
70
+
71
+ ```bash
72
+ opentoken claude_desktop --key <api_key>
73
+ opentoken cd --url <base_url>
74
+ opentoken cd -k <api_key> -u <base_url>
75
+ ```
76
+
77
+ 示例:
78
+
79
+ ```bash
80
+ opentoken cd -k sk-xxx
81
+ opentoken cd -k sk-xxx -u https://gw.opentoken.io
82
+ ```
83
+
64
84
  ### Atomcode
65
85
 
66
86
  Base URL 固定为 Opentoken 的 OpenAI 兼容地址,仅需 Key 与模型:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenaut/opentoken",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
4
4
  "description": "OpenToken 一键接入 AI 模型 · https://docs.opentoken.io/",
5
5
  "main": "src/cli.js",
6
6
  "bin": {