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

setup

# ClaudeWave Editor Response The `/octo:setup` command is an interactive configuration wizard that detects installed AI providers, authentication status, and system configuration for Claude Octopus. Use it on first install or when manually invoked to configure provider credentials, verify installations, set up remote session support, and optimize token usage across multiple AI backends including Codex, Gemini, Perplexity, Copilot, Qwen, Ollama, and Mistral.

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

setup.md

# Claude Octopus Setup

**Your first output line MUST be:** `🐙 Octopus Setup`

Interactive setup wizard. Detects what's installed, offers to install what's missing, configures auth, and optimizes token usage.

**This command auto-runs on first install** (via SessionStart hook). It also runs when users invoke `/octo:setup` manually.

**CRITICAL: This command MUST always run its interactive flow when invoked.** Never silently dismiss the user. Never say "you're already set up" without showing the dashboard and offering choices via AskUserQuestion. Even if everything is configured, the user invoked this command for a reason — show them their status and ask what they want to do.

## STEP 1: Detect Current State

Run a SINGLE comprehensive check:

```bash
echo "=== Provider Detection ==="
printf "codex:%s\n" "$(command -v codex >/dev/null 2>&1 && echo installed || echo missing)"
printf "codex_auth:%s\n" "$(codex --version >/dev/null 2>&1 && echo ok || echo none)"
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 "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)"
printf "vibe:%s\n" "$(command -v vibe >/dev/null 2>&1 && echo installed || echo missing)"
printf "vibe_auth:%s\n" "$(if ! command -v vibe >/dev/null 2>&1; then echo n/a; elif [ -f "${HOME}/.vibe/.env" ] && grep -Eq '^[[:space:]]*MISTRAL_API_KEY=' "${HOME}/.vibe/.env" 2>/dev/null; then echo env-file; elif [ -n "${MISTRAL_API_KEY:-}" ]; then echo api-key; elif [ -f "${HOME}/.vibe/config.toml" ] && grep -Eq '^[[:space:]]*api_key[[:space:]]*=' "${HOME}/.vibe/config.toml" 2>/dev/null; then echo config; else echo none; fi)"
printf "remote_session:%s\n" "$([[ "${CLAUDE_CODE_REMOTE:-}" == "true" || "${OCTOPUS_REMOTE_SESSION:-}" == "true" ]] && echo true || echo false)"
printf "octo_tier:%s\n" "${OCTO_TIER:-unset}"
echo "=== Companions ==="
printf "graphify:%s\n" "$(command -v graphify >/dev/null 2>&1 && echo installed || echo missing)"
GRAPHIFY_OUT_DIR="${GRAPHIFY_OUT:-graphify-out}"
printf "graphify_graph:%s\n" "$([ -f "${GRAPHIFY_OUT_DIR}/graph.json" ] && [ -f "${GRAPHIFY_OUT_DIR}/GRAPH_REPORT.md" ] && echo available || echo missing)"
echo "=== Token Optimization ==="
printf "rtk:%s\n" "$(command -v rtk >/dev/null 2>&1 && echo "installed $(rtk --version 2>&1 | head -1)" || echo missing)"
printf "rtk_hook:%s\n" "$(grep -q 'rtk' "${HOME}/.claude/settings.json" 2>/dev/null && echo active || echo missing)"
printf "octo_compress:%s\n" "$(command -v octo-compress >/dev/null 2>&1 && echo available || echo missing)"
echo "=== System ==="
printf "node:%s\n" "$(node --version 2>/dev/null || echo missing)"
printf "jq:%s\n" "$(command -v jq >/dev/null 2>&1 && echo installed || echo missing)"
printf "os:%s\n" "$(uname -s)"
```

## STEP 2: Display Status Summary

Show a compact table:

```
🐙 Octopus Setup
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Providers:
  🔴 Codex CLI:     [Installed ✓ / Missing ✗]
  🟡 Gemini CLI:    [Installed ✓ / Missing ✗]
  🟣 Perplexity:    [Configured ✓ / Not set ✗]
  🟢 Copilot CLI:   [Installed ✓ / Not installed]
  🟠 Qwen CLI:      [Installed ✓ / Not installed]
  🟤 OpenCode:      [Installed ✓ / Not installed]
  🔶 Vibe (Mistral): [Installed ✓ (auth: env-file/api-key/config) / Not installed]
  ��� Ollama:        [Running ✓ / Installed / Not installed]
  🔵 Claude:        Available ✓

Token Optimization:
  RTK:              [Installed + Hook active ✓ / Installed ✓ / Missing ✗]
  octo-compress:    [Available ✓ / Not in PATH]

Companions:
  Graphify:         [CLI installed ✓ / Missing] [Graph available ✓ / Missing]

Session:
  Remote/Web:       [Yes / No]
  Project tier:     [unset / prototype / mvp / production]
```

## STEP 2a: v9.29 Migration Prompt (one-time, existing users only)

**Before showing the main menu, check if this is an existing user upgrading from ≤9.28.**

Run this bash check — skip migration if state is fresh (first-run) or already ≥9.29:

```bash
STATE_FILE="${HOME}/.claude-octopus/state.json"
if [[ -f "$STATE_FILE" ]] && command -v jq >/dev/null 2>&1; then
  LAST_VERSION=$(jq -r '.last_version // "0.0.0"' "$STATE_FILE" 2>/dev/null)
  MODEL_DEFAULTS_V2=$(jq -r '.model_defaults_v2 // "unset"' "$STATE_FILE" 2>/dev/null)
  # Version compare: show migration only if last_version is between 1.x and 9.28
  if [[ "$LAST_VERSION" != "0.0.0" ]] && [[ "$MODEL_DEFAULTS_V2" == "unset" ]]; then
    printf "MIGRATION_PROMPT_NEEDED\nlast_version=%s\n" "$LAST_VERSION"
  fi
fi
```

**If `MIGRATION_PROMPT_NEEDED` appears**, show this AskUserQuestion BEFORE the main menu:

```javascript
AskUserQuestion({
  questions: [{
    question: "v9.29.0 refreshed model defaults based on April 2026 benchmarks. Planning + security reviews now use Claude Opus 4.7 (best on SWE-bench Pro + LMArena). Code review + implementation stay on GPT-5.4 (best on Terminal-Bench + edge cases). Opus is ~2x the cost of GPT-5.4 per MTok — this will increase planning-phase cost. How would you like to proceed?",
    header: "v9.29 Models",
    multiSelect: false,
    options: [
      {label: "Accept new defaults (Recommended)", description: "Use Opus 4.7 for planning/strategy/security, GPT-5.4 for review/implementation"},
      {label: "Keep v9.28 defaults (GPT-5.4 everywhere)", description: "Sets OCTOPUS_LEGACY_ROLES=1 in your shell profile"},
      {label: "Open /octo:model-config", description: "Customize per-role routing directly"},
      {label: "See the diff", description: "Show before/after