Skip to content

Commit 518b619

Browse files
authored
Merge pull request #582 from underctrl-io/dynamic-create-commandkit
feat: dynamic create-commandkit cli
2 parents 562ef1a + 63c9276 commit 518b619

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1559
-710
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
node_modules
22
dist
33
.DS_Store
4-
.vscode
54
.turbo

.vscode/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"files.readonlyInclude": {
3+
"**/routeTree.gen.ts": true
4+
},
5+
"files.watcherExclude": {
6+
"**/routeTree.gen.ts": true
7+
},
8+
"search.exclude": {
9+
"**/routeTree.gen.ts": true
10+
}
11+
}

apps/website/docs/guide/01-getting-started/02-setup-commandkit.mdx

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,65 @@ The quickest way to setup a new CommandKit project is to use the
2121
your terminal:
2222

2323
```sh npm2yarn
24-
npm create commandkit@next
24+
npm create commandkit@latest
2525
```
2626

2727
This will start the CLI in an interactive mode. You can follow the
2828
prompts to setup your project.
2929

30+
## Available Examples
31+
32+
CommandKit comes with several pre-built examples to help you get started quickly. You can list all available examples using:
33+
34+
```sh npm2yarn
35+
npm create commandkit@latest --list-examples
36+
```
37+
38+
### Using Examples
39+
40+
You can create a project from any example using the `--example` flag:
41+
42+
```sh npm2yarn
43+
# Create a basic TypeScript bot
44+
npm create commandkit@latest --example basic-ts
45+
46+
# Create a basic JavaScript bot
47+
npm create commandkit@latest --example basic-js
48+
49+
# Create a Deno TypeScript bot
50+
npm create commandkit@latest --example deno-ts
51+
52+
# Create a bot without CLI integration
53+
npm create commandkit@latest --example without-cli
54+
```
55+
56+
### CLI Options
57+
58+
The CLI supports various options for customization:
59+
60+
```sh npm2yarn
61+
# Skip prompts and use defaults
62+
npm create commandkit@latest --yes
63+
64+
# Use a specific package manager
65+
npm create commandkit@latest --use-pnpm
66+
npm create commandkit@latest --use-yarn
67+
npm create commandkit@latest --use-bun
68+
npm create commandkit@latest --use-deno
69+
70+
# Skip dependency installation
71+
npm create commandkit@latest --skip-install
72+
73+
# Skip git initialization
74+
npm create commandkit@latest --no-git
75+
76+
# Create in a specific directory
77+
npm create commandkit@latest my-bot
78+
79+
# Use a custom GitHub repository
80+
npm create commandkit@latest --example "https://github.com/user/repo"
81+
```
82+
3083
## Project structure
3184

3285
By using the CLI to create a base project, you should get a file tree
@@ -49,6 +102,12 @@ that looks something like this:
49102
└── tsconfig.json
50103
```
51104

105+
:::note
106+
107+
The exact project structure may vary depending on the example you choose. Each example comes with its own configuration and dependencies tailored to its specific use case.
108+
109+
:::
110+
52111
## Entry point
53112

54113
The `src/app.ts` file is the main entry point for your application.
@@ -107,6 +166,16 @@ The development version is likely to have bugs.
107166

108167
:::
109168

169+
## Getting Help
170+
171+
For more information about the CLI options, you can use the help flag:
172+
173+
```sh npm2yarn
174+
npm create commandkit@latest --help
175+
```
176+
177+
This will display all available options and usage examples.
178+
110179
## Manual setup
111180

112181
Alternatively, if you would like to setup a new CommandKit project

examples/basic-js/.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# dependencies
2+
node_modules
3+
4+
# build output
5+
build
6+
out
7+
dist
8+
9+
# commandkit
10+
.commandkit
11+
dist
12+
compiled-commandkit.config.mjs
13+
14+
# env
15+
**/*.env*
16+
!**/*.env.example*
17+
18+
# logging
19+
logs
20+
*.log
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
lerna-debug.log*
25+
.pnpm-debug.log*
26+
27+
# yarn v2+
28+
.yarn/cache
29+
.yarn/unplugged
30+
.yarn/build-state.yml
31+
.yarn/install-state.gz
32+
.pnp.*
33+
34+
# other
35+
**/*.DS_Store
36+
.temp-example

packages/create-commandkit/templates/TypeScript/README.md renamed to examples/basic-js/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Welcome to CommandKit
1+
# Welcome to CommandKit + JavaScript
22

33
> This project was generated by [create-commandkit](https://npmjs.com/package/create-commandkit).
44

examples/basic-js/package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "commandkit-basic-js",
3+
"description": "A CommandKit project using JavaScript",
4+
"version": "0.1.0",
5+
"type": "module",
6+
"private": true,
7+
"main": "dist/index.js",
8+
"scripts": {
9+
"dev": "commandkit dev",
10+
"build": "commandkit build",
11+
"start": "commandkit start"
12+
},
13+
"devDependencies": {
14+
"@types/node": "^24.0.10",
15+
"typescript": "^5.8.3"
16+
},
17+
"dependencies": {
18+
"commandkit": "^1.2.0-rc.12",
19+
"discord.js": "^14.23.2"
20+
}
21+
}

0 commit comments

Comments
 (0)