Skip to content

Environment Variables

The mycli API server reads all configuration from environment variables.

VariableDefaultDescription
DATABASE_URLpostgres://mycli:mycli@localhost:5432/mycli_dev?sslmode=disablePostgreSQL connection string
PORT8080Server listen port
JWT_SECRETdev-secret-change-meSecret for signing JWTs
BASE_URLhttp://localhost:8080Public base URL (used in magic link emails)
RESEND_API_KEY(empty)Resend API key for sending emails. When unset, emails are printed to stdout
EMAIL_FROMmycli@updates.mycli.shSender address for emails

For local development:

Terminal window
# Start PostgreSQL
docker compose up -d
# Run with defaults (dev mode)
make dev
# Or set variables explicitly
DATABASE_URL="postgres://mycli:mycli@localhost:5432/mycli_dev?sslmode=disable" \
JWT_SECRET=dev-secret \
BASE_URL=http://localhost:8080 \
PORT=8080 \
./bin/api

When RESEND_API_KEY is not set, the API uses a log sender that prints magic link emails to stdout. This is useful for development — copy the verification URL from the console output.

When RESEND_API_KEY is set, emails are sent via the Resend API using the address specified in EMAIL_FROM.