DEV Community

ke jia
ke jia

Posted on

How I Built and Shipped 4 CLI Tools in One Weekend

Last weekend I decided to scratch my own itch. I was tired of repeating the same terminal workflows — setting up projects, scanning for leaked secrets, checking git stats, and managing code snippets. So I built four CLI tools to solve each problem. Here's the story.


The Rules I Set

Before writing a single line of code, I set 3 constraints:

  1. Zero dependenciesnode:fs, node:path, node:child_process only. No chalk, no inquirer, no commander.
  2. One command, one job — each tool does exactly one thing well. No subcommands, no config files.
  3. Ship in hours, not days — if a tool takes more than a day, I'm over-engineering it.

Tool 1: ScaffoldX — Generate 12 Project Templates in 3 Seconds

The Problem: Every new project starts with mkdir, npm init -y, creating .gitignore, src/index.js, README.md... 30 minutes of boilerplate before writing real code.

The Solution:

npx scaffoldx-cli my-app --template express-api
Enter fullscreen mode Exit fullscreen mode

ScaffoldX ships with 12 templates: Express API, React SPA, Next.js, Vue, CLI tools, Electron, Chrome Extension, VS Code Extension, Discord Bot, Library Starter, Static Site, and Monorepo. Pick one, and your entire project structure is ready in 3 seconds.

Each template comes with:

  • Proper .gitignore and .env.example
  • package.json with scripts
  • ESLint + Prettier config
  • README.md template
  • CI-ready GitHub Actions

⭐ GitHub | npm


Tool 2: DotGuard — Stop Committing Your Secrets

The Problem: We've all done it. git add . && git commit -m "fix" — and now your .env is in the repo. Or worse, you're onboarding a new dev and .env.example has actual keys.

The Solution:

npx @wuchunjie/dotguard
Enter fullscreen mode Exit fullscreen mode

DotGuard scans your project for .env files and patterns (.env.local, .env.production, .env.development) and checks:

  • Are any .env files tracked by git?
  • Does .env.example contain real secrets?
  • Are there hardcoded API keys in source files?

It outputs a color-coded report with line numbers and severity levels.

⭐ GitHub | npm


Tool 3: GitPulse — Git Analytics Right in Your Terminal

The Problem: You want to know who's contributing, what's changing, and how fast — but you don't want to open GitHub.

The Solution:

npx @wuchunjie/gitpulse
Enter fullscreen mode Exit fullscreen mode

GitPulse gives you:

  • Contributor stats — commits per author, lines added/deleted
  • Velocity — commits per day/week, time between releases
  • Hotspots — files that change most often (potential tech debt)
  • Branch health — stale branches, unmerged PRs

All with zero external API calls — it reads purely from your local .git directory.

⭐ GitHub | npm


Tool 4: SnippetX — Your Terminal Code Snippet Manager

The Problem: You have that one docker run command you can never remember. Or the ffmpeg incantation for resizing video. You keep a notes.txt file that's 800 lines long and impossible to search.

The Solution:

npx @wuchunjie/snippetx save "docker cleanup" "docker system prune -af --volumes"
npx @wuchunjie/snippetx search docker
npx @wuchunjie/snippetx copy "docker cleanup"
Enter fullscreen mode Exit fullscreen mode

SnippetX stores your snippets locally in ~/.snippetx.json with tags and descriptions. Search is fuzzy, copy is one command, and it works offline.

⭐ GitHub | npm


The Stack

  • Runtime: Node.js (built-in modules only)
  • Package manager: npm
  • Testing: Node's built-in assert + test runner
  • CI/CD: GitHub Actions
  • Total lines of code (4 tools): ~2,300

What I Learned

  1. Zero-deps is liberating. No chalk means you manually write ANSI codes. No inquirer means you parse process.argv by hand. It takes slightly longer to write, but you have zero supply chain risk and instant startup.

  2. Ship before it's ready. Every tool launched with the minimum feature set. ScaffoldX started with 3 templates (now 12). DotGuard started with .env scanning only (now detects 5 patterns). You can't improve what isn't live.

  3. npx is the best distribution channel. No npm install -g needed. No brew tap. No download page. npx package-name and it just works. Adoption barrier: zero.

  4. Terminal-first matters. GUIs are nice, but developers live in the terminal. All four tools work in CI pipelines, pre-commit hooks, and shell scripts — not just interactive use.


What's Next

I'm building more templates for ScaffoldX (Tauri, Bun, Deno) and adding team-level analytics to GitPulse. DotGuard will get GitHub Actions integration so it runs in CI automatically.

Try all four:

npx scaffoldx-cli my-project --template react
npx @wuchunjie/dotguard
npx @wuchunjie/gitpulse
npx @wuchunjie/snippetx save "hello" "echo hello world"
Enter fullscreen mode Exit fullscreen mode

If these tools save you time, buy me a coffee

Top comments (0)