Mellow LogoMellow

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 Mellow

Create a database

createdb mellow

Any PostgreSQL database works. Mellow creates and migrates its own schema on startup.

Configure

cp .env.example .env

Fill in at least TOKEN, CLIENT_ID, DATABASE_URL, ANTHROPIC_API_KEY, and ENCRYPTION_KEY. See

Configuration

Configuration

Environment and Discord application setup.

and the
Environment Variables reference

Environment Variables

Every environment variable Mellow reads.

.

Generate an encryption key:

openssl rand -base64 32

Build

go build -o mellow ./cmd/mellow

Run

./mellow

On startup Mellow:

  1. Runs embedded database migrations.
  2. Connects to the Discord gateway with no privileged intents (Guilds | GuildMessages | DirectMessages).
  3. Registers global slash commands and the "Check on this message" context menu.
  4. Registers owner-only commands to PRIVATE_GUILD_ID.
  5. Starts the HTTP API on PORT (default 9420).

Verify

  • /ping responds in Discord.
  • /checkin writes a row and reads it back.
  • curl http://localhost:9420/healthz returns a healthy status.

Migrations only

To apply migrations without starting the bot (useful in a deploy pipeline):

MELLOW_MIGRATE_ONLY=1 ./mellow

Regenerating query code

You only need this if you change SQL in internal/db/queries:

sqlc generate

On this page