+12
-2
@@ -75,8 +75,10 @@ #!/usr/bin/env node | ||
| const config = ensureStructure(readJson(paths.configPath) || {}); | ||
| const key = apiKey.trim(); | ||
| // 使用自定义 provider 名称,避免触发 OpenClaw 对内置 openai 账号的格式校验 | ||
| if (!config.models.mode) config.models.mode = 'merge'; | ||
| // auth 是认证方式类型('api-key'),实际 key 放 apiKey 字段 | ||
| config.models.providers[PROVIDER_NAME] = { | ||
| baseUrl: ENDPOINT, | ||
| auth: apiKey.trim(), | ||
| auth: 'api-key', | ||
| apiKey: key, | ||
| api: 'openai-completions', | ||
@@ -91,2 +93,10 @@ models: [{ | ||
| // 写入 auth.profiles(对应 auth-profiles.json) | ||
| const profileKey = `${PROVIDER_NAME}:default`; | ||
| config.auth.profiles[profileKey] = { | ||
| provider: PROVIDER_NAME, | ||
| mode: 'api_key', | ||
| apiKey: key, | ||
| }; | ||
| // 注册到 agents.defaults.models,便于 OpenClaw 识别与切换 | ||
@@ -93,0 +103,0 @@ const modelKey = `${PROVIDER_NAME}/${MODEL_ID}`; |
+20
-5
| { | ||
| "name": "mxosapi", | ||
| "version": "1.3.1", | ||
| "version": "1.3.2", | ||
| "description": "MAXAPI 一键配置工具 — 快速配置 OpenClaw/Claude Code/Codex", | ||
@@ -12,6 +12,19 @@ "main": "bin/mxosapi.js", | ||
| }, | ||
| "keywords": ["openclaw", "clawdbot", "config", "cli", "maxapi", "heibai", "claude", "codex", "anthropic"], | ||
| "keywords": [ | ||
| "openclaw", | ||
| "clawdbot", | ||
| "config", | ||
| "cli", | ||
| "maxapi", | ||
| "heibai", | ||
| "claude", | ||
| "codex", | ||
| "anthropic" | ||
| ], | ||
| "author": "MaxAPI Community", | ||
| "license": "MIT", | ||
| "files": ["bin/", "mxosapi.bat"], | ||
| "files": [ | ||
| "bin/", | ||
| "mxosapi.bat" | ||
| ], | ||
| "dependencies": { | ||
@@ -22,4 +35,6 @@ "inquirer": "^8.2.5", | ||
| }, | ||
| "engines": { "node": ">=14.0.0" }, | ||
| "engines": { | ||
| "node": ">=14.0.0" | ||
| }, | ||
| "preferGlobal": true | ||
| } | ||
| } |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
15592
1.93%283
3.28%