Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
dist
.DS_Store
.vscode
.turbo
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"files.readonlyInclude": {
"**/routeTree.gen.ts": true
},
"files.watcherExclude": {
"**/routeTree.gen.ts": true
},
"search.exclude": {
"**/routeTree.gen.ts": true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,65 @@ The quickest way to setup a new CommandKit project is to use the
your terminal:

```sh npm2yarn
npm create commandkit@next
npm create commandkit@latest
```

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

## Available Examples

CommandKit comes with several pre-built examples to help you get started quickly. You can list all available examples using:

```sh npm2yarn
npm create commandkit@latest --list-examples
```

### Using Examples

You can create a project from any example using the `--example` flag:

```sh npm2yarn
# Create a basic TypeScript bot
npm create commandkit@latest --example basic-ts

# Create a basic JavaScript bot
npm create commandkit@latest --example basic-js

# Create a Deno TypeScript bot
npm create commandkit@latest --example deno-ts

# Create a bot without CLI integration
npm create commandkit@latest --example without-cli
```

### CLI Options

The CLI supports various options for customization:

```sh npm2yarn
# Skip prompts and use defaults
npm create commandkit@latest --yes

# Use a specific package manager
npm create commandkit@latest --use-pnpm
npm create commandkit@latest --use-yarn
npm create commandkit@latest --use-bun
npm create commandkit@latest --use-deno

# Skip dependency installation
npm create commandkit@latest --skip-install

# Skip git initialization
npm create commandkit@latest --no-git

# Create in a specific directory
npm create commandkit@latest my-bot

# Use a custom GitHub repository
npm create commandkit@latest --example "https://github.com/user/repo"
```

## Project structure

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

:::note

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.

:::

## Entry point

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

:::

## Getting Help

For more information about the CLI options, you can use the help flag:

```sh npm2yarn
npm create commandkit@latest --help
```

This will display all available options and usage examples.

## Manual setup

Alternatively, if you would like to setup a new CommandKit project
Expand Down
36 changes: 36 additions & 0 deletions examples/basic-js/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# dependencies
node_modules

# build output
build
out
dist

# commandkit
.commandkit
dist
compiled-commandkit.config.mjs

# env
**/*.env*
!**/*.env.example*

# logging
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# yarn v2+
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# other
**/*.DS_Store
.temp-example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Welcome to CommandKit
# Welcome to CommandKit + JavaScript

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

Expand Down
21 changes: 21 additions & 0 deletions examples/basic-js/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "commandkit-basic-js",
"description": "A CommandKit project using JavaScript",
"version": "0.1.0",
"type": "module",
"private": true,
"main": "dist/index.js",
"scripts": {
"dev": "commandkit dev",
"build": "commandkit build",
"start": "commandkit start"
},
"devDependencies": {
"@types/node": "^24.0.10",
"typescript": "^5.8.3"
},
"dependencies": {
"commandkit": "^1.2.0-rc.12",
"discord.js": "^14.23.2"
}
}
36 changes: 36 additions & 0 deletions examples/basic-ts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# dependencies
node_modules

# build output
build
out
dist

# commandkit
.commandkit
dist
compiled-commandkit.config.mjs

# env
**/*.env*
!**/*.env.example*

# logging
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# yarn v2+
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# other
**/*.DS_Store
.temp-example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Welcome to CommandKit
# Welcome to CommandKit + TypeScript

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

Expand Down
21 changes: 21 additions & 0 deletions examples/basic-ts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "commandkit-basic-ts",
"description": "A CommandKit project using TypeScript",
"version": "0.1.0",
"type": "module",
"private": true,
"main": "dist/index.js",
"scripts": {
"dev": "commandkit dev",
"build": "commandkit build",
"start": "commandkit start"
},
"devDependencies": {
"@types/node": "^24.0.10",
"typescript": "^5.8.3"
},
"dependencies": {
"commandkit": "^1.2.0-rc.12",
"discord.js": "^14.23.2"
}
}
36 changes: 36 additions & 0 deletions examples/deno-ts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

# dependencies
node_modules

# build output
build
out
dist

# commandkit
.commandkit
dist
compiled-commandkit.config.mjs

# env
**/*.env*
!**/*.env.example*

# logging
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# yarn v2+
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# other
**/*.DS_Store
3 changes: 3 additions & 0 deletions examples/deno-ts/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"deno.enable": true
}
36 changes: 36 additions & 0 deletions examples/deno-ts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Welcome to CommandKit + Deno

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

This project is a template for a CommandKit project using Deno.

## To run this project

### dependencies

```sh
deno install
```

### run the dev server

```sh
deno task dev
```

### build the project

```sh
deno task build
```

### run the project (production)

```sh
deno task start
```

## Useful links

- [Documentation](https://commandkit.dev)
- [Discord](https://ctrl.lol/discord)
1 change: 1 addition & 0 deletions examples/deno-ts/commandkit-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference path="node_modules/commandkit-types/index.d.ts" />
3 changes: 3 additions & 0 deletions examples/deno-ts/commandkit.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { defineConfig } from 'commandkit/config';

export default defineConfig({});
21 changes: 21 additions & 0 deletions examples/deno-ts/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "commandkit"
},
"nodeModulesDir": "auto",
"lock": true,
"lint": {
"include": ["src/"],
"exclude": ["node_modules/", "dist/", ".commandkit/"]
},
"fmt": {
"useTabs": false,
"lineWidth": 120,
"indentWidth": 2,
"semiColons": true,
"singleQuote": true,
"include": ["src/"],
"exclude": ["node_modules/", "dist/", ".commandkit/"]
}
}
21 changes: 21 additions & 0 deletions examples/deno-ts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "commandkit-deno",
"description": "A CommandKit project using Deno",
"version": "0.1.0",
"type": "module",
"private": true,
"main": "dist/index.js",
"scripts": {
"dev": "commandkit dev",
"build": "commandkit build",
"start": "commandkit start"
},
"devDependencies": {
"@types/node": "^24.0.10",
"typescript": "^5.8.3"
},
"dependencies": {
"commandkit": "^1.2.0-rc.12",
"discord.js": "^14.23.2"
}
}
7 changes: 7 additions & 0 deletions examples/deno-ts/src/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Client } from 'discord.js';

const client = new Client({
intents: ['Guilds', 'GuildMembers', 'GuildMessages', 'MessageContent'],
});

export default client;
Loading