Skip to content

1iPluto/health-check-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🩺 health-check-cli

A lightweight, zero-config CLI tool for Node.js developers to validate environment variables and inspect project health — right from the terminal.

npm version npm downloads Node Version License: MIT GitHub Pages


🌐 Live Demo

View the interactive demo →


✨ Features

Command Description
health-check env Validates your .env file against all keys in .env.example
health-check size Calculates and displays total size of node_modules
health-check all Runs all checks and prints a full Project Health Report
  • ✅ Detects missing and empty environment variables
  • 📊 Color-coded visual size bar for node_modules
  • 🌈 Beautiful terminal output with colors and spinners
  • 🛡️ Graceful error handling — never crashes on missing files
  • ⚡ Built with ES Modules, zero custom build step

📦 Installation

From npm (recommended)

npm install -g @1ipluto/health-check-cli

Local development with npm link

git clone https://github.com/1iPluto/health-check-cli.git
cd health-check-cli
npm install
npm link

To unlink later:

npm unlink -g @1ipluto/health-check-cli

🚀 Usage

Navigate to any Node.js project directory and run:

Validate Environment Variables

health-check env
✔  DATABASE_URL
✔  JWT_SECRET
⚠  REDIS_URL        (defined but empty)
✖  STRIPE_SECRET    (missing from .env)

✖ 2 issue(s) found  (2/4 variables OK)

Custom paths:

health-check env --example .env.staging --local .env.local

Check node_modules Size

health-check size
  node_modules Size Report:

  Path:   /Users/you/my-project/node_modules
  Size:   312.47 MB
  Status: Average size. Consider auditing with `npm ls`.

  [█████████░░░░░░░░░░░░░░░░░░░░░] 312.47 MB / ~1 GB scale

Run All Checks at Once

health-check all

Get Help

health-check --help
health-check env --help
health-check size --help

⚙️ Options

Command Option Default Description
env --example <path> .env.example Path to the example env file
env --local <path> .env Path to the local env file to validate
size --dir <path> ./node_modules Path to the directory to measure

🗂 Project Structure

health-check-cli/
├── index.js                        # Main CLI entry point
├── utils/
│   ├── envCheck.js                 # Env validation logic
│   └── sizeCheck.js                # node_modules size calculation
├── docs/
│   └── index.html                  # GitHub Pages demo site
├── .github/
│   └── workflows/
│       └── pages.yml               # Auto-deploy demo to GitHub Pages
├── package.json
├── LICENSE
└── README.md

🛠 Tech Stack

  • commander — CLI argument parsing
  • chalk — Terminal string styling
  • ora — Elegant terminal spinners

🤝 Contributing

Contributions, issues and feature requests are welcome!

  1. Fork the repo
  2. Create your feature branch: git checkout -b feat/my-new-feature
  3. Commit your changes: git commit -m "feat: add my new feature"
  4. Push to the branch: git push origin feat/my-new-feature
  5. Open a Pull Request

📄 License

MIT — free to use, modify, and distribute.


Made with ❤️ for the developer community

About

A zero-config CLI tool for Node.js developers to validate environment variables, analyze dependencies size, and generate project health reports directly from the terminal.

Topics

Resources

License

Stars

Watchers

Forks

Contributors