@cup2cup/claw-launch
v1.0.0
Published
One-command launcher for claw-code with third-party model provider support (ZhiPu, OpenRouter, etc.)
Maintainers
Readme
claw-launch
一条命令启动 claw-code 并配置第三方模型提供商(智谱 GLM、OpenRouter、硅基流动等)。
安装
# 直接使用 npx(推荐)
npx claw-launch --help
# 或全局安装
npm install -g claw-launch快速开始
智谱 GLM
npx claw-launch \
--api-key "your-zhipu-api-key" \
--api-url "https://open.bigmodel.cn/api/anthropic" \
-M "glm-5.1"OpenRouter
npx claw-launch \
--api-key "sk-or-xxx" \
--api-url "https://openrouter.ai/api/v1" \
-M "anthropic/claude-sonnet-4"硅基流动
npx claw-launch \
--api-key "your-siliconflow-key" \
--api-url "https://api.siliconflow.cn/v1" \
-M "deepseek-ai/DeepSeek-V3"全部选项
| 选项 | 说明 |
|------|------|
| --api-key <key> | API 密钥(必填) |
| --api-url <url> | API 基础地址(必填) |
| -M, --model <name> | 模型名称 |
| --output-style <style> | 输出风格 |
| --all-lang <lang> | 语言设置(zh-CN 等) |
| --claw-bin <path> | claw 二进制路径(默认自动检测) |
| --no-launch | 只写配置,不启动 claw |
| --write-env | 额外生成 .env.claw 文件 |
| --print-env | 只打印环境变量命令(不写文件) |
| --skip-prompt | 跳过交互提示(默认开启) |
工作原理
- 根据
--api-url自动检测提供商 - 设置
ANTHROPIC_API_KEY、ANTHROPIC_BASE_URL环境变量 - 写入
.claw/settings.local.json配置文件 - 使用配置好的环境启动
claw二进制
只导出环境变量
# 打印 shell export 命令
npx claw-launch --print-env \
--api-key "your-key" \
--api-url "https://open.bigmodel.cn/api/anthropic" \
-M "glm-5.1"
# 输出:
# export ANTHROPIC_API_KEY="your-key"
# export ANTHROPIC_BASE_URL="https://open.bigmodel.cn/api/anthropic"
# Then run: claw --model "glm-5.1"向 claw 传递额外参数
使用 -- 分隔符:
npx claw-launch \
--api-key "key" \
--api-url "https://open.bigmodel.cn/api/anthropic" \
-M "glm-5.1" \
-- --dangerously-skip-permissionsLicense
MIT
