Eclia9x9

Set Agent Provider — AI skill for Claude Code

AI community

Configure a model provider across all installed AI CLIs (Claude Code, Codex, OpenCode, pi, dsh) with one command.

How to install Set Agent Provider

This entry records only its repository, not the path inside it, so there is no exact command to give. Open Eclia9x9/set-agent-provider and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Set Agent Provider does

Configure a model provider across all installed AI CLIs (Claude Code, Codex, OpenCode, pi, dsh) with one command.

Alternatives in AI

  • Botmux — Bridge Feishu/Lark to AI coding CLIs — Claude Code, Codex, Gemini, OpenCode… every DM, group or topic spawns i 1.2k ★
  • Claudexor — Multi-harness control plane for Claude Code, Codex, Cursor, and OpenCode: quota-aware rotation across multiple 425 ★
  • HarnessKit — More than a skill manager — manage skills, MCP servers, plugins, hooks, CLIs, configs, memory & rules across e 416 ★

README

English | 简体中文

set-agent-provider

为某个模型提供商,一键设置机器上**所有**已安装的 AI CLI。

给一个提供商(哪怕只是一个域名),它就会自动探测出 base URL 与模型, 并为每个检测到的 AI CLI 写入各自的原生配置 —— Claude Code、Codex、OpenCode、 pi 和 dsh —— 一键完成所有客户端的配置:

npx set-agent-provider -D api.deepseek.com

换任何 OpenAI 兼容的提供商,也只需换一个域名:

npx set-agent-provider -D api.example.com -K sk-xxxxxxxx

安装 / 使用

npx set-agent-provider --name foo \
  --baseUrl https://api.example.com/v1 \
  --apiKey sk-xxxxxxxx \
  --models '[{"id":"gpt-5.6-sol","name":"GPT-5.6 SOL","reasoning":true,"limit":{"context":272000,"output":128000}}]'

也支持短选项:

npx set-agent-provider -N foo -U https://api.example.com/v1 -K sk-xxxxxxxx \
  -M '[{"id":"gpt-5.6-sol","name":"GPT-5.6 SOL","reasoning":true,"limit":{"context":272000,"output":128000}}]'

不带任何参数运行,会进入交互式英文向导:

npx set-agent-provider

选项

选项 短选项 说明
--name -N 提供商名称(默认取 baseUrl 的主机名)
--baseUrl -U 提供商 base URL(必填;交互模式下缺省会提示输入;需完整 URL)
--apiKey -K 提供商 API key(可选;缺省时交互式提示,可留空)
--models -M 模型列表,严格 JSON
--target -T 逗号分隔的目标:claude,codex,opencode,pi,dsh
--config -C 配置来源:本地文件、URL 或裸域名(与 -D 互斥)
--domain -D 从裸域名自动探测提供商(先配置,再端点探测)
--status 显示每个已安装 CLI 当前的提供商配置
--help -h 显示帮助
--version -v 显示版本

模型

`--models` 接收严格的 JSON 数组。每一项:

字段 说明
id 模型 id
name 显示名称
reasoning 是否为推理模型
limit.context 上下文窗口
limit.output 最大输出 token 数

如果省略 `--models`,工具会携带 API key 请求 `{baseUrl}/v1/models`, 并让你交互式选择(空格切换、回车确认)。任何失败(含 401)或空列表都会报错, 此时请用 `-M/--models` 直接提供模型列表。

配置来源

`--config` 支持:

  • 本地文件路径:-C ./config.json
  • 完整 URL:-C https://example.com/set-agent-provider-config.json
  • 裸域名:-C example.com → 依次尝试 https:// 和 http:// 下的 /set-agent-provider-config.json

配置文件字段与命令行选项一致:

{
  "name": "examp