npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@evolution-of-silicon-based-life/openclaw-setup

v1.0.3

Published

一键配置 OpenClaw 中转服务 | One-click OpenClaw proxy configuration tool

Readme

OpenClaw Setup

English | 中文

一键配置 OpenClaw 中转服务。告别复杂的手动配置,3 步搞定。

为什么需要这个工具?

OpenClaw 本身的配置非常灵活,但对普通用户来说太复杂了。手动编辑 JSON 配置、理解 provider/model 的层级关系、记住各种字段名——这些都是不必要的门槛。

openclaw-setup 把整个过程简化为三步:

  1. 输入你的中转服务地址
  2. 输入 API Key
  3. 输入模型名称

工具自动处理剩下的一切:URL 标准化、配置结构生成、连接验证、文件写入、旧配置备份。

快速开始

最简单的方式(推荐)

npx @evolution-of-silicon-based-life/openclaw-setup

跟着向导走就行了,3 步搞定。

全局安装(更短的命令)

npm i -g @evolution-of-silicon-based-life/openclaw-setup

# 之后用 ocs 短命令即可
ocs                  # 交互式向导
ocs list             # 列出服务商
ocs test             # 测试连接
ocs --web            # Web 界面

一行命令搞定

npx @evolution-of-silicon-based-life/openclaw-setup -u http://你的服务器:3000 -k sk-你的密钥 -m 模型名称

# 全局安装后更简单
ocs -u http://你的服务器:3000 -k sk-你的密钥 -m 模型名称

没有 Node.js?用 curl

curl -fsSL https://raw.githubusercontent.com/evolution-of-silicon-based-life/openclaw-setup/main/scripts/setup.sh | bash

Windows PowerShell

irm https://raw.githubusercontent.com/evolution-of-silicon-based-life/openclaw-setup/main/scripts/setup.ps1 | iex

完整功能列表

交互式向导

最友好的配置方式,运行后跟着提示操作:

npx @evolution-of-silicon-based-life/openclaw-setup
# 或全局安装后
ocs

功能:

  • 选择预置服务商(OneAPI、NewAPI、OpenRouter、硅基流动)或自定义
  • 密码遮罩输入 API Key
  • 自动发现可用模型列表
  • 配置前自动测试连接
  • 智能合并已有配置

非交互式配置

适合脚本、CI/CD、批量部署:

ocs -u http://182.92.115.122:3000 -k sk-xxx -m MiniMax-M2.5

所有参数:

| 参数 | 缩写 | 说明 | 示例 | |------|------|------|------| | --url | -u | API 地址 | http://server:3000 | | --key | -k | API Key | sk-xxx | | --model | -m | 模型名称 | gpt-4o | | --provider | | 自定义 Provider ID | myproxy | | --api | | API 协议 | openai-completions |

Web 配置界面

图形化配置,适合不熟悉命令行的用户:

ocs --web

自动打开浏览器,通过表单完成配置。支持:

  • 预置服务商下拉选择
  • 一键测试连接
  • 一键应用配置
  • 查看/管理已配置的服务商

配置管理命令

ocs list                          # 查看所有已配置的服务商
ocs test                          # 测试当前默认连接是否正常
ocs switch myproxy/gpt-4o         # 切换默认模型
ocs remove myproxy                # 删除某个服务商
ocs backup                        # 手动备份配置
ocs restore                       # 恢复配置(恢复最新备份)
ocs restore ~/.openclaw/backup.json   # 恢复指定备份文件
ocs activate                      # 重新激活授权
ocs deactivate                    # 清除本地授权
ocs license                       # 查看授权状态

未全局安装时,将 ocs 替换为 npx @evolution-of-silicon-based-life/openclaw-setup 即可。

Shell 脚本

Bash(Linux / macOS):

# 交互式
curl -fsSL https://raw.githubusercontent.com/evolution-of-silicon-based-life/openclaw-setup/main/scripts/setup.sh | bash

# 带参数
curl -fsSL https://raw.githubusercontent.com/evolution-of-silicon-based-life/openclaw-setup/main/scripts/setup.sh | bash -s -- \
  --url http://server:3000 --key sk-xxx --model gpt-4o

PowerShell(Windows):

# 交互式
irm https://raw.githubusercontent.com/evolution-of-silicon-based-life/openclaw-setup/main/scripts/setup.ps1 | iex

# 带参数
.\setup.ps1 -Url http://server:3000 -Key sk-xxx -Model gpt-4o

支持的服务商

| 服务商 | 类型 | 说明 | |--------|------|------| | OneAPI | 中转聚合 | 支持多家模型的统一 API 管理平台 | | NewAPI | 中转聚合 | OneAPI 的改进版本 | | OpenRouter | 国际聚合 | 聚合多家 AI 模型的国际平台 | | SiliconFlow | 国产平台 | 硅基流动,提供国产大模型 API | | 自定义 | 任意 | 任何 OpenAI 兼容的 API 地址 |

安全说明

  • API Key 以明文存储在 ~/.openclaw/openclaw.json 中(与 OpenClaw 原生行为一致)
  • 交互模式下 Key 输入有遮罩保护
  • 每次修改配置前自动备份,保留最近 3 份
  • 首次使用时需联网验证授权码(仅发送授权码和机器标识),验证通过后缓存到本地,后续使用不再联网

常见问题

Q: URL 要不要加 /v1 不需要,工具会自动补上。

Q: 配置写错了怎么恢复? 运行 ocs restore

Q: 可以同时配置多个服务商吗? 可以!多次运行工具,每次使用不同的 URL/Key/Model,工具会自动合并。用 ocs switch 切换默认模型。

Q: Windows 下配置文件在哪? %USERPROFILE%\.openclaw\openclaw.json(例如 C:\Users\你的用户名\.openclaw\openclaw.json

Q: 支持 Anthropic 协议吗? 支持,加 --api anthropic-messages 参数。

开发

git clone https://github.com/evolution-of-silicon-based-life/openclaw-setup.git
cd openclaw-setup
npm install
npm run build
node dist/cli.js

License

MIT