Skip to content

Commit 50a6205

Browse files
committed
docs: document new cli
1 parent c7be7f8 commit 50a6205

File tree

4 files changed

+75
-8
lines changed

4 files changed

+75
-8
lines changed

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

packages/create-commandkit/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ npx create-commandkit@latest --example "https://github.com/user/repo" --example-
7777
### Examples
7878

7979
```sh
80-
# Create a bot with database example, skip installation
81-
npx create-commandkit@latest --example with-database --skip-install
80+
# Create a basic TypeScript bot, skip installation
81+
npx create-commandkit@latest --example basic-ts --skip-install
8282

8383
# Create a bot with all defaults (no prompts)
8484
npx create-commandkit@latest --yes

packages/create-commandkit/src/functions/fetchExample.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export async function fetchExample({
7979
error.message.includes('404')
8080
) {
8181
throw new Error(
82-
`Example '${example}' not found. Available examples: basic-ts, basic-js, with-database, with-i18n`,
82+
`Example '${example}' not found. Available examples: basic-ts, basic-js, deno-ts, without-cli`,
8383
);
8484
}
8585
throw new Error(`Failed to fetch example: ${error.message}`);

packages/create-commandkit/src/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Options:
4949
Examples:
5050
npx create-commandkit@latest
5151
npx create-commandkit@latest my-bot
52-
npx create-commandkit@latest --example with-database
52+
npx create-commandkit@latest --example basic-ts
5353
npx create-commandkit@latest --example "https://github.com/user/repo" --example-path "examples/bot"
5454
npx create-commandkit@latest --use-pnpm --yes
5555
npx create-commandkit@latest --list-examples
@@ -83,9 +83,7 @@ Examples:
8383
),
8484
);
8585
console.log(
86-
colors.gray(
87-
'Example: npx create-commandkit@latest --example with-database',
88-
),
86+
colors.gray('Example: npx create-commandkit@latest --example basic-ts'),
8987
);
9088
} catch (error) {
9189
console.error(

0 commit comments

Comments
 (0)