nestrs-cli-rs 0.1.0

Rust port of the Nest CLI for the nestrs organization.
Documentation
# Upstream command inventory

Reference: `nest-cli/commands`.

## Loader and common input shape

- `CommandLoader` registers commands in this order: `new`, `build`, `start`, `info`, `add`, `generate`.
- Invalid commands print `ERROR_PREFIX Invalid command: <args>`, suggest `--help`, and exit with status 1.
- Command handlers map parsed commander values into `Input { name, value, options? }` records and pass them to actions.
- `start` and `add` call `allowUnknownOption()` and forward unknown trailing flags through `getRemainingFlags(program)`.
- `new`, `generate`, and `info` call `exitIfExtraArgs` to reject unexpected positional arguments.

## `nest new [name]`

Alias: `n`.

Description: `Generate Nest application.`

Flags:

- `--directory [directory]`: destination directory.
- `-d, --dry-run`: report actions without writing results. Default `false`.
- `-g, --skip-git`: skip git initialization. Default `false`.
- `-s, --skip-install`: skip package installation. Default `false`.
- `-p, --package-manager [packageManager]`: package manager.
- `-l, --language [language]`: `TypeScript` default; accepted values are `js`, `ts`, `javascript`, `typescript`; long names normalize to `js` or `ts`.
- `-c, --collection [collectionName]`: schematics collection. Default `@nestjs/schematics`.
- `--strict`: enable TypeScript strict mode. Default `false`.

Behavior notes:

- Invalid language throws `Invalid language "<value>" selected. Available languages are "typescript" or "javascript"`.
- Inputs: `name`.
- Options forwarded: `directory`, `dry-run`, `skip-git`, `skip-install`, `strict`, `packageManager`, `collection`, `language`.

## `nest build [apps...]`

Description: `Build Nest application.`

Flags:

- `-c, --config [path]`: nest-cli configuration path.
- `-p, --path [path]`: tsconfig path.
- `-w, --watch`: live reload watch mode.
- `-b, --builder [name]`: one of `tsc`, `webpack`, `swc`.
- `--watchAssets`: watch non-TS assets.
- `--webpack`: deprecated webpack builder switch; ignored when `--tsc` is present.
- `--type-check`: enable SWC type checking.
- `--webpackPath [path]`: webpack configuration path.
- `--tsc`: force TypeScript compiler and disable `--webpack`.
- `--preserveWatchOutput`: only forwarded as `true` when `--watch` is set and webpack is not enabled.
- `--all`: build every configured project in a monorepo.

Behavior notes:

- Invalid builders print `ERROR_PREFIX Invalid builder option: <name>. Available builders: tsc, webpack, swc` and return without running the action.
- With no app arguments, the command forwards one `app` input with `undefined` so the action can select the default project.
- Multiple app arguments become repeated `app` inputs.

## `nest start [app]`

Description: `Run Nest application.`

Flags:

- `-c, --config [path]`: nest-cli configuration path.
- `-p, --path [path]`: tsconfig path.
- `-w, --watch`: live reload watch mode.
- `-b, --builder [name]`: one of `tsc`, `webpack`, `swc`.
- `--watchAssets`: watch non-TS assets.
- `-d, --debug [hostport]`: enable Node inspector; optional host/port value maps to `--inspect=<hostport>`.
- `--webpack`: deprecated webpack builder switch; ignored when `--tsc` is present.
- `--webpackPath [path]`: webpack configuration path.
- `--type-check`: enable SWC type checking.
- `--tsc`: force TypeScript compiler and disable `--webpack`.
- `--sourceRoot [sourceRoot]`: override source root.
- `--entryFile [entryFile]`: override entry file.
- `-e, --exec [binary]`: binary to run; default comes from configuration (`node`).
- `--preserveWatchOutput`: only forwarded as `true` when `--watch` is set and webpack is not enabled.
- `--shell`: spawn child processes in a shell. Default `true`.
- `--no-shell`: spawn without shell.
- `--env-file [path]`: repeatable; each value becomes a Node `--env-file=<path>` argument.

Behavior notes:

- Unknown options are allowed and forwarded after `--` to the child app process.
- Invalid builder handling matches `build`.
- Inputs: optional `app`.
- Options forwarded include `debug`, `exec`, `sourceRoot`, `entryFile`, `shell`, `envFile`, and all build-related options.

## `nest generate <schematic> [name] [path]`

Alias: `g`.

Description is generated dynamically from the selected collection and includes a schematics table.

Flags:

- `-d, --dry-run`: report actions without writing results.
- `-p, --project [project]`: target project.
- `--flat`: force flat structure.
- `--no-flat`: force directory generation.
- `--spec`: force spec file generation. Default `true`; records that the option was explicitly provided.
- `--spec-file-suffix [suffix]`: custom spec suffix.
- `--skip-import`: skip importing. Default `false`.
- `--no-spec`: disable spec file generation; records that the option was explicitly provided.
- `-c, --collection [collectionName]`: schematics collection.
- `--type <type>`: resource transport type, documented as `rest`, `graphql`, or `microservice`.
- `--crud [value]`: generate CRUD entry points. Accepted truthy values are boolean `true` or string `"true"`.

Behavior notes:

- Rejects more than three positional args.
- Inputs: `schematic`, `name`, `path`.
- `spec` carries an `options.passedAsInput` marker so configuration defaults can distinguish implicit and explicit values.

## `nest add <library>`

Description: `Adds support for an external library to your project.`

Usage: `<library> [options] [library-specific-options]`.

Flags:

- `-d, --dry-run`: report actions without writing results.
- `-s, --skip-install`: skip package installation. Default `false`.
- `-p, --project [project]`: target project.

Behavior notes:

- Unknown options are allowed and passed to the schematic runner as library-specific options.
- Inputs: `library`.
- Options forwarded: `dry-run`, `skip-install`, `project`.
- The command catches action errors and exits with status 1.

## `nest info`

Alias: `i`.

Description: `Display Nest project details.`

Behavior notes:

- No flags.
- Rejects any extra arguments.
- Calls `InfoAction.handle()` with no inputs or options.