DEV Community

Bhaviraj
Bhaviraj

Posted on

I built a CLI tool that fixes the most annoying thing about the `touch` command

Every time I'm working on a NestJS (or any Node) project and try to create
a deeply nested file:

touch src/client/dto/create-client.dto.ts
# ❌ Error: no such file or directory
Enter fullscreen mode Exit fullscreen mode

I have to first mkdir -p the folders, then touch the file. Every. Single. Time.

So I built nestfile — a tiny zero-dependency CLI that just works:

nestfile src/client/dto/create-client.dto.ts
# ✔ Created: src/client/dto/create-client.dto.ts
Enter fullscreen mode Exit fullscreen mode

It auto-creates any missing folders (like mkdir -p) and works on
Windows, Mac & Linux.

You can also create multiple files at once:

nestfile src/user/user.service.ts src/user/user.controller.ts src/user/dto/create-user.dto.ts
Enter fullscreen mode Exit fullscreen mode

Install:
npm install -g nestfile

It's tiny, zero dependencies, MIT licensed. Would love any feedback!

npm: https://www.npmjs.com/package/nestfile

Top comments (0)