# Quick Reference Card

## 🚀 Most Common Commands

### Start/Stop

```bash
# Start user1 only
docker compose -f docker-compose.multi.env.yml up -d nanobot-user1

# Start all bots
docker compose -f docker-compose.multi.env.yml up -d

# Stop user1 only
docker compose -f docker-compose.multi.env.yml stop nanobot-user1

# Stop all bots
docker compose -f docker-compose.multi.env.yml down

# Restart user1
docker compose -f docker-compose.multi.env.yml restart nanobot-user1
```

### Logs

```bash
# View logs (follow)
docker logs -f nanobot-user1

# View last 50 lines
docker logs --tail 50 nanobot-user1
```

### Status

```bash
# Check what's running
docker compose -f docker-compose.multi.env.yml ps

# Check specific container
docker ps | grep nanobot-user1
```

### Configuration

```bash
# Edit shared settings
nano .env.shared
docker compose -f docker-compose.multi.env.yml restart

# Edit bot-specific settings
nano .env.user1
docker restart nanobot-user1

# Edit config file
nano ~/.nanobot-user1/config.json
docker restart nanobot-user1
```

### Development

```bash
# Use dev mode (mounts source code)
docker compose -f docker-compose.multi.dev.yml up -d nanobot-user1

# After code changes
docker compose -f docker-compose.multi.dev.yml restart nanobot-user1
```

## 📁 File Locations

| What | Where |
|------|-------|
| Shared settings | `.env.shared` |
| Bot 1 settings | `.env.user1` |
| Bot 1 config | `~/.nanobot-user1/config.json` |
| Production compose | `docker-compose.multi.env.yml` |
| Dev compose | `docker-compose.multi.dev.yml` |

## 🧭 Which Compose File?

| File | Best For | Uses env files? |
|------|----------|-----------------|
| `docker-compose.yml` | Single bot (`nanobot-gateway` + optional `nanobot-cli`) | No |
| `docker-compose.multi.yml` | Multi-bot with per-user config directories | No |
| `docker-compose.multi.env.yml` | Multi-bot with shared + per-user env overrides (recommended) | Yes: `.env.shared` then `.env.userX` |
| `docker-compose.multi.dev.yml` | Same as above, but with source code mounted for development | Yes: `.env.shared` then `.env.userX` |

## 🔧 Troubleshooting

```bash
# Bot not responding?
docker logs nanobot-user1 --tail 50

# Connection error?
grep API_BASE .env.shared  # Should be 172.17.0.1:11434

# Config not loading?
docker exec nanobot-user1 cat /root/.nanobot/config.json
```

## 📖 Full Documentation

See `DOCKER_MULTI_BOT_GUIDE.md` for complete guide.


