create-brass
v1.2.1
Published
CLI to scaffold **Brass runtime** apps with beginner-friendly, visual onboarding demos (scopes, cancellation, concurrency).
Readme
create-brass
CLI to scaffold Brass runtime apps with beginner-friendly, visual onboarding demos (scopes, cancellation, concurrency).
Quick start
Generate a new project:
npm create brass@latest my-appOr choose a template explicitly:
npm create brass@latest my-app -- --template=vite-react-ts
npm create brass@latest my-app -- --template=vite-vanilla-tsThen:
cd my-app
npm install
npm run devNote:
npm createpasses flags after--to the CLI.
Templates
vite-react-ts— Vite + React + TypeScript, scope-boxes visual demovite-vanilla-ts— Vite + Vanilla TypeScript, scope-boxes visual demo
The generated project depends on:
brass-runtime- (optionally)
brass-runtime/httporbrass-httpdepending on your setup
What you get
The templates ship with:
- a visual “Scope boxes” demo (scopes as containers, tasks inside, cancellation + cleanup)
- progressive explanations/events while the demo runs
- Soft cancel (stops the demo + moves running tasks to “Stopped”)
- Hard cancel (shows “Cleanup” first, then “Stopped”)
Developing this CLI locally
Build the CLI:
npm install
npm run buildRun it directly:
node dist/index.js my-app --template=vite-react-tsThe CLI only copies files from
templates/. It does not require Vite/React installed globally.
Project structure
.
├─ src/ # CLI source
├─ dist/ # compiled output (after build)
└─ templates/
├─ vite-react-ts/
└─ vite-vanilla-ts/Adding a new template
- Create a new folder under
templates/:templates/vite-svelte-ts(example)
- Ensure it is a valid Vite project (package.json, vite.config.ts, index.html, src/)
- Add it to the template list in the CLI
- Test locally:
node dist/index.js test-app --template=vite-svelte-ts cd test-app && npm install && npm run build
Vite equivalents (reference)
Vite React + TypeScript
npm create vite@latest my-app --template=vite-react-ts
cd my-app
npm install
npm run devVite Vanilla + TypeScript
npm create vite@latest my-app --template=vite-vanilla-ts
cd my-app
npm install
npm run dev
License
MIT
