tsgonest documentation
Native-speed TypeScript compilation with tsgo, generated runtime validators and serializers, and static OpenAPI 3.2 analysis for NestJS.
Explore the docs
Get up and running fast
Install tsgonest, configure your project, and build your first NestJS app with native-speed tsgo in minutes.
Full CLI reference
Every flag for `tsgonest build` and `tsgonest dev`, the operational pipeline, exit codes, and usage examples.
Configuration reference
Complete `tsgonest.config.json` schema with controllers, transforms, OpenAPI, NestJS versioning, and more.
Deep dive
Validation & constraints
JSDoc tags, branded types, string formats, transforms, coercion, custom validators, discriminated unions, and Standard Schema.
Serialization & runtime
Fast generated serializers (2-5x faster than JSON.stringify), manifest-driven discovery, ValidationPipe, and FastInterceptor.
OpenAPI 3.2 generation
Static analysis of NestJS controllers produces a fully-compliant OpenAPI 3.2 document with zero runtime decorators.
Comparisons
tsgonest vs NestJS CLI
Build speed, validation, serialization, and OpenAPI compared to the standard NestJS ecosystem.
tsgonest vs Nestia + Typia
Architecture differences, DX comparison, and migration path from the Nestia/Typia ecosystem.
tsgonest vs tsgo
What tsgonest adds on top of Microsoft's typescript-go compiler: companions, manifest, OpenAPI, and dev mode.
Compilation pipeline
tsgonest wraps typescript-go (tsgo) and runs a full static analysis pass before emitting companion files.
- 1Parse CLI args + tsgonest.config.json
- 2Create tsgo program from tsconfig
- 3Type-check and emit JavaScript
- 4Walk AST with type checker → extract type metadata
- 5Generate *.tsgonest.js + *.tsgonest.d.ts companions
- 6Write __tsgonest_manifest.json
- 7Generate openapi.json from NestJS controllers