Skip to main content
Get started with CommandKit by creating a new project using create-commandkit. The CLI will scaffold a complete project structure and configure everything you need to start building your bot.

Prerequisites

Before you begin, make sure you have Node.js installed on your system.
CommandKit requires Node.js 24 or higher. Check your version with node -v.

Create a new project

The fastest way to get started is with create-commandkit, which scaffolds a complete CommandKit project with a single command:
npm create commandkit@latest
You can also specify a project name directly:
npm create commandkit@latest my-discord-bot

Setup wizard

The CLI will guide you through the setup process with interactive prompts:
1

Choose a project directory

Enter the name of your project directory, or leave blank to use the current directory.
Enter a project directory: my-bot
2

Provide your Discord bot token (optional)

You can enter your Discord bot token now, or add it later to the .env file. The token is securely stored in .env and never committed to version control.
Get your bot token from the Discord Developer Portal. Create a new application, go to the “Bot” section, and click “Reset Token”.
3

Initialize Git repository

Choose whether to initialize a Git repository for version control. Recommended for most projects.
After completing the wizard, create-commandkit will:
  • Download the project template
  • Create a .env file with your bot token
  • Install all dependencies automatically
  • Initialize a Git repository (if selected)

Additional options

The CLI supports several flags for automated setup:
# Use a specific example template
npm create commandkit@latest --example basic-ts

# Skip package installation
npm create commandkit@latest --skip-install

# Disable Git initialization
npm create commandkit@latest --no-git

# Use specific package manager
npm create commandkit@latest --use-pnpm

# List all available examples
npm create commandkit@latest --list-examples

# Use defaults for all options
npm create commandkit@latest --yes

Project structure

Once installation is complete, your project will have the following structure:
my-bot/
├── src/
│   ├── app/
│   │   ├── commands/      # Your bot commands go here
│   │   │   └── ping.ts    # Example ping command
│   │   └── events/        # Your event listeners go here
│   │       └── clientReady/
│   │           └── log.ts # Example ready event
│   └── app.ts            # Discord client configuration
├── .env                  # Environment variables (bot token)
├── .gitignore           # Git ignore rules
├── commandkit.config.ts # CommandKit configuration
├── package.json         # Project dependencies
└── tsconfig.json        # TypeScript configuration

Key directories

  • src/app/commands/: All your bot commands. Each file exports command handlers.
  • src/app/events/: Event listeners organized by event name. Each subdirectory corresponds to a Discord.js event.
  • src/app.ts: Your Discord.js client instance with intents and configuration.
  • commandkit.config.ts: CommandKit framework configuration (mostly optional).
The src/app/ directory structure follows convention-based routing. Files placed in commands/ are automatically registered as commands. Files in events/[eventName]/ are registered as listeners for that event.

What’s included

Your new project comes with:
  • Example ping command that responds to /ping (slash) and !ping (prefix)
  • Example ready event that logs when the bot starts
  • Zero-config TypeScript setup with full type safety
  • Development scripts for running and building your bot
  • Environment variable management with .env

Next steps

Quickstart

Learn how to run your bot and create your first command

Build docs developers (and LLMs) love