What is the CommandKit CLI?
The CommandKit CLI is a modern build tool that handles the entire lifecycle of your Discord bot development:- Zero-config TypeScript/JSX - Write TypeScript and JSX out of the box with no configuration
- Hot Module Reloading - Commands and events reload instantly during development
- Production Builds - Optimized bundling for deployment
- Code Generators - Scaffold commands, events, and custom templates
- Auto Type Generation - Automatic TypeScript types for your project
The CLI uses tsdown under the hood for fast, optimized bundling.
Available Commands
The CommandKit CLI provides these main commands:dev
Start development server with hot reloading
build
Build optimized production bundle
start
Run production build
create
Generate commands, events, and more
Installation
The CLI is included with the CommandKit package:commandkit command in your project:
Basic Usage
Development
Start your bot in development mode with hot reloading:Production Build
Build your bot for production:Generate Files
Create a new command:Global Options
All commands support these options:Config Path
Specify a custom config file location:By default, the CLI looks for
commandkit.js or commandkit.ts in your project root.Environment Variables
The CLI automatically loads environment variables from:.env- Base environment variables.env.local- Local overrides (gitignored).env.development- Development-specific variables.env.production- Production-specific variables
Zero-Config Features
The CommandKit CLI works out of the box with:- TypeScript - Full TypeScript support with no tsconfig needed
- JSX/TSX - Write Discord components with JSX syntax
- ESM - Modern ES modules by default
- Auto-imports - CommandKit exports are automatically available
- Source Maps - Full debugging support in development and production
Project Structure
The CLI expects this project structure:The CLI will automatically detect TypeScript if
tsconfig.json exists in your project.Next Steps
Learn more about specific CLI commands:Development Mode
Learn about hot reloading and the development workflow
Production Builds
Optimize and bundle your bot for deployment
Code Generators
Scaffold new commands and events quickly