create-shardwire
v1.0.8
Published
Interactive scaffold for Shardwire Discord bot + app projects.
Maintainers
Readme
create-shardwire
Interactive scaffold for a Discord bot plus Shardwire app layout—so you skip copying folders by hand.
npm · Docs — getting started · Scaffold changelog
npm create shardwire@latestThe Problem
Starting a split-process Discord project means repeating the same decisions: TypeScript vs JavaScript, Vite vs plain Node, where slash-command registration lives, and how .env is wired for both bot and app.
create-shardwire encodes those decisions as maintained templates so you get a running baseline and can focus on product code. If you have used npm create vite or create-next-app, the flow is the same idea with different defaults.
See It Work
$ npm create shardwire@latest
# follow prompts: project name, template (Express Server / React App), options
$ cd your-project
$ npm install
$ cp .env.example .env
# edit .env — Discord token, SHARDWIRE_SECRET, optional application/guild ids, SHARDWIRE_URL
$ npm run register
$ npm run bot # one terminal
$ npm run app # or npm run dev for Vite — second terminalInstall
The CLI writes a new directory of source and config under the path you pick; it does not change global npm settings or files outside that folder. Dependency downloads are normal npm traffic. It does not mint Discord tokens—you add secrets to .env after scaffolding. Undo by deleting the folder; npm uninstall -g create-shardwire only applies if you installed the bin globally (most people use npm create without that).
The supported entry is npm create, which downloads this package on demand:
npm create shardwire@latestRequires Node.js 22+.
Published bin name: create-shardwire (invoked indirectly through npm create shardwire).
To hack on the CLI inside the monorepo:
cd packages/create-shardwire
npm install
npm run build
node dist/cli.jsTemplates live under templates/ and are copied (with substitutions) during project generation.
Getting Started
- Run
npm create shardwire@latest. - Open the generated
README.mdin your new project for template-specific scripts. - Continue from the main Getting started guide for Discord configuration and deployment notes.
How It Works
The CLI asks a short set of questions, renders a template into a target directory, and writes a package.json wired to published shardwire / @shardwire/react versions (or workspace equivalents when you develop inside the Shardwire monorepo).
| Template | When to pick it |
| ------------------ | --------------------------------------------------------------------- |
| Express Server | Node bot + Express (GET /health) + bridge client in one app process |
| React App | Vite + React UI (@shardwire/react) talking to the bridge |
If a template name changes, trust the interactive prompt list over this table.
FAQ
Does this deploy my bot? No. It only creates files. Hosting, systemd, Docker, or PaaS setup remains yours—see Keeping it alive.
Can I update an existing repo with this? The tool targets new directories; migrate manually or generate elsewhere and copy pieces.
Contributing
Monorepo path: packages/create-shardwire. Run npm run verify before publishing or submitting substantial CLI changes.
License
MIT.
