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.
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/nyldn/claude-octopus/HEAD/.claude/commands/setup.md -o ~/.claude/commands/setup.mdsetup.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
set -euo pipefail
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 "agy:%s\n" "$(command -v agy >/dev/null 2>&1 && echo installed || echo missing)"
printf "agy_model:%s\n" "${OCTOPUS_AGY_MODEL:-}"
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" "$(if grep -q 'rtk' "${HOME}/.claude/settings.json" 2>/dev/null; then echo active; else echo missing; fi)"
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
Render the setup status table from actual detection output. Do not hand-write or summarize this provider block; run this block and display its output exactly. The output MUST include the Antigravity line even when `agy` is missing.
```bash
status_installed() { command -v "$1" >/dev/null 2>&1 && echo "Installed ✓" || echo "Missing ✗"; }
status_optional() { command -v "$1" >/dev/null 2>&1 && echo "Installed ✓" || echo "Not installed"; }
status_env() { [[ -n "${1:-}" ]] && echo "Configured ✓" || echo "Not set ✗"; }
codex_status="$(status_installed codex)"
gemini_status="$(status_installed gemini)"
agy_status="$(status_installed agy)"
agy_model_note=""
if [[ "$agy_status" == "Installed ✓" ]]; then
agy_model_note=" (model: ${OCTOPUS_AGY_MODEL:-agy default})"
fi
perplexity_status="$(status_env "${PERPLEXITY_API_KEY:-}")"
copilot_status="$(status_optional copilot)"
qwen_status="$(status_optional qwen)"
opencode_status="$(status_optional opencode)"
vibe_status="$(status_optional vibe)"
if command -v ollama >/dev/null 2>&1 && curl -sf http://localhost:11434/api/tags >/dev/null 2>&1; then ollama_status="Running ✓"; elif command -v ollama >/dev/null 2>&1; then ollama_status="Installed"; else ollama_status="Not installed"; fi
cat <<BANNER
🐙 Octopus Setup
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Providers:
🔴 Codex CLI: ${codex_status}
🟡 Gemini CLI: ${gemini_status}
🧭 Antigravity: ${agy_status}${agy_model_note}
🟣 Perplexity: ${perplexity_status}
🟢 Copilot CLI: ${copilot_status}
🟠 Qwen CLI: ${qwen_status}
🟤 OpenCode: ${opencode_status}
🔶 Vibe (Mistral): ${vibe_status}
⚫ Ollama: ${ollama_status}
🔵 Claude: Available ✓
BANNER
```
The rendered setup table must look like this shape, with ACTUAL statuses:
```
🐙 Octopus Setup
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Providers:
🔴 Codex CLI: [Installed ✓ / Missing ✗]
🟡 Gemini CLI: [Installed ✓ / Missing ✗]
🧭 Antigravity: [Installed ✓ (model: OCTOPUS_AGY_MODEL/agy default) / 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-compBackend architect for scalable API design, microservices, and distributed systems
Cloud architect for AWS/Azure/GCP infrastructure, IaC, FinOps, and multi-cloud strategies
Code review expert for quality analysis, security vulnerabilities, and production reliability
Database architect for data modeling, technology selection, schema design, and migration planning
Debugging specialist for errors, test failures, and unexpected behavior
Technical documentation architect for comprehensive system docs and architecture guides
Frontend developer for React, Next.js, responsive layouts, and accessible UI components
Performance engineer for optimization, observability, and scalable system performance