try-nest
v1.0.0
Published
A CLI tool to access NestJS samples easily.
Readme
try-nest
A CLI tool that helps you easily get up and running with NestJS sample that are available in the nestjs/nest at sample folder.
Usage
Just run the following in your terminal:
npx try-nest
## alternatively:
npx try-nestjsor, if you want to make sure that you're using the latest version available:
npx try-nest@latestThis will walk you through picking a sample, naming a directory, and optionally installing dependencies.
Options
Every prompt has a flag, so the whole thing is scriptable:
| Flag | Meaning |
|---|---|
| -s, --sample <id> | Sample to scaffold, e.g. 01-cats-app |
| -d, --dir <path> | Directory to create |
| -p, --package-manager <pm> | npm, pnpm, yarn or bun |
| --install / --no-install | Install dependencies, or skip |
| -y, --yes | Accept defaults instead of prompting |
| --list | Print the available samples and exit |
| --json | Machine-readable output for --list |
| -h, --help | Show help |
| -v, --version | Show the version |
With no interactive terminal — in CI, or through a pipe — there is nobody to
answer a prompt, so every answer has to arrive as a flag: --sample, --dir
and an install decision. Pass --yes to accept the defaults for all of them
instead. A missing answer exits 2 naming the flag, rather than waiting on a
question nobody can see.
Exit codes
0success,2bad input,130a run you ended yourself at a prompt (press Esc or Ctrl+C at any prompt to do so),1something in the world was broken.
A failed dependency install is a warning, not a failure — the project is already on disk and intact.
Samples are read from nestjs/nest repository at run time, so there is no pinned list and no compatibility guarantee between versions — always use @latest.
