Skip to main content

Quickstart

1. Create a project

Non-interactive (CI or scripts) — you must pass a project name and --yes skips the wizard. Unspecified options use CLI defaults (modular, ts, npm, eslint-prettier, no database, no git/docker/ci/install unless flags are set):

npm create forgeloop@latest my-bot -- --yes --preset modular --language ts
CI and non-TTY sessions

Without a TTY, git, docker, ci, and install are not prompted and default to off unless you pass --git, --docker, --ci, or --install explicitly.

Interactive — run create without a name or with only init to step through prompts (requires a terminal):

npm create forgeloop@latest

or

npx create-forgeloop@latest init

2. Enter the directory and install

cd my-bot
npm install

If you passed --install during init, dependencies were already installed.

3. Environment variables

Copy the example env file and fill in values from the Discord Developer Portal:

cp .env.example .env
VariablePurpose
DISCORD_TOKENBot token
CLIENT_IDApplication (client) ID
GUILD_IDGuild used for development command sync (modular/advanced)
DATABASE_URLOnly when you chose a database — see Database

4. Database (optional)

If you selected SQLite or PostgreSQL + Prisma during init, run the Prisma workflow once before dev:

npm run db:push

5. Start the bot

npm run dev

For modular and advanced projects, the generated runtime calls syncCommands on startup: in development (NODE_ENV not production) commands sync to the guild from GUILD_ID; in production they sync globally.

What init prints

After files are written, the CLI prints a Project profile summary and a Next steps callout (install, .env, optional db:push, dev). Conceptually:

Example (illustrative output)
bash
forgeloop init my-bot --yes --preset modular --language ts
┌──────────────────────────────────────────────┐│ ForgeLoop init │└──────────────────────────────────────────────┘Scaffolding my-bot in …/my-botProject profile Language ts Preset modular Package manager npm✓ Project ready at …/my-botNext steps│ cd my-bot│ npm install│ Rename .env.example to .env

Next: Concepts — manifest, presets, and config files.