← 返回 Skills 市场
moonbird0423

claude-code-model

作者 MoonBird0423 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
58
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install claude-code-model
功能描述
Configure Claude Code to use custom models (DeepSeek, GLM, Qwen, etc.). Use when user wants to change Claude Code's model, switch API provider, or set up cus...
使用说明 (SKILL.md)

Claude Code Model Configuration

Switch Claude Code to use custom model providers (DeepSeek, GLM, Qwen, OpenAI-compatible endpoints).

Configuration Locations

Claude Code reads config from multiple sources (in priority order):

  1. Environment variables (highest priority)
  2. ~/.claude/config.json
  3. ~/.claude/settings.json

Required Parameters

User must provide:

  • base_url: API endpoint (e.g., https://api.deepseek.com/anthropic)
  • model: Model name (e.g., deepseek-v4-flash, glm-5)
  • api_key: API key

Workflow

Step 1: Update Environment Variables

Set user-level environment variables (persist across restarts):

[Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY", "\x3Capi_key>", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "\x3Cbase_url>", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", "\x3Cmodel>", "User")

Clear conflicting variables:

[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "", "User")

Step 2: Update config.json

Edit ~/.claude/config.json:

{
  "env": {
    "ANTHROPIC_API_KEY": "\x3Capi_key>",
    "ANTHROPIC_BASE_URL": "\x3Cbase_url>",
    "ANTHROPIC_MODEL": "\x3Cmodel>"
  }
}

Step 3: Update settings.json

Edit ~/.claude/settings.json, add/update:

{
  "model": "\x3Cmodel>",
  "env": {
    "ANTHROPIC_BASE_URL": "\x3Cbase_url>",
    "ANTHROPIC_API_KEY": "\x3Capi_key>"
  }
}

Step 4: Verify

Test the configuration:

claude --print "hi, what model are you?"

Common Issues

  • Auth conflict: Both ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY set → Clear ANTHROPIC_AUTH_TOKEN
  • Old model still shows: Check config.json for stale ANTHROPIC_MODEL value
  • Changes not生效: New terminal window required for env var changes

Popular Provider Examples

Provider base_url Models
DeepSeek https://api.deepseek.com/anthropic deepseek-v4-flash, deepseek-v4-pro
GLM (阿里云) https://coding.dashscope.aliyuncs.com/apps/anthropic glm-5
Qwen Same as GLM qwen-*

Script

Use the bundled script for automated configuration:

python scripts/configure_model.py --base-url \x3Curl> --model \x3Cname> --api-key \x3Ckey>
安全使用建议
This skill appears to be what it claims: it will add or replace entries in ~/.claude/config.json and ~/.claude/settings.json and (on Windows) set user-level environment variables, or print shell lines for you to add on Unix. Before running: 1) review the script to confirm you trust it (it runs PowerShell on Windows and calls the local 'claude' binary); 2) back up ~/.claude/config.json and settings.json so you can restore original settings; 3) be aware your API key will be stored in environment variables and JSON files in plaintext — only use keys you trust to share with the configured provider; 4) prefer running the script locally rather than pasting commands from unknown sources, and verify the base_url points to the intended provider.
功能分析
Type: OpenClaw Skill Name: claude-code-model Version: 1.0.0 The skill bundle contains a shell injection vulnerability in `scripts/configure_model.py`. The script uses f-strings to construct PowerShell commands for setting environment variables on Windows without sanitizing user-provided inputs (`--api-key`, `--base-url`, `--model`), which could lead to arbitrary command execution if the agent is provided with malicious values. While the tool's logic is consistent with its stated purpose of configuring Claude Code, the insecure use of `subprocess.run` with unsanitized strings is a high-risk vulnerability.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
Name/description align with the included script and instructions: the SKILL.md and scripts/configure_model.py only change ~/.claude/config.json, ~/.claude/settings.json, and user-level environment variables to point Claude Code at a different API endpoint and model. The requested inputs (base_url, model, api_key) are appropriate for this purpose.
Instruction Scope
Instructions are scoped to configuring Claude Code: they show how to set environment variables, edit the two config files, and run a local 'claude' command to verify. They do not attempt to read unrelated system files or send data to third-party endpoints beyond invoking the local 'claude' tool.
Install Mechanism
No install spec or external downloads; the skill is instruction + a small included Python script. Nothing is fetched from remote URLs or installed to system-wide locations.
Credentials
The skill asks for an API key and writes it into user environment variables and config files (plaintext). That is proportionate to changing the model provider, but is a sensitive action: storing credentials in shell profiles and JSON files is expected here but has privacy/security implications the user should consider.
Persistence & Privilege
The skill does not request always: true and does not modify other skills or system-wide agent settings. It writes to the user's ~/.claude config and (on Windows) sets per-user environment variables — expected for this functionality.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install claude-code-model
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /claude-code-model 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Configure Claude Code to use custom models (DeepSeek, GLM, Qwen, etc.). Switch API provider, set custom endpoints, update environment variables and config files automatically.
元数据
Slug claude-code-model
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

claude-code-model 是什么?

Configure Claude Code to use custom models (DeepSeek, GLM, Qwen, etc.). Use when user wants to change Claude Code's model, switch API provider, or set up cus... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 58 次。

如何安装 claude-code-model?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install claude-code-model」即可一键安装,无需额外配置。

claude-code-model 是免费的吗?

是的,claude-code-model 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

claude-code-model 支持哪些平台?

claude-code-model 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 claude-code-model?

由 MoonBird0423(@moonbird0423)开发并维护,当前版本 v1.0.0。

💬 留言讨论