Mellow LogoMellow

Environment Variables

Every environment variable Mellow reads.

Environment variables

Mellow loads a .env file if present, then reads the environment. A starting point is .env.example in the repository.

Required

VariableDescription
TOKENDiscord bot token.
CLIENT_IDDiscord application (client) ID. Used for the invite link.
DATABASE_URLPostgreSQL connection string, e.g. postgres://user:pass@host:5432/mellow?sslmode=require. Use sslmode=disable only for a local database.
ANTHROPIC_API_KEYAnthropic API key. Without it, AI features fall back to fixed responses.
ENCRYPTION_KEY32-byte key for per-field AES-256-GCM encryption. If unset, data is stored as plain text (development only).
VariableDefaultDescription
PRIVATE_GUILD_ID-Guild that owner-only commands are registered to.
OWNER_IDS-Comma-separated Discord user IDs allowed to run owner commands.
ENCRYPTION_SALT_LISTmellow-encryption-saltComma-separated salts. Writes use the first; reads try all. Add a new salt to the front to rotate keys.
PORT9420Port for the HTTP API.
API_TOKEN-Bearer token required by POST /v1/chat and POST /v1/feedback.
LOG_LEVELinfodebug, info, warn, or error.
LOG_CHANNEL_ID-Discord channel for internal system logs (gateway, guild join/leave, startup).

Defaults are derived from WEBSITE_URL when not set explicitly.

VariableDefault
WEBSITE_URLhttps://mymellow.xyz
DOCS_URL<WEBSITE_URL>/docs
SUPPORT_URL<WEBSITE_URL>/support
INVITE_URL<WEBSITE_URL>/invite
SOURCE_URLhttps://github.com/CodeMeAPixel/Mellow

Status posting

VariableDescription
MELLOW_STATUS_API_KEYKey sent (as apiKey in the body) when posting the 5-minute status heartbeat to the website. The website checks it against its own MELLOW_STATUS_API_KEY.
STATUS_API_URLHeartbeat endpoint. Defaults to <WEBSITE_URL>/api/status.

The website's status page reads live per-shard detail directly from the bot's GET /v1/status; point the site's MELLOW_BOT_API_URL at the bot's HTTP API base for that.

GitHub (version checks and /tools github)

VariableDescription
GITHUB_TOKENOptional token for higher GitHub API rate limits.
GITHUB_REPOowner/repo. Defaults to CodeMeAPixel/Mellow, or is derived from SOURCE_URL.

Changelog

VariableDescription
PATCHNOTES_PATHPath to PATCHNOTES.md, read by the owner-only /changelog command.

Omniplex integration

VariableDescription
OMNIPLEX_TOKENToken for the Omniplex integration. Leave empty to disable.
OMNIPLEX_BASE_URLBase URL for the Omniplex API.

Operational flags

VariableDescription
MELLOW_MIGRATE_ONLYIf set, run database migrations and exit without starting the bot.
MELLOW_FORCE_DEPLOYIf set, force a full re-registration of slash commands on startup.

Notes

  • Database migrations are embedded and run automatically at startup (before anything else).
  • Command registration happens on startup: global commands overwrite the global set, and owner-only commands are pushed to PRIVATE_GUILD_ID.

On this page