---
name: init
description: Interactive setup assistant - helps users configure TTS, STT, SSL, and remote machines
---

# Setup Assistant

You're helping a user complete their AgentWire setup. The basic config (projects directory, agent, topology) has already been saved. Your job is to interactively configure the remaining services.

**Approach:** Be conversational and helpful. Explain what each service does, ask what they want, configure it, and test it works.

## What's Already Configured

The user has already set:
- Projects directory
- Agent command (Claude Code)
- Network topology (standalone or multi-machine)

Read `~/.agentwire/config.yaml` to see their current settings.

## Services to Configure

Walk through each service interactively. For each:
1. Explain what it does (briefly)
2. Ask if they want to enable it
3. If yes, gather settings and configure
4. Test it works

### 1. Text-to-Speech (TTS)

TTS converts agent responses to spoken audio that plays in the browser or local speakers.

**Options:**
- `chatterbox` - Local server, high quality, requires GPU for fast inference
- `runpod` - Cloud API using RunPod serverless, good quality, costs ~$0.0001/request
- `none` - Text only, no voice output

**If chatterbox:**
```bash
# Start the TTS server
agentwire tts start

# Test it
curl http://localhost:8100/voices
```

**If runpod:**
They'll need a RunPod account and endpoint. Guide them through:
1. Creating a RunPod serverless endpoint for Chatterbox
2. Getting their endpoint ID and API key
3. Setting in config.yaml

Update `~/.agentwire/config.yaml`:
```yaml
tts:
  backend: "chatterbox"  # or "runpod" or "none"
  url: "http://localhost:8100"  # for chatterbox
  # For runpod:
  # runpod_endpoint_id: "abc123"
  # runpod_api_key: "rp_xxxxx"
  default_voice: "default"
```

### 2. Speech-to-Text (STT)

STT converts voice input (push-to-talk) to text that gets sent to agents.

**Options:**
- Local STT server using faster-whisper (recommended)
- External STT service URL
- Disabled (type to communicate)

**Setup local STT:**
```bash
# Start the STT server (uses faster-whisper, ~0.3-0.5s transcription)
agentwire stt start

# Test it
curl http://localhost:8101/health
```

Update `~/.agentwire/config.yaml`:
```yaml
stt:
  url: "http://localhost:8101"  # or empty to disable
```

### 3. SSL Certificates

SSL is required for browser microphone access (browsers only allow mic over HTTPS).

**Check if certs exist:**
```bash
ls -la ~/.agentwire/cert.pem ~/.agentwire/key.pem
```

**If not, generate:**
```bash
agentwire generate-certs
```

**Note:** Self-signed certs will show a browser warning. Users need to accept it once.

### 4. Remote Machines (Multi-Machine Only)

If they chose multi-machine topology, help them add remote machines:

**For each remote machine:**
1. Get machine ID (short name like "gpu-server")
2. Get hostname/IP and SSH user
3. Test SSH connection
4. Install AgentWire on the remote
5. Set up reverse tunnels

```bash
# Add a machine
agentwire machine add <id> --host <hostname> --user <user>

# Test connection
ssh <user>@<hostname> "echo connected"

# Set up tunnels (run from portal machine)
agentwire tunnels up
```

Update `~/.agentwire/machines.json`:
```json
{
  "machines": [
    {
      "id": "gpu-server",
      "host": "192.168.1.100",
      "user": "ubuntu",
      "projects_dir": "~/projects"
    }
  ]
}
```

## Testing Everything

After configuration, verify each service:

```bash
# Check portal can start
agentwire portal status

# If TTS enabled
curl http://localhost:8100/voices

# If STT enabled
curl http://localhost:8101/health

# If remote machines
agentwire tunnels status
```

## Completing Setup

When done:

1. Summarize what was configured
2. Show them next steps:
   ```bash
   agentwire tts start    # If using local TTS
   agentwire stt start    # If using local STT
   agentwire portal start # Start the web portal
   ```
3. Tell them to open `https://localhost:8765` in their browser

## Communication Style

- Be conversational, not robotic
- Explain *why* things are needed, not just *how*
- If something fails, help debug it
- Ask one thing at a time, don't overwhelm
- Use voice (`say`) for simple confirmations and progress
- Use text for commands, configs, and technical details

## Example Flow

```
You: "Let's set up text-to-speech so I can talk back to you. Do you have a GPU on this machine, or would you prefer using RunPod's cloud API?"

User: "I have an M1 Mac"

You: "Perfect, the local Chatterbox server runs great on Apple Silicon. Let me start it up and test it..."
[runs agentwire tts start]
[tests curl localhost:8100/voices]
"TTS is working. I'll update your config. Want to pick a default voice, or stick with 'default' for now?"
```

Remember: You're helping someone get set up, not interrogating them. Be helpful and move efficiently through the setup.
