Before
# Terminal 1
nest-devtools start
# Terminal 2
npm run start:devAfter (new way)
# Only one command
npm run start:devThe DevTools server + WebSocket + Dashboard now start automatically inside the same process when you call NestDevTools.init(app).
| File | Purpose |
|---|---|
packages/sdk/src/init.ts |
Main entry – starts the embedded server |
packages/sdk/src/index.ts |
Public exports |
packages/sdk/src/nest-devtools.ts |
Convenience namespace NestDevTools.init() |
packages/sdk/src/sdk-connection.ts |
Internal connection logic (same process) |
| File | Purpose |
|---|---|
packages/server/src/server.ts |
HTTP + WebSocket server that runs inside the Nest process |
| File | Purpose |
|---|---|
examples/basic-nestjs/src/main.ts |
How the user should use it |
- Copy the
packages/sdkandpackages/serverfolders into your monorepo (or adapt the paths). - Make sure the dashboard static files are built into
packages/server/dashboard. - In your NestJS
main.ts:
import { NestDevTools } from '@angelitosystems/nest-devtools';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
await NestDevTools.init(app); // ← only this line
await app.listen(3000);
}- No necesitas ejecutar
nest-devtools startpor separado: el dashboard y el WebSocket se inician dentro del proceso de NestJS.
await NestDevTools.init(app, {
port: 4317, // dashboard
wsPort: 4318, // websocket
openDashboard: true, // open browser automatically
enabled: true, // force enable even in production (not recommended)
host: 'localhost',
});You can also control it with environment variables:
NEST_DEVTOOLS_PORT=4317
NEST_DEVTOOLS_WS_PORT=4318
NEST_DEVTOOLS_OPEN=true- ✅ One single process
- ✅ No race conditions
- ✅ Dashboard dies automatically when the Nest app stops
- ✅ Much better Developer Experience
- ✅ Fallback: if the port is already taken it connects as client
- Move your real dashboard UI into
packages/server/dashboard - Expand the WebSocket protocol in
server.tsandsdk-connection.ts - Add request/response interception, graph introspection, logs, etc.
- Publish the SDK as an npm package if you want
If you share the original source structure I can adapt these files 100% to your current code.