@hed-hog/cli
v0.0.143
Published
HedHog CLI tool
Downloads
4,486
Readme
@hed-hog/cli
The command-line tool for scaffolding and managing HedHog projects.
Learn more about the HedHog framework at new.hedhog.com — the official site for the framework this CLI scaffolds and manages.
What is HedHog CLI
@hed-hog/cli (binary hedhog) scaffolds and manages HedHog projects: TurboRepo monorepos with a NestJS API (apps/api) and a NextJS admin panel (apps/admin). Functionality is added through versioned @hed-hog/* libraries — each one bundles its own database schema, seed data, and admin frontend pages — that the CLI installs, updates, and keeps in sync with your project.
Built with NestJS 11 + nest-commander, TypeScript, pnpm, Prisma ORM, and EJS templates.
Installation
Prerequisites: Node.js 18+, npm 9+, pnpm (required by several CLI flows), and Docker + Docker Compose (used by hedhog new's default database setup).
npm i -g @hed-hog/cliVerify the install:
hedhog --version
hedhog --helpQuick start
# scaffold a new project
hedhog new my-project
cd my-project
# add a library/module to the project
hedhog add menu
# update installed libraries
hedhog update
# check hedhog.json consistency
hedhog dev doctorCommand reference
Top-level commands
| Command | Description |
| --- | --- |
| hedhog new | Scaffold a new HedHog project (TurboRepo + NestJS + NextJS) |
| hedhog add <lib> | Add a @hed-hog/* library to a project |
| hedhog update [libs...] | Update installed @hed-hog/* libraries |
| hedhog dev <subcommand> | Development and maintenance operations (alias: d) |
hedhog dev subcommands
| Subcommand | Alias | What it does |
| --- | --- | --- |
| apply | a | Re-applies all installed libraries in dependency order ⚠️ destructive |
| assets-to-library | atl | Copies admin frontend assets back into a library |
| backupdb | bdb | Backs up the development database |
| create-library | cl | Scaffolds a new local library |
| deploy-config | dc | Manages deploy configuration and secrets |
| doctor | doc | Checks hedhog.json consistency against installed libraries |
| hash-directory | hd | Hashes a directory for change validation |
| initdb | idb | Initializes the development database |
| install-all | ia | Resets the environment and installs all available @hed-hog packages ⚠️ destructive |
| library-version | lv | Shows installed library versions |
| list-packages | lp | Lists available @hed-hog packages |
| reset | rs | Resets the development environment ⚠️ destructive |
| restoredb | rdb | Restores a database backup |
| route | r | Helps with the route/migration workflow during library development |
| sync-publish | sp | Syncs assets and publishes library versions |
| tsconfig | tsc | Updates TypeScript configs across the workspace |
| update-bootstrap | ub | Updates bootstrap and auxiliary config files |
Before running any ⚠️ destructive command, take a backup with hedhog dev backupdb.
See docs/03-referencia-de-comandos.md for full flags and usage details.
Documentation
- docs/README.md — documentation index
- docs/01-instalacao.md — installation
- docs/02-primeiros-passos.md — getting started
- docs/03-referencia-de-comandos.md — full command reference
- docs/04-troubleshooting.md — troubleshooting
Contributing / local development
To work on the CLI itself:
pnpm install
# build to dist/
pnpm build
# run from source, no build needed
ts-node src/main <command>
# rebuild and watch on change
pnpm start:devOther useful scripts:
pnpm test # unit tests
pnpm lint # eslint --fix
pnpm format # prettier --writeResources
- Framework site — new.hedhog.com
- Source code — github.com/hed-hog/cli
- Package — npmjs.com/package/@hed-hog/cli
License
MIT
