Skip to main content
ClaudeWave
Slash Command3.6k estrellas del repoactualizado yesterday

model-config

The model-config command detects installed AI providers (Codex, Gemini, Perplexity, OpenRouter, Copilot, Qwen, Ollama) within Claude Octopus workflows, displays their configuration status, and launches an interactive wizard for users to select and configure preferred models for routing requests. Use this when setting up or modifying AI provider integrations for Octopus-based automation pipelines.

Instalar en Claude Code
Copiar
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/nyldn/claude-octopus/HEAD/.claude/commands/model-config.md -o ~/.claude/commands/model-config.md
Después abre una sesión nueva de Claude Code; el slash command carga automáticamente.

model-config.md

# Model Configuration

**Your first output line MUST be:** `🐙 Octopus Model Config`

## STEP 0: Emit Banner (MANDATORY — run before AskUserQuestion or any other step)

```bash
echo "🐙 Octopus Model Config"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "provider | model | config | routing | cost"
```

**Preflight — Ensure plugin root is resolvable (run via Bash tool):**

```bash
OCTO_ROOT="${HOME}/.claude-octopus/plugin"
if [[ ! -x "$OCTO_ROOT/scripts/orchestrate.sh" ]]; then
  helper="$OCTO_ROOT/scripts/helpers/ensure-plugin-root.sh"
  if [[ ! -x "$helper" ]]; then
    helper="$(find "${HOME}/.claude/plugins/cache" "${HOME}/Library/Application Support/Claude" "${LOCALAPPDATA:-/dev/null}/Claude" "${XDG_DATA_HOME:-${HOME}/.local/share}/Claude" -maxdepth 8 -path "*/nyldn-plugins/octo/*/scripts/helpers/ensure-plugin-root.sh" -print -quit 2>/dev/null)"
  fi
  [[ -x "$helper" ]] && bash "$helper" >/dev/null 2>&1 || true
fi
test -x "$OCTO_ROOT/scripts/orchestrate.sh" && echo "plugin-root:ok" || echo "plugin-root:missing"
```

If the output is `plugin-root:missing`, stop and ask the user to run `/octo:setup`.

Run this unconditionally — even when arguments are provided or when going to interactive wizard. The explicit bash block ensures the banner emits even when the command routes straight to `AskUserQuestion` (which historically skipped the inline-prose instruction and broke E2E pattern matching — see #301).

Interactive model configuration wizard. Detects installed providers, shows current settings, and guides users through configuration with AskUserQuestion.

## STEP 1: Detect & Display

Run a SINGLE comprehensive detection command:

```bash
echo "=== Provider Detection ==="
printf "codex:%s\n" "$(command -v codex >/dev/null 2>&1 && echo installed || echo missing)"
printf "gemini:%s\n" "$(command -v gemini >/dev/null 2>&1 && echo installed || echo missing)"
printf "perplexity:%s\n" "$([ -n "${PERPLEXITY_API_KEY:-}" ] && echo configured || echo missing)"
printf "openrouter:%s\n" "$([ -n "${OPENROUTER_API_KEY:-}" ] && echo configured || echo missing)"
printf "copilot:%s\n" "$(command -v copilot >/dev/null 2>&1 && echo installed || echo missing)"
printf "qwen:%s\n" "$(command -v qwen >/dev/null 2>&1 && echo installed || echo missing)"
printf "ollama:%s\n" "$(command -v ollama >/dev/null 2>&1 && curl -sf http://localhost:11434/api/tags >/dev/null 2>&1 && echo running || command -v ollama >/dev/null 2>&1 && echo installed || echo missing)"
printf "opencode:%s\n" "$(command -v opencode >/dev/null 2>&1 && echo installed || echo missing)"
echo "=== Config ==="
if [[ -f ~/.claude-octopus/config/providers.json ]]; then
  cat ~/.claude-octopus/config/providers.json
else
  echo "NO_CONFIG"
fi
echo "=== Env ==="
env | grep -E '^OCTOPUS_|^CLAUDE_MODEL=' 2>/dev/null || echo "none"
```

Then display a compact dashboard:

```
🐙 Octopus Model Config
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Providers                          Status
  🔵 Claude (Sonnet/Opus)          Built-in ✓
  🔴 Codex (GPT-5.4)              [Installed ✓ / Missing ✗]  → current: <model>
  🟡 Gemini                        [Installed ✓ / Missing ✗]  → current: <model>
  🟣 Perplexity                    [Configured ✓ / Not set]
  🟠 OpenRouter                    [Configured ✓ / Not set]
  ...other installed providers...

Phase Routing
  discover → <model>    define  → <model>
  develop  → <model>    deliver → <model>
  review   → <model>    security → <model>
  debate   → <model>    research → <model>

Cost Mode: <standard/budget/premium>
```

Only show providers that are installed or configured. Don't show rows for providers the user doesn't have.

## STEP 2: Route by Arguments

**If arguments were provided** (e.g., `/octo:model-config codex gpt-5.4`), skip the interactive flow and execute the CLI-style command directly per the EXECUTION CONTRACT at the bottom.

**If no arguments**, proceed to the interactive wizard:

## STEP 3: Interactive Menu

```
AskUserQuestion({
  questions: [{
    question: "What would you like to configure?",
    header: "Model Config",
    multiSelect: false,
    options: [
      {label: "Provider defaults", description: "Set default models for Codex, Gemini, OpenRouter, etc."},
      {label: "Phase routing", description: "Choose which model handles each workflow phase (discover, develop, review, etc.)"},
      {label: "Debate & multi-LLM", description: "Configure which providers participate in debates, parallel execution, and reviews"},
      {label: "Session provider availability", description: "Temporarily enable or disable providers for this Claude Code session"},
      {label: "Cost mode", description: "Switch between budget, standard, and premium model tiers"},
      {label: "Reset to defaults", description: "Reset all or specific provider configuration"}
    ]
  }]
})
```

### Route: Provider Defaults

Build options dynamically from detected providers. Only show providers that are installed/configured:

```
AskUserQuestion({
  questions: [{
    question: "Which provider do you want to configure?",
    header: "Provider",
    multiSelect: false,
    options: [
      // Always show:
      {label: "🔵 Claude", description: "Current: claude-sonnet-4.6 / claude-opus-4.7 (legacy 4.6 available) — built-in, no config needed"},
      // Only if codex installed:
      {label: "🔴 Codex (OpenAI)", description: "Current: <current_model> — handles implementation, reasoning"},
      // Only if gemini installed:
      {label: "🟡 Gemini (Google)", description: "Current: <current_model> — handles research, creative tasks"},
      // Only if perplexity configured:
      {label: "🟣 Perplexity", description: "Current: <current_model> — handles web search, real-time data"},
      // Only if openrouter configured:
      {label: "🟠 OpenRouter", description: "Current: <current_model> — routes to GLM, Kimi, DeepSeek"},
      // Only if opencode installed:
      {label: "🟤 OpenCode", description: "Current: <current