Setup guide
Self-host Sloth Lee in an afternoon; the hosted bot needs only the invite.
Create the Discord application
Open the Discord Developer Portal, create an application, and add a bot. Copy the application id (client id) and the bot token — the token never leaves your machine.
Invite the bot
Use the OAuth invite URL with scopes bot and applications.commands. Sloth Lee asks for the permissions it actually needs — nothing server-wide beyond that.
Configure environment
Copy .env.example to .env and fill in DISCORD_TOKEN, DISCORD_CLIENT_ID, DATABASE_URL and SECRETS_KEY — a 32-byte AES-256-GCM key (openssl rand -base64 32). The bot refuses to start without them.
Start Postgres
docker compose up -d creates a local dev database (user rev, database rev, bound to 127.0.0.1). Any Postgres 16 instance works — point DATABASE_URL at it.
Install, migrate, register, run
npm install (generates the Prisma client) → npm run db:migrate (applies committed SQL) → npm run commands:register (registers your slash commands) → npm run dev.
Verify and tune
Run /setup status for a server-specific readiness report. Set PORT to get /healthz and /readyz for container hosts like Northflank. Run exactly one bot process per deployment.
Environment variables
The essentials; the repo .env.example documents the full list.
| Variable | Required | Purpose |
|---|---|---|
| DISCORD_TOKEN | Yes, to run the bot | Bot token. Never commit it. |
| DISCORD_CLIENT_ID | Yes, to run or register commands | Application ID. |
| DATABASE_URL | Yes, to run the bot | Postgres URL. |
| SECRETS_KEY | Yes, to run the bot | 32-byte AES-256-GCM key; encrypts per-guild Ollama keys. |
| DISCORD_GUILD_ID | For guild command registration | Server snowflake for commands:register. |
| PORT | Optional | Enables the /healthz + /readyz health server for container hosts. |
| AI_DAILY_REQUEST_CAP | Optional | Daily Ollama request cap on new servers. Default 200. |
Rather not run anything?
The hosted bot is the same software — invite it, run /setup, done.