commandkit 1.2.0-dev.20260208011555 → 1.2.0-dev.20260208122102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -6,43 +6,62 @@
|
|
|
6
6
|
<a href="https://www.npmjs.com/package/commandkit"><img src="https://img.shields.io/npm/dt/commandkit?maxAge=3600" alt="npm downloads" /></a>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
|
-
<p align="center">
|
|
9
|
+
<p align="center">Stop rebuilding command and event handlers for every new discord.js bot. CommandKit does it for you — and a lot more.</p>
|
|
10
|
+
|
|
11
|
+
## Why CommandKit?
|
|
12
|
+
|
|
13
|
+
Every new discord.js project starts the same way: write a command handler, write an event handler, set up interaction collectors, register slash commands with the API, figure out a project structure. It's hours of boilerplate before you write any real bot logic.
|
|
14
|
+
|
|
15
|
+
Most existing discord.js frameworks solve this by giving you a handler class you instantiate and point at a folder — and that's about it. They're loaders, not frameworks. Others like Sapphire go further and have decent features, but require heavy OOP boilerplate where everything is a class extending a base class.
|
|
16
|
+
|
|
17
|
+
CommandKit takes a different approach entirely. It works like a proper meta-framework — think **Next.js for Discord bots**. It ships with a smart CLI that handles bundling, TypeScript/JSX compilation, hot-reloading, command registration, and project scaffolding automatically. You run `commandkit dev` and everything just works — zero configuration.
|
|
18
|
+
|
|
19
|
+
The design philosophy is **convention over configuration**: put a file in `src/app/commands/` and it's a command. Put a file in `src/app/events/` and it's an event listener. Export a `chatInput` function and it handles slash commands. Export a `message` function in the same file and it handles prefix commands too. No registration calls, no base classes, no decorators. The framework knows what to do with your code based on where it is and what it exports — so you skip the setup and go straight to building.
|
|
10
20
|
|
|
11
21
|
## Features
|
|
12
22
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- Slash + context menu commands + prefix commands support ✅
|
|
16
|
-
- Automatic command registration and updates 🤖
|
|
17
|
-
- Command middlewares for easy command management 🛠️
|
|
18
|
-
- Localization support through `@commandkit/i18n` plugin 🌍
|
|
19
|
-
- Plugin system to extend functionality 🔌
|
|
20
|
-
- Built-in command line interface for easy development 🖥️
|
|
21
|
-
- Out-of-the-box support for TypeScript and JavaScript 📜
|
|
22
|
-
- Built-in customizable cache system for speedy data storage and retrieval 🗄️
|
|
23
|
-
- User installable/guild scoped commands 🔧
|
|
24
|
-
- Custom events support 🔔
|
|
25
|
-
- JSX support for declaring Discord interaction components and modals 🎨
|
|
26
|
-
- Easy to use interaction components and modals system (forget about collectors) 🧩
|
|
27
|
-
- Less boilerplate code, more productivity 💪
|
|
28
|
-
- and much more...
|
|
23
|
+
### Automatic command and event handling
|
|
24
|
+
Drop your command files in a folder, export a function, and they just work. Slash commands, context menu commands, and prefix commands are all supported under a single unified command structure — no separate handler for each type. Commands are automatically registered and kept in sync with Discord. Events work the same way: create a file, export a listener, and CommandKit handles the rest.
|
|
29
25
|
|
|
30
|
-
|
|
26
|
+
### JSX components for Discord UI
|
|
27
|
+
discord.js builder chains (`ActionRowBuilder` → `ButtonBuilder` → `setCustomId` → ...) get messy fast. CommandKit lets you write Discord components in JSX — the same declarative syntax used in React — so your UI code is clean and readable.
|
|
28
|
+
|
|
29
|
+
### Built-in component handlers (no more collectors)
|
|
30
|
+
Buttons get `onClick`. Modals get `onSubmit`. Select menus get `onSelect`. Define a component and its behavior in one place — no `InteractionCollector` setup, no timeout management, no cleanup boilerplate.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
### Command middlewares
|
|
33
|
+
Run logic before or after any command executes — permission checks, cooldowns, logging, analytics — without touching the command itself. A proper middleware layer, like you'd find in Express.
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
### Unified prefix commands
|
|
36
|
+
Message-based (prefix) commands live in the same file as your slash commands and context menus. One command file handles all input types. No separate handler needed.
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
### Caching with Redis support
|
|
39
|
+
The `@commandkit/cache` plugin gives you a customizable caching layer — in-memory by default, Redis-backed when you need persistence. Just add the `'use cache'` directive to any function.
|
|
37
40
|
|
|
38
|
-
|
|
41
|
+
### Plugin system with custom events
|
|
42
|
+
Extend CommandKit through plugins that hook into the framework lifecycle. Plugins can emit custom events — for example, listening to an external webhook and firing events your bot can react to. This isn't a wrapper around `node:events`; it's a structured extension system for building modular, decoupled bot features. Official plugins include `@commandkit/i18n` for localization and `@commandkit/analytics` for usage tracking.
|
|
39
43
|
|
|
44
|
+
### AI-powered command execution
|
|
45
|
+
The `@commandkit/ai` plugin lets users interact with your bot through natural language. Instead of memorizing slash command names, users just talk to your bot — and the AI figures out which command to run. Built on the [AI SDK](https://ai-sdk.dev) with support for Google Gemini, OpenAI, and more. Includes built-in tools, custom tool support, lifecycle hooks, and per-user model selection.
|
|
46
|
+
|
|
47
|
+
### Zero-config TypeScript and JavaScript
|
|
48
|
+
Native TypeScript and JSX support with no configuration. No `tsconfig.json` fiddling, no separate build step, no bundler setup. The CLI handles compilation, bundling, hot-reloading, and project scaffolding.
|
|
49
|
+
|
|
50
|
+
## Who is this for?
|
|
51
|
+
|
|
52
|
+
- **Beginners** who don't want to spend hours building handlers before they can do anything useful
|
|
53
|
+
- **Experienced developers** tired of rebuilding the same boilerplate for every new bot project
|
|
54
|
+
- **Teams and freelancers** who need a reliable, structured foundation they can build on quickly
|
|
55
|
+
|
|
56
|
+
CommandKit has been used in production client projects and has saved hours of setup time on each one. It's not overhead — it's the setup work you'd do anyway, already done well.
|
|
57
|
+
|
|
58
|
+
## Getting Started
|
|
40
59
|
|
|
41
60
|
```bash
|
|
42
61
|
npm create commandkit
|
|
43
62
|
```
|
|
44
63
|
|
|
45
|
-
|
|
64
|
+
Follow the prompts, then run `commandkit dev` to start your bot. Check out the [documentation](https://commandkit.dev) for guides and API reference.
|
|
46
65
|
|
|
47
66
|
## Support and Suggestions
|
|
48
67
|
|
package/dist/cli/information.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('../chunk-kSYXY2_d.js');
|
|
2
2
|
const require_constants = require('../constants-CeIMhMD0.js');
|
|
3
|
-
const require_version = require('../version-
|
|
3
|
+
const require_version = require('../version-BQuDarCv.js');
|
|
4
4
|
let node_fs = require("node:fs");
|
|
5
5
|
node_fs = require_chunk.__toESM(node_fs);
|
|
6
6
|
let node_path = require("node:path");
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ const require_MessageCommandParser = require('./MessageCommandParser-VMFFGs0R.js
|
|
|
19
19
|
const require_CommandsRouter = require('./CommandsRouter-D5mGRFEr.js');
|
|
20
20
|
const require_EventsRouter = require('./EventsRouter-Be5NDOX4.js');
|
|
21
21
|
require('./router-CtcApqrw.js');
|
|
22
|
-
const require_version = require('./version-
|
|
22
|
+
const require_version = require('./version-BQuDarCv.js');
|
|
23
23
|
const require_file = require('./file-DqI3v90P.js');
|
|
24
24
|
const require_separator = require('./separator-DGwA_b1J.js');
|
|
25
25
|
const require_text_display = require('./text-display-BVuG7dT-.js');
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* The current version of CommandKit.
|
|
8
8
|
*/
|
|
9
|
-
const version = "1.2.0-dev.
|
|
9
|
+
const version = "1.2.0-dev.20260208122102";
|
|
10
10
|
|
|
11
11
|
//#endregion
|
|
12
12
|
Object.defineProperty(exports, 'version', {
|
|
@@ -15,4 +15,4 @@ Object.defineProperty(exports, 'version', {
|
|
|
15
15
|
return version;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
//# sourceMappingURL=version-
|
|
18
|
+
//# sourceMappingURL=version-BQuDarCv.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-
|
|
1
|
+
{"version":3,"file":"version-BQuDarCv.js","names":[],"sources":["../src/version.ts"],"sourcesContent":["/**\n * @private\n */\nfunction $version(): string {\n 'use macro';\n return require('../package.json').version;\n}\n\n/**\n * The current version of CommandKit.\n */\nexport const version: string = $version();\n"],"mappings":";;;;;;;;AAWA,MAAa,UAA4B"}
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "commandkit",
|
|
3
3
|
"description": "Beginner friendly command & event handler for Discord.js",
|
|
4
|
-
"version": "1.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.20260208122102",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
"tsx": "^4.19.2",
|
|
188
188
|
"typescript": "^5.9.3",
|
|
189
189
|
"vitest": "^3.0.5",
|
|
190
|
-
"tsconfig": "0.0.0-dev.
|
|
190
|
+
"tsconfig": "0.0.0-dev.20260208122102"
|
|
191
191
|
},
|
|
192
192
|
"engines": {
|
|
193
193
|
"node": ">=24"
|