The Discord Bot With NestJS CLI is a command-line tool designed to simplify the process of creating Discord bots using the NestJS framework. With a user-friendly interface and minimal configuration, this CLI streamlines the setup of a robust and scalable bot project.
- Automated project setup using NestJS CLI.
- Custom module and service for Discord.js integration.
- Supports popular package managers: npm, yarn, and pnpm.
- Includes environment variable setup for secure bot token management.
- Keeps terminal output clean and focused with spinner feedback.
Before using this CLI, ensure the following:
- Node.js installed (version 16+ recommended).
- A valid Discord bot token. Learn how to create a bot.
First, install the CLI globally using npm:
npm install -g discord-bot-nestjs-cli
init
: Create a new Discord bot project.version
: Display the CLI version.help
: Show available commands and their usage.
Run the following command to create a new project:
discord-bot-nestjs-cli init
The CLI will prompt you for:
- Project Name: Name of the folder where the project will be created.
- Package Manager: Choose between npm, yarn, or pnpm.
-
Run the
init
command:discord-bot-nestjs-cli init
-
Follow the prompts to configure the project.
-
Navigate to the project folder:
cd <project-name>
-
Start the development server:
npm run start:dev
or
yarn start:dev
The CLI sets up a project with the following structure:
<project-name>/
├── src/
│ ├── discord/
│ │ ├── discord.module.ts
│ │ ├── discord.service.ts
├── package.json
├── .env
src/discord
: Contains the module and service for Discord bot functionality..env
: Holds theDISCORD_ENV
variable for your bot token.
The .env
file includes:
DISCORD_ENV=your_discord_bot_token_here
Replace your_discord_bot_token_here
with your actual Discord bot token.
Contributions are welcome! Feel free to fork the repository, make improvements, and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Created by Mquiuqui to simplify Discord bot development with NestJS.