Skip to content

Setup Wizard

bun run setup is the recommended self-host path for local Bun-based installs. It creates your .env, generates a CRYPTO_SECRET, asks for your Discord bot token, configures PostgreSQL, and installs the exact dependencies from bun.lock interactively, so just follow the prompts. It’s safe to re-run; existing .env values are kept unless you choose to reconfigure them.

Once you run the command, you’ll pick one of two paths:

Terminal window
bun run setup
Path Use When What It Does
Full Install You want the recommended setup with lightweight extras. Runs Base Install, then attempts the four extras below.
Base Install You want only the minimum working bot. Creates/configures .env, Discord token, PostgreSQL, and dependencies.
  • A Discord bot token with the GuildMembers, MessageContent, and GuildPresences privileged intents enabled.
  • A database. TomoriBot stores everything in PostgreSQL. You don’t set it up by hand as the wizard does it for you: it’ll use PostgreSQL if you already have it installed, or run one for you in Docker if you don’t. Just make sure one of the two is installed before you start.

If psql is missing or provisioning fails, the wizard prints the SQL to run by hand. Either way, TomoriBot initializes its schema, seeds, migrations, pgcrypto, and RAG schema automatically on first startup.

Full Install runs Base Install first, then tries to install the extras below. If any fails, it prints the command or guide to finish manually and keeps going:

Extra Purpose
pgvector Vector search for document/RAG memory.
pg_cron Optional scheduled cooldown/reminder-row cleanup.
Tokenizer assets Local tokenizer assets for model-aware logit bias.
URL Fetch MCP Python mcp-server-fetch for the bundled fetch_url fallback.

To install any of these by hand, see the Manual Setup extras.

Terminal window
bun run dev # bot only
bun run launch --searxng --crawl4ai # bot + sidecars (see bun run launch --help)

When the bot is online, run /config setup in Discord to add your AI provider key.

Use the backup-first updater command: bun run update

This runs bun run backup, then git pull --rebase --autostash, then bun install --frozen-lockfile. Add --build if you run from dist/, or --docker for a Compose deployment. Full details on the Maintenance & Backups page.