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

@nestjs-dash/cli

v1.0.6

Published

CLI generators for NestJS Dash

Downloads

1,365

Readme

@nestjs-dash/cli

CLI scaffolding for NestJS Dash — a thin wrapper that runs @nestjs-dash/schematics against your NestJS project via @angular-devkit/schematics.

Install

pnpm add -D @nestjs-dash/cli
# or
npm install -D @nestjs-dash/cli
# or
bun add -d @nestjs-dash/cli

Installs the nestjs-dash binary. Run it through your package manager:

pnpm exec nestjs-dash generate resource Bid   # pnpm
npx nestjs-dash generate resource Bid         # npm
bunx nestjs-dash generate resource Bid        # bun

Or one-off without installing: npx @nestjs-dash/cli generate resource Bid (or pnpm dlx @nestjs-dash/cli ...).

Usage

Run from anywhere inside a NestJS project. The CLI walks up from the current directory to the nearest package.json that lists @nestjs/core in dependencies or devDependencies, and treats that folder as the project root. Path flags (--dir, --resource, --panel) are resolved relative to the current directory (absolute paths are accepted) and must point inside the project root — paths that escape it are rejected.

nestjs-dash --version
nestjs-dash --help
nestjs-dash generate --help
nestjs-dash generate resource --help

generate has the alias g, so nestjs-dash g res Bid is the same as nestjs-dash generate resource Bid.

Common flags

| Flag | Commands | Meaning | | --- | --- | --- | | --dry-run | all | Print the files that would be written; write nothing. | | --verbose | all | Print detailed diagnostics (each created/updated path, fuzzy-match reasoning, codemod results). | | --force | resource, panel, relation-manager only | Overwrite existing generated files. On an interactive terminal you are asked to confirm first; in a non-interactive session (CI) --force proceeds without asking. |

Without --force, generated files that already exist are skipped with a Skipped (already exists): <path> warning. If the schematics engine itself hits a file conflict, it prints ERROR! <path> already exists. (or does not exist.) and nothing is written.

Prompts and non-interactive sessions

The <Name> argument and each command's required option (--dir, --resource, --panel) must be given on the command line — they are never prompted for. On an interactive terminal the CLI may ask:

  • resource: whether to also scaffold a custom page (when --page is not passed);
  • resource: which entity file is the model, when the target folder has several *.entity.ts files;
  • resource: to confirm a fuzzy-matched existing module folder (when --dir is not passed);
  • --force: to confirm overwriting existing files.

In a non-interactive session (CI, piped output) these questions are skipped: optional values fall back to their defaults, a fuzzy-matched folder is used as-is, and the multiple-entity-files case fails with an error listing the candidates.

Exit codes

0 on success; 1 when the project root can't be found, an argument/option is invalid, the schematic fails, or a confirmation prompt is declined.

Commands

generate resource <Name> (alias res)

Scaffold an entity + Resource (and optionally a custom page) into a module folder, wiring it into <folder>.module.ts and, for a new module, the root app module. Without --dir, an existing *.module.ts whose name matches <Name> is reused (you are asked to confirm on a terminal); otherwise src/<kebab-name>s/ is used. If the target folder already has an *.entity.ts, it is reused as the model and its columns drive the table/form declarations.

| Flag | Default | Meaning | | --- | --- | --- | | --dir <path> | auto-detected | Target directory, relative to the current directory. | | --page | false | Also scaffold a custom <Name>Page. | | --no-entity | entity generated | Skip entity generation and reuse an existing <name>.entity.ts. | | --force / --dry-run / --verbose | | See Common flags. |

nestjs-dash generate resource Bid --dir src/ads
nestjs-dash g res Bid --dir src/ads --page
nestjs-dash generate resource Bid --dir src/ads --no-entity
nestjs-dash generate resource Bid --dry-run

generate panel <Name>

Scaffold a standalone Panel + AdminModule.forRoot() file (<name>.panel.ts).

| Flag | Default | Meaning | | --- | --- | --- | | --force | false | Overwrite an existing <name>.panel.ts. | | --dry-run / --verbose | | See Common flags. |

nestjs-dash generate panel Admin

generate relation-manager <Name> (alias rm)

Scaffold a RelationManager subclass under <dir>/relation-managers/, optionally wiring it into an existing Resource file's relationManagers array.

| Flag | Default | Meaning | | --- | --- | --- | | --dir <path> | required | Target directory (a relation-managers/ subfolder is added). | | --related-resource <slug> | dasherized name | Slug of the related resource. | | --type <type> | has-many | has-many or belongs-to-many. | | --foreign-key <key> | | Foreign key column on the related entity (has-many only). | | --title <text> | humanized name | Tab/section title. | | --resource <path> | | Existing Resource file to wire the generated class into. | | --force / --dry-run / --verbose | | See Common flags. |

nestjs-dash generate relation-manager Comments --dir src/ads \
  --resource src/ads/resources/bid.resource.ts
nestjs-dash g rm Tags --dir src/ads --type belongs-to-many --title "Tags"

generate filter <Name> (alias fi)

Wire a TextFilter / SelectFilter / DateFilter on column <Name> into an existing resource's table(). Edits the file in place; writes no new files.

| Flag | Default | Meaning | | --- | --- | --- | | --resource <path> | required | Resource (or RelationManager) file to wire into. | | --kind <kind> | text | text, select or date. | | --label <text> | humanized column name | Filter label. | | --options <list> | | --kind select only: comma-separated value:Label pairs, e.g. "active:Active,banned:Banned". | | --operators <list> | builder default | Comma-separated FilterOperator list, e.g. "$eq,$ilike". | | --dry-run / --verbose | | See Common flags. |

nestjs-dash generate filter status --resource src/ads/resources/bid.resource.ts \
  --kind select --options "open:Open,closed:Closed"

generate action <Name> (alias ac)

Wire a custom Action.make(...).handler(...) into an existing resource's table(). Edits the file in place; writes no new files.

| Flag | Default | Meaning | | --- | --- | --- | | --resource <path> | required | Resource (or RelationManager) file to wire into. | | --variant <variant> | record | record (row action), bulk or toolbar. | | --icon <name> | | Lucide icon name, e.g. star. | | --label <text> | humanized action name | Button label. | | --dry-run / --verbose | | See Common flags. |

nestjs-dash generate action publish --resource src/ads/resources/bid.resource.ts --icon star
nestjs-dash g ac archive --resource src/ads/resources/bid.resource.ts --variant bulk

generate widget <Name> (alias wi)

Wire a DashboardWidget (a StatCard, or a bar/line/pie chart) titled <Name> into an existing Panel's widgets(). Edits the file in place; writes no new files.

| Flag | Default | Meaning | | --- | --- | --- | | --panel <path> | required | Panel factory file (as scaffolded by generate panel) to wire into. | | --kind <kind> | stat | stat, bar, line or pie. | | --side | false | Render in the narrow side column instead of the main column. | | --dry-run / --verbose | | See Common flags. |

nestjs-dash generate widget "Total Bids" --panel src/admin/admin.panel.ts
nestjs-dash generate widget "Bids by status" --panel src/admin/admin.panel.ts --kind bar --side

Docs: CLI.

License

MIT