Skip to main content
Version: Next

CommandKit Configuration

CommandKit CLI can be configured using commandkit.config file in the root of your project directory (for example, by package.json). You can use either of the following files:

  • commandkit.config.js
  • commandkit.config.mjs
  • commandkit.config.cjs
  • commandkit.config.ts

Throughout this guide, we'll be using commandkit.config.ts as an example.

The following is the sample configuration required to run your bot:

commandkit.config.ts
import { defineConfig } from 'commandkit';

export default defineConfig({});

Options

The following options are available in the configuration file:

  • plugins: An array of commandkit plugins to use in your project. CommandKit plugins may add compile time or runtime features to your project.
  • esbuildPlugins: An array of esbuild plugins to use in your project. This is useful if you want to use esbuild plugins in your project.
  • compilerOptions: An object containing compiler options for your project.
  • compilerOptions.macro.development: When set to true, it enables macro compilation during development.
  • compilerOptions.cache.development: When set to true, it enables use cache directive during development.
  • distDir: The output directory for the build. By default, it is set to dist.
  • env: An object containing static environment variables definitions.
  • typedCommands: A boolean value that enables type definitions generation for commands during development.
  • typedLocales: A boolean value that enables locales autocompletion during development.