Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

provider-switch

БесплатноЗапускает вложенные скриптыНе проверен

Configure alt API providers: DeepSeek, Z.ai/GLM, Qwen, MiniMax, OpenRouter. Triggers: switch provider, openrouter.

kochetkov-maот kochetkov-ma★ 41 звезда на GitHub

Об этом скилле

[DICT: P=Phase, PRV=provider, EXEC=EXECUTE using Bash tool, AUQ=AskUserQuestion, REF=references, ALIAS=shell alias, CFG=configured, BASE=ANTHROPIC_BASE_URL, MOD=ANTHROPIC_DEFAULT_OPUS_MODEL]

Provider Switch

Claude Code alt API providers, each an isolated ALIAS in ~/.zshrc: DeepSeek V4 (priority default, 1M ctx, native Anthropic endpoint; recommend first), Z.ai/GLM, Qwen/DashScope, MiniMax, OpenRouter.

Prompt contract

$ARGUMENTS is one free-form RU/EN prompt; mode tokens and flags may sit anywhere in it.

  1. Mode: an explicit mode token wins outright; else the most distinct whole-word keyword hits (mode table in P1 below). Tie with a destructive mode -> AskUserQuestion; with status -> status; of two mutating modes -> the keyword that comes first. No hit or empty -> status.
  2. Scope: prose that is not a mode/provider name is still input: take the provider or scope from it.
  3. Ask: at most ONE AskUserQuestion (max 4 questions) to resolve mode and scope, before any work, only when the answer changes what gets written. status itself is read-only and asks nothing.

Print once, before the first action (labels literal, values in the conversation language):

PLAN — brewtools:provider-switch
INPUT:  <arguments verbatim, or "(empty)">
MODE:   <resolved> — <explicit | matched keyword: X | default>
SCOPE:  <resolved paths / target / level / flags>
DO:     <2-5 imperative bullets>
RESULT: <what the user ends up holding>

Robustness Rules (MANDATORY)

Rule Scope
Every Bash call: && echo "OK ..." || echo "FAILED ..." ALL
On FAILED: stop phase, report error, !=retry blindly ALL
Max 3 AUQ per phase ALL
!=write secrets anywhere except ~/.zshrc ALL
!=ask for, receive, repeat or compose a key value (no AUQ, prompt or Bash line with it): the user places it out of band, scripts/read-secret.sh moves it. CC 2.1.296 has no masked input: AUQ answers land in the transcript; sensitive userConfig never reaches skill content ALL
!=commit ~/.zshrc changes ALL
~/.zshrc comments: ENGLISH only ALL writes

Error format on ANY failure:

SCRIPT_ERROR: <name>
PHASE: <current>
ACTION: <attempted>
SUGGESTION: <fix>

P0: Language Selection

Read-only modes: conversation language, no question. Mutating modes, language unresolved only: "Select language / Выберите язык" | "English (Recommended)", "Russian / Русский"; skipped → English for the session.


P1: Mode Detection

EXEC (quoted heredoc: quotes, backticks and $( in the prompt stay inert text):

IFS= read -r -d '' ARGS <<'__SKILL_ARGS__' || true
$ARGUMENTS
__SKILL_ARGS__
ARGS=${ARGS%$'\n'}
bash "${CLAUDE_SKILL_DIR}/scripts/detect-mode.sh" "$ARGS" && echo "OK detect" || echo "FAILED detect"

FAILED → report it and match the prompt against the table by hand; never retry blindly.

Output: ARGS: [...] MODE: [...]

Mode EN keywords RU keywords Mutates?
status (empty), status, check статус, проверь no
install install, configure настрой, установи, поставь yes
help help, how помощь, как no
provider-deepseek deepseek, ds, dpsk дипсик yes
provider-glm glm, zai, z.ai глм, зай yes
provider-qwen qwen, dashscope квен, дашскоуп yes
provider-minimax minimax, mini минимакс yes
provider-openrouter openrouter, router опенроутер, роутер yes
verify verify, test, token проверка, тест, токен no
model-check model-check, identify проверь модель, идентифицируй no

Typos (model-cehck, cehck, hlpe, instal, ...) fuzzy-match to the closest row above.

PLAN goes before any P0 question or P1/P2 call; DO for read-only modes = "probe state, report"; install names the intended PRV scope, resolved in P3 before P4's first write.


P2: Status Check (ALL modes)

EXEC:

bash "${CLAUDE_SKILL_DIR}/scripts/check-status.sh" && echo "OK status" || echo "FAILED status"

STOP if FAILED — report the secret-free error; never print raw ~/.zshrc/key assignments into context.

Per PRV: configured = ALIAS + KEY true; partial = ALIAS true, KEY false; not configured = ALIAS false; active = ACTIVE_PROVIDER matches. Render:

# Provider Switch — [MODE]
## Current Status
| PRV | Alias | API Key | Model | Status |
|-----|-------|---------|-------|--------|
| DeepSeek (priority) | claudeds | DEEPSEEK_API_KEY | deepseek-v4-pro | ... |
| Z.ai / GLM | claudeglm | ZAI_API_KEY | glm-5.2 | ... |
| Qwen | claudeqwen | DASHSCOPE_API_KEY | qwen3.7-plus[1m] | ... |
| MiniMax | claudeminimax | MINIMAX_API_KEY | MiniMax-M3 | ... |
| OpenRouter | claudeor | OPENROUTER_API_KEY | (user-selected) | ... |

## How to Use
Run `claudeds` — sets env vars + launches Claude (recommended default).
Return to Anthropic: new terminal → `claude`.

status is TERMINAL — it never writes and neve

Полный SKILL.md на GitHub

Установить provider-switch в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Edit
Bash
Agent
AskUserQuestion
Glob
Grep

Вложенные файлы

README.mdreferences/common.mdreferences/deepseek.mdreferences/minimax.mdreferences/openrouter-models.mdreferences/openrouter.mdreferences/qwen-dashscope.mdreferences/update-protocol.mdreferences/zai-glm.mdscripts/check-status.shscripts/detect-mode.shscripts/provider-alias.pyscripts/read-secret.shscripts/verify-providers.shscripts/write-alias.sh

FAQ

Что делает скилл provider-switch?

Configure alt API providers: DeepSeek, Z.ai/GLM, Qwen, MiniMax, OpenRouter. Triggers: switch provider, openrouter.

Как установить скилл provider-switch?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл provider-switch запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить provider-switch с