cli
Rust port of @nestjs/cli for the nestrs organization.
The upstream reference is the cloned Nest CLI project at ../nest-cli. This crate keeps names and module boundaries close to upstream so each Rust item can be traced back to the TypeScript source with minimal guesswork.
Current Status
- Command and action descriptors are modeled.
- Configuration defaults and merge behavior are modeled.
- Package manager detection and command generation are modeled.
- Runner command descriptions are modeled.
- Schematics option formatting and built-in Nest collection metadata are modeled as a typed boundary placeholder for the separate
schematicspackage. - Compiler planning contracts are in progress.
The crate is not a drop-in replacement for nest yet. The first milestone is a typed, tested compatibility core before wiring a binary entrypoint.
Repository Layout
src/commands.rsmaps to../nest-cli/commands.src/actions.rsmaps to../nest-cli/actions.src/configuration.rsmaps to../nest-cli/lib/configuration.src/compiler.rsmaps to../nest-cli/lib/compiler.src/schematics.rsmaps to../nest-cli/lib/schematics.src/package_managers.rsmaps to../nest-cli/lib/package-managers.src/runners.rsmaps to../nest-cli/lib/runners.src/ui.rsmaps to../nest-cli/lib/ui.src/utils.rsmaps to../nest-cli/lib/utils.
Development
From the repository root:
cargo fmt --manifest-path .\cli\Cargo.toml
cargo check --manifest-path .\cli\Cargo.toml --tests
cargo test --manifest-path .\cli\Cargo.toml requires a working Rust linker. On Windows MSVC targets, install Visual Studio Build Tools with the C++ workload so link.exe is available.
Dependency Strategy
Nest-owned packages such as @nestjs/schematics are separate Rust packages in the nestrs organization. cli should depend on small typed placeholder contracts and avoid binding directly to sibling implementation crates until a stable integration adapter is needed.
For non-Nest dependencies, prefer reputable Rust crates with matching behavior. If no good Rust crate exists, port the needed behavior locally and document the compatibility choice.
Naming
Keep Rust names mechanically traceable to upstream names:
- Preserve folder and file names as closely as Rust modules allow.
- Convert TypeScript
camelCasefunction and method names to Rustsnake_case. - Convert upstream class/interface/type names to Rust
UpperCamelCase. - Add a source-path doc comment when a Rust item cannot obviously map back to upstream.
Attribution
This project is a Rust conversion of the Nest CLI behavior. The upstream Nest CLI source is MIT licensed; keep license and attribution notes updated before any release.