npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@imperiohub/cli

v1.1.0

Published

CLI tool for quickly setting up backend projects with Express, TypeScript/JavaScript, and popular packages

Readme

@imperiohub/cli

CLI tool for quickly setting up backend projects with Express, TypeScript/JavaScript, and popular packages

A collection of useful shell scripts to automate common development tasks through an interactive terminal interface.

🚀 Quick Start

Via NPM (Recommended)

# Run directly with npx (no installation needed)
npx @imperiohub/cli

# Or install globally
npm install -g @imperiohub/cli

# Then run
imperiohub

Via Git Clone

# Clone the repository
git clone https://github.com/imperiohub-dev/sh-scripting.git
cd sh-scripting

# Run the interactive launcher
./run.sh

That's it! The launcher will guide you through all available scripts with an interactive menu.

📦 Installation

Option 1: NPM Package (Recommended)

Install globally to use anywhere:

npm install -g @imperiohub/cli

Or run without installing:

npx @imperiohub/cli

Option 2: Clone Repository

Clone this repository to your local machine:

git clone https://github.com/imperiohub-dev/sh-scripting.git
cd sh-scripting

Option 1: Automatic (Recommended)

The launcher script will automatically make scripts executable when needed:

./run.sh

If you get a permission denied error on first run, make run.sh executable:

chmod +x run.sh
./run.sh

Option 2: Manual Setup

Make all scripts executable at once:

chmod +x run.sh
chmod +x lib/*.sh
chmod +x scripts/**/*.sh

Or use find:

find . -name "*.sh" -type f -exec chmod +x {} \;

🎯 Main Launcher

The easiest way to use this toolkit is through the main launcher:

./run.sh              # Interactive mode (recommended)
./run.sh --list       # List all available scripts
./run.sh --help       # Show help
./run.sh --run <path> # Run a specific script directly

Interactive Mode

When you run ./run.sh without arguments, you'll see:

  1. Welcome banner with branding
  2. Category selection - Browse categories with arrow keys (↑/↓)
  3. Script selection - Choose a script from the category
  4. Script execution - The script runs and shows results
  5. Continue prompt - Run another script or exit

Features

  • Beautiful UI with colors and emojis
  • ⌨️ Keyboard navigation with arrow keys
  • 📂 Organized by categories (Backend, Frontend, Database, etc.)
  • 🔄 Run multiple scripts in one session
  • 📋 List all scripts with descriptions
  • 🎯 Direct execution of specific scripts

📚 Available Scripts

Backend Scripts

  • Setup Backend Project - Create a Node.js backend with Express
    • Supports TypeScript or JavaScript
    • Choose location: Create new folder or use current directory
    • Interactive configuration
    • 18+ Optional packages:
      • Security: helmet, bcrypt, jsonwebtoken, passport
      • Validation: express-validator, zod, joi
      • Database: mongoose (MongoDB)
      • Performance: compression, express-rate-limit
      • Utilities: axios, uuid, multer, nodemailer, cookie-parser
      • Logging: morgan, winston
      • Basics: CORS, dotenv
    • Ready-to-use project structure with best practices
    • Automatic dependency installation
    • TypeScript support with types included

View Backend Scripts Documentation

Frontend Scripts

  • Setup React + Vite Project - Create a React application with Vite
    • Supports TypeScript or JavaScript
    • Choose location: Create new folder or use current directory
    • Lightning-fast HMR with Vite
    • 12+ Optional packages:
      • Routing: React Router
      • Styling: TailwindCSS (auto-configured)
      • State: Zustand, Redux Toolkit
      • Data Fetching: TanStack Query, Axios
      • Forms: React Hook Form
      • Validation: Zod
      • Animation: Framer Motion
      • Utilities: React Icons, date-fns, clsx
    • Automatic project structure setup
    • Custom port configuration
    • Production-ready build setup

💡 Usage Examples

Interactive Mode (Recommended)

./run.sh

Then use arrow keys to navigate:

╔═══════════════════════════════════════════════════════╗
║                                                       ║
║           🚀  Shell Scripting Utilities  🚀          ║
║                                                       ║
║         Your Swiss Army Knife for Dev Tasks          ║
║                                                       ║
╚═══════════════════════════════════════════════════════╝

? Choose a category
  ❯ Backend
    Frontend
    Exit

List All Scripts

./run.sh --list

Run Specific Script Directly

./run.sh --run scripts/backend/setup-backend.sh

Or run the script directly:

./scripts/backend/setup-backend.sh

📁 Project Structure

sh-scripting/
├── run.sh                 # ⭐ Main launcher (start here!)
├── CONTRIBUTING.md        # Guide for adding new scripts
├── lib/                   # Reusable libraries
│   ├── ui.sh             # UI functions (menus, prompts, colors)
│   ├── file-utils.sh     # File operations utilities
│   ├── package-manager.sh # Package manager detection and usage
│   └── validators.sh     # Input validation functions
├── scripts/              # Executable scripts organized by category
│   └── backend/         # Backend-related scripts
│       ├── setup-backend.sh
│       └── README.md
├── templates/           # File templates used by scripts
│   └── backend-ts/     # Backend templates
│       └── files/
└── README.md           # This file

🛠️ Library Functions

UI Library (lib/ui.sh)

Interactive UI components:

  • select_option - Menu with arrow key navigation
  • multi_select - Multi-selection menu with spacebar
  • input - Text input with default values
  • confirm - Yes/No confirmation
  • print_success/error/info/warning - Colored messages
  • print_header - Formatted section headers

File Utils (lib/file-utils.sh)

File and directory operations:

  • create_directory_structure - Create multiple directories
  • create_file_from_template - Generate files from templates
  • create_file - Create file with content
  • create_gitignore - Generate .gitignore
  • create_package_json - Generate package.json
  • create_tsconfig - Generate tsconfig.json

Package Manager (lib/package-manager.sh)

Package manager operations:

  • detect_package_manager - Auto-detect npm/yarn/pnpm
  • install_dependencies - Install with detected manager
  • get_run_command - Get correct run command for scripts

Validators (lib/validators.sh)

Input validation:

  • validate_project_name - Validate project names
  • validate_port - Validate port numbers
  • validate_node_version - Check Node.js version
  • check_directory_available - Verify directory is available

🔧 Creating New Scripts

When creating new scripts, you can reuse the library functions:

#!/bin/bash

# Get script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(cd "${SCRIPT_DIR}/../.." && pwd)"

# Import libraries
source "${ROOT_DIR}/lib/ui.sh"
source "${ROOT_DIR}/lib/file-utils.sh"
source "${ROOT_DIR}/lib/package-manager.sh"
source "${ROOT_DIR}/lib/validators.sh"

# Your script logic here
print_header "My Script"

project_name=$(input "Project name" "my-project")
language=$(select_option "Language" "TypeScript" "JavaScript")

# ... more logic

🎨 Features

  • Interactive UI - User-friendly menus with arrow key navigation
  • Validation - Input validation for all user inputs
  • Flexible - Support for multiple package managers (npm, yarn, pnpm)
  • Modular - Reusable library functions
  • Colorful - Color-coded messages for better readability
  • Error Handling - Proper error checking and user feedback

📝 Requirements

  • Node.js >= 14.x (for backend scripts)
  • Bash >= 4.0
  • Package Manager (npm, yarn, or pnpm)

🤝 Contributing

Want to add a new script? It's easy!

Quick steps:

  1. Create your script in scripts/[category]/
  2. Add it to the registry in run.sh
  3. Done! It will appear in the interactive menu

For detailed instructions, see CONTRIBUTING.md which includes:

  • How to structure your script
  • Using the library functions
  • Registering scripts in the launcher
  • Best practices and examples
  • Complete templates

📄 License

MIT

🔮 Future Scripts

Planned additions:

  • More frontend frameworks (Vue, Angular, Svelte)
  • Database setup scripts (PostgreSQL, MySQL, MongoDB)
  • Docker configuration generators
  • CI/CD pipeline generators
  • Testing setup scripts (Vitest, Jest, Playwright)
  • API documentation generators (Swagger, OpenAPI)