NestJS DevTools is a Visual Studio Code extension built specifically for NestJS TypeScript projects. It eliminates two of the most repetitive friction points in day-to-day NestJS development: writing boilerplate logger statements by hand and hunting through deeply-nested module directories to open the file you need. With a single keyboard chord you can insert a fully-formattedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/pouryazardosht/nestjs-devtools/llms.txt
Use this file to discover all available pages before exploring further.
this.logger.<method>() call β complete with the enclosing class name auto-detected β or pop open a grouped quick-pick of every file in the current module and jump straight to it without touching your mouse.
Logger Helper
Insert smart
this.logger.debug/log/warn/error/verbose() statements in one chord, with the enclosing class name filled in automatically.Module File Searcher
Instantly navigate every
.ts file inside a NestJS module, grouped by file type and openable with a single shortcut letter.Why NestJS DevTools?
Every NestJS service method eventually needs a log line. The idiomatic pattern looks like this:~ separator, repeating the variable name twice, and placing the statement in the right spot β after a closing brace when the line opens a block, after the statement otherwise. Multiply this across dozens of methods in dozens of services and the overhead adds up fast.
Navigating module files is its own chore. A real-world NestJS module can scatter its service, controller, guards, DTOs, entities, and strategies across several subdirectories. Finding the right file means expanding folder trees, scrolling, and clicking β or firing off a fuzzy search and hoping the filename is unique enough to surface quickly.
NestJS DevTools collapses both workflows to a single keyboard chord:
- Logger Helper β select a variable, press
Cmd+L Cmd+D(macOS) orCtrl+L Ctrl+D(Windows/Linux), and the correctly-formatted debug log is inserted on the next line (or after the closing brace of a block). Class name detection is automatic. - Module File Searcher β press
Cmd+L Cmd+Kfrom any file inside a module and a grouped quick-pick appears showing every.tsfile. Type a shortcut letter (s,c,dt, β¦) and the file opens instantly β no Enter required.
How it works
Logger Helper
When you trigger a logger command, the extension:- Reads the current selection β the selected text becomes the variable name embedded in the log message.
- Detects the enclosing class name β the document is scanned upward from the cursor line, searching for the nearest
class ClassNamedeclaration. The matched class name is used in the log message automatically. - Determines the insertion point β if the current line ends with
{(opening a new block, such as a multi-line function call), the extension counts braces to locate the matching}and inserts the log statement on the line after that closing brace, so the log is never placed inside the block. For all other lines the log is inserted immediately after the current line. - Writes the formatted statement β indentation is preserved from the current line, and the log takes the form
this.logger.<method>("<emoji> ClassName ~ varName", varName). - Confirms via the status bar β a
β Logger.<method> insertedmessage is shown for three seconds.
Module File Searcher
When you trigger either of the two module navigation commands, the extension:- Locates the module root β starting from the directory of the currently open file, it walks up the directory tree until it finds a folder containing a
*.module.tsfile. That folder becomes the module root. (The global module picker skips this step and lists every*.module.tsin the workspace instead.) - Collects all
.tsfiles βvscode.workspace.findFilesis used to glob every.tsfile beneath the module root, excludingnode_modules. - Categorises by file type β each file name is matched against the known NestJS suffix list (service, controller, guard, dto, entity, β¦). Unrecognised files fall into an βOther Filesβ bucket.
- Presents a grouped quick-pick β files are sorted into category sections (Core NestJS β Entities β DTOs β Enums β Interfaces β Other β Other Files) with separator labels between them.
- Responds to shortcut letters β as you type in the quick-pick, the extension checks whether the current input matches a known shortcut (
sβ service,cβ controller,dtβ DTO, β¦). The moment a match is found the file is opened immediately, without requiring you to press Enter.
Extension commands
All seven commands are accessible from the Command Palette (Cmd+Shift+P / Ctrl+Shift+P) by typing NestJS Devtools:
| Command ID | Title |
|---|---|
nestjs-log-helper.insertDebugLog | NestJS Devtools: Insert debug log |
nestjs-log-helper.insertLogLog | NestJS Devtools: Insert log log |
nestjs-log-helper.insertWarnLog | NestJS Devtools: Insert warn log |
nestjs-log-helper.insertErrorLog | NestJS Devtools: Insert error log |
nestjs-log-helper.insertVerboseLog | NestJS Devtools: Insert verbose log |
nestjs-log-helper.searchModuleFiles | NestJS Devtools: Search Module Files |
nestjs-log-helper.moduleSearcher | NestJS Devtools: Open Module Files |
NestJS DevTools requires Visual Studio Code 1.118.0 or newer. It has no runtime dependencies beyond VS Code itself β no npm packages need to be installed in your project, and no configuration files are required.