npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

create-disbord-app

v2.3.9

Published

disbordのbot雛形を生成するCLI(create-disbord-app <name>)

Readme

create-disbord-app

disbordを使ったDiscord bot雛形を生成するCLI。disbordのセットアップ役という位置づけで、生成後のCLI操作(disbord dev等)や設定ファイルの詳細はdisbordのREADMEを参照してください。

使い方

bunx create-disbord-app <name> [--db] [--core-class[=ClassName]]
  • <name>: 生成したいbot名(new-botのようなサブコマンドは無く、そのまま位置引数として渡す)
  • --db: DBを有効化する(未指定の場合は対話で「DBは使用しますか?」と聞かれる)
  • --core-class: 制御クラス(Core)を有効化する(未指定の場合は対話で「制御クラス(Core)は使用しますか?」と聞かれる)
    • 名前まで指定したい場合は--core-class=ClassNameとする。この場合クラス名の質問もスキップされる
    • --core-classのみ(値なし)で指定した場合、有効化の質問はスキップされるがクラス名は続けて対話で聞かれる(無記入ならCoreになる)
# 対話フローに任せる
bunx create-disbord-app my-bot

# DBだけフラグで確定、Coreは対話に任せる
bunx create-disbord-app my-bot --db

# 両方フラグで確定し、Coreクラス名も指定
bunx create-disbord-app my-bot --db --core-class=GameCore

実行すると、生成先ディレクトリでgit initbun installまで自動的に行われます。既存ディレクトリと同名の場合はエラーになり、上書きはされません。

生成されるファイル構成

my-bot/
├── disbord.config.ts        # bot個別設定(db/coreClass有効時はここにブロックが追加される)
├── package.json              # scripts(dev/build/fmt/lint/env等)・依存一式
├── tsconfig.json              # @/* → src/* エイリアス(v7仕様。baseUrlは含まない)
├── .oxfmtrc.json / oxlint.config.ts  # oxfmt/oxlint設定(disbord/lintをextends)
├── mise.toml                  # bunのバージョン固定
├── lefthook.yml                # pre-commitでlint→fmt→env暗号化(--all)を実行
├── .gitignore
├── env/
│   ├── .env.development       # TOKEN= / CLIENT_ID= / GUILD_ID=(平文プレースホルダー)
│   └── .env.production        # TOKEN= / CLIENT_ID=(db有効時はTURSO_DATABASE_URL=/TURSO_AUTH_TOKEN=も追加)
├── src/
│   ├── events/ready.ts         # 唯一デフォルトで生成されるイベントハンドラ
│   ├── components/
│   │   └── slashCommands.ts    # buttonとselectMenuにも対応しているがoptional
│   ├── Core.ts                 # --core-class有効時のみ生成(制御クラス本体)
│   └── db/                     # --db有効時のみ生成(モデルは disbord generate model で追加)
└── .disbord/
    └── disbord.d.ts             # module augmentation用の生成物(git管理しない)

生成後の開発フロー

cd my-bot
bun run dev

bun run devdisbord dev)が起動時にslashCommandのREST登録と(DB有効時は)migrationを自動で行うため、通常はこれだけで開発を始められます。以下は追加で必要になった場合のみ使います。

  • bun run commands / bun run commands:delete: dev実行中にslashCommandを追加・変更した場合の再登録・削除(devの自動pushは起動時のみのため)
  • bun run gen:event <name>: src/events/にイベントハンドラを追加生成
  • bun run gen:model <Name>(DB有効時): src/db/models/にモデルクラスを追加生成
  • bun run migrate / bun run studio(DB有効時): migrationの手動適用・drizzle studioの起動
  • bun run enable <db|core-class> / bun run disable <db|core-class>: 後からDB・Coreを有効化・無効化
  • bun run env / bun run encrypt / bun run decrypt: env/配下の暗号化状態の切り替え

本番運用はbun run builddisbord build)で生成したdist/main.jsbunで直接実行するだけで、disbord startのようなコマンドはありません。dist以下には.envが生成されるのでbun dist/main.jsではなくcd dist && bun main.jsのほうがいいと思います。