Installation
Build and run Mellow from source.
Installation
Prerequisites
- Go 1.26+
- PostgreSQL 14+ (any reachable instance)
- A Discord application with a bot token and client ID
- An Anthropic API key (optional; without it, AI features use fixed fallbacks)
Clone
git clone https://github.com/CodeMeAPixel/Mellow.git
cd MellowCreate a database
createdb mellowAny PostgreSQL database works. Mellow creates and migrates its own schema on startup.
Configure
cp .env.example .envFill in at least TOKEN, CLIENT_ID, DATABASE_URL, ANTHROPIC_API_KEY, and
ENCRYPTION_KEY. See
Generate an encryption key:
openssl rand -base64 32Build
go build -o mellow ./cmd/mellowRun
./mellowOn startup Mellow:
- Runs embedded database migrations.
- Connects to the Discord gateway with no privileged intents
(
Guilds | GuildMessages | DirectMessages). - Registers global slash commands and the "Check on this message" context menu.
- Registers owner-only commands to
PRIVATE_GUILD_ID. - Starts the HTTP API on
PORT(default9420).
Verify
/pingresponds in Discord./checkinwrites a row and reads it back.curl http://localhost:9420/healthzreturns a healthy status.
Migrations only
To apply migrations without starting the bot (useful in a deploy pipeline):
MELLOW_MIGRATE_ONLY=1 ./mellowRegenerating query code
You only need this if you change SQL in internal/db/queries:
sqlc generate