The HazelJS CLI is about one thing: shipping. If you’re building APIs, realtime services, or AI features, you shouldn’t be hand-writing boilerplate or hunting for the “right” folder structure.
This release improves the generation workflow so it’s simpler, more consistent, and easier to automate in scripts and CI.
If you’re new here: start at HazelJS on hazeljs.ai, then jump into the docs at Docs.
What’s new
1) A skeleton app generator (like create-next-app)
You can now generate a minimal HazelJS application skeleton directly from the generator group:
hazel g app my-app
cd my-app
npm install
npm run dev
This creates a clean starting project using the CLI template (or a fallback minimal structure if the template isn’t available). It intentionally does not run installs or initialize git—so it’s fast and predictable.
If you want the full interactive setup (package selection, installs, git init), hazel new is still there:
hazel new my-app -i
Docs: CLI package • Modules guide
2) “Setup” generator for every HazelJS package
HazelJS has many packages by design—core, auth, cache, workflow, data, AI, agent, RAG, messaging, and more. But adding a new capability shouldn’t start with “go read five docs and stitch code together”.
Use setup to generate a minimal starter file for any package:
# shorthand: st
hazel g setup swagger
hazel g setup kafka
hazel g setup oauth
hazel g setup @hazeljs/guardrails
This creates a small *.setup.ts file with a ready-to-edit snippet and prints the next step (npm install @hazeljs/<package>).
Related: Controllers guide • Providers guide
3) Discovery: list all generators
To see everything the CLI can generate:
hazel g --list
If you want a machine-readable list (for scripts):
hazel g --list --list-json
4) Consistent output + --dry-run + --json
All generators support:
-
--dry-runto preview created paths without writing files -
--jsonto print a single JSON object withok,created(paths), and optionalnextSteps
Examples:
hazel g crud user --dry-run
hazel g controller users --json
hazel g setup swagger --json
Example output (with --json):
{"ok":true,"created":["/path/to/project/src/users.controller.ts"]}
In --dry-run --json mode you get the same shape; created lists what would be written.
Why this matters
Modern backends aren’t “just controllers.” You ship authentication, caching, background jobs, workflows, observability, and—more and more—AI primitives like agents and retrieval. The CLI’s job is to remove friction so you can:
- start a project instantly,
- add a new capability safely,
- generate consistent code across a team,
- and automate the workflow in CI.
If you try these generators and feel anything is missing, open an issue—we’re optimizing for real-world DX.
Links
- HazelJS — Website
- Documentation — HazelJS docs
- Cli package docs — @hazeljs/cli guide
Top comments (0)