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 ๐Ÿ™

ยฉ 2026 โ€“ย Pkg Stats / Ryan Hefner

sa5er-cli

v1.0.0

Published

CLI wrapper that explains terminal errors with sarcastic Egyptian Arabic humor, powered by Gemini AI ๐Ÿ‡ช๐Ÿ‡ฌ

Readme

โšก Sa5er CLI

Your Sarcastic Egyptian Senior Developer ๐Ÿ‡ช๐Ÿ‡ฌ

A CLI tool that wraps terminal commands. When they fail, it explains the error with Egyptian humor and provides the actual fix.

npm version License: MIT Node.js


๐Ÿค” What is Sa5er?

Sa5er (ุณุงุฎุฑ โ€” meaning "sarcastic" in Arabic) is a CLI wrapper that runs any terminal command. If the command fails, Sa5er intercepts the error and gives you:

  1. ๐Ÿ˜ A sarcastic explanation in Egyptian Arabic (like a senior dev roasting you at the office)
  2. โœ… The actual fix with clear, actionable steps

Instead of Googling cryptic error messages, just prefix your command with sa5er and let the Egyptian senior handle it!


๐Ÿš€ Quick Start

# Install globally
npm install -g sa5er-cli

# (Optional) Add AI key for unknown errors โ€” Groq is FREE!
sa5er auth gsk_YOUR_GROQ_KEY

# Use it!
sa5er npm run build
sa5er node app.js
sa5er git push origin main

๐Ÿ’ก Get a free Groq API key: console.groq.com/keys Sa5er works without an API key for 40+ common errors!


๐Ÿ“ธ Examples

โŒ Missing npm script

$ sa5er npm run doesnotexist

  โŒ ุงู„ุฃู…ุฑ ูุดู„! (exit code: 1)

  โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
  โ•‘  ๐Ÿšจ Sa5er Error Handler                  โ•‘
  โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
  โ•‘                                          โ•‘
  โ•‘  ๐Ÿ˜ ุฑุฃูŠ ุงู„ุณูŠู†ูŠูˆุฑ:                        โ•‘
  โ•‘  ูŠุง ุนู…ุŒ ุฅู†ุช ุจุชุดุบู‘ู„ ุณูƒุฑูŠุจุช ู…ุด ู…ูˆุฌูˆุฏ     โ•‘
  โ•‘  ููŠ ุงู„ู€ package.json! ๐Ÿ˜‚                 โ•‘
  โ•‘                                          โ•‘
  โ•‘  โœ… ุงู„ุญู„:                                โ•‘
  โ•‘  1. ุงูุชุญ package.json ูˆุดูˆู ุงู„ู€ scripts   โ•‘
  โ•‘  2. ุชุฃูƒุฏ ู…ู† ุงุณู… ุงู„ุณูƒุฑูŠุจุช                โ•‘
  โ•‘  3. ุฌุฑุจ npm run ุนุดุงู† ุชุดูˆู ุงู„ู…ุชุงุญ        โ•‘
  โ•‘                                          โ•‘
  โ•‘  [ู…ู† ุงู„ุฃุฑุดูŠู ๐Ÿ“š]                         โ•‘
  โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โŒ File not found

$ sa5er node app.js

  ๐Ÿ˜ "ุงู„ู…ูˆุฏูŠูˆู„ ุฏู‡ ุงุฎุชูู‰ ุฒูŠ ู…ุง ุจุชุฎุชููŠ ุงู„ุณุญู„ูŠุฉ ูˆุฑุง ุงู„ุชู„ุงุฌุฉ! ๐ŸฆŽ"

โŒ Git in wrong directory

$ sa5er git push origin main

  ๐Ÿ˜ "ูŠุง ุจุงุดุงุŒ ุฅู†ุช ู…ุด ููŠ git repo ุฃุตู„ุงู‹! ๐Ÿ˜‚ ุฏู‡ ุฒูŠ ู…ุง ุชุทู„ุจ ู‚ู‡ูˆุฉ ููŠ ุตูŠุฏู„ูŠุฉ!"

๐Ÿง  How It Works โ€” 3-Tier Error Handling

Sa5er uses a smart 3-tier system to minimize API calls:

Command fails โ†’ stderr captured
       โ”‚
       โ”œโ”€โ”€ ๐Ÿ” Layer 1: Local Error Database (40+ patterns)
       โ”‚     โ””โ”€โ”€ Instant! No internet needed
       โ”‚
       โ”œโ”€โ”€ ๐Ÿ” Layer 2: Dynamic Cache (~/.sa5er/cache.json)
       โ”‚     โ””โ”€โ”€ Previously seen errors, instant response
       โ”‚
       โ””โ”€โ”€ ๐Ÿค– Layer 3: AI (Groq/Gemini)
             โ””โ”€โ”€ Unknown errors โ†’ AI explains โ†’ cached for next time

| Layer | Speed | Internet | API Key | |-------|-------|----------|---------| | 1. Error DB | โšก Instant | โŒ No | โŒ No | | 2. Cache | โšก Instant | โŒ No | โŒ No | | 3. AI | ~2 seconds | โœ… Yes | โœ… Yes |

Most common errors are handled by Layer 1 โ€” no API key needed!


๐Ÿ”‘ Authentication

Sa5er supports two AI providers for Layer 3:

Option 1: Groq (Recommended โ€” Free! โœ…)

# 1. Get a free key from: https://console.groq.com/keys
# 2. Save it:
sa5er auth gsk_YOUR_GROQ_KEY
  • โœ… Free โ€” 14,400 requests/day
  • โœ… Fast โ€” powered by custom LPU chips
  • โœ… Global โ€” works everywhere
  • Uses Llama 3.3 70B model

Option 2: Google Gemini

# 1. Get a key from: https://aistudio.google.com/app/apikey
# 2. Save it:
sa5er auth AIzaSyXXXXXXXXXX
  • May require billing in some regions
  • Uses Gemini 2.0 Flash model
  • Auto-fallback to Gemini 2.0 Flash Lite

Auto-detection: Sa5er automatically detects the provider from your key format (gsk_ โ†’ Groq, AIza โ†’ Gemini)


๐Ÿ“‹ Commands

| Command | Description | |---------|-------------| | sa5er <command> | Run any terminal command with error handling | | sa5er auth <key> | Save your AI API key (Groq or Gemini) | | sa5er cache | Show cache statistics | | sa5er cache-clear | Clear the error cache | | sa5er --help | Show help | | sa5er --version | Show version |


๐Ÿ“ฆ Built-in Error Patterns (Layer 1)

Sa5er recognizes 40+ common errors without needing any API key:

| Category | Errors | |----------|--------| | Node.js | MODULE_NOT_FOUND, SyntaxError, ReferenceError, TypeError, Maximum call stack size exceeded | | npm | Missing script, ERESOLVE, ELIFECYCLE, deprecated warnings, audit vulnerabilities | | Git | Not a git repository, merge conflicts, authentication failed | | Network | ECONNREFUSED, ETIMEDOUT, CORS, ECONNRESET | | File System | ENOENT, EACCES, EPERM, ENOSPC, ENAMETOOLONG | | React | Hydration errors, invalid hook calls, key prop warnings | | Next.js | SSR/SSG errors, prerendering failures | | TypeScript | Type errors, TS2345, TS2322, file extension issues | | Build Tools | Vite, Webpack, esbuild, Rollup errors | | Docker | Daemon not running, image not found | | Python | ModuleNotFoundError, pip not found | | SSH | Connection refused, permission denied, host key verification | | Database | Connection refused on common ports | | ESLint | Parsing errors, rule violations | | Environment | Missing .env variables, REACT_APP_, VITE_, NEXT_PUBLIC_ | | Windows | PowerShell execution policy, path too long | | Security | OpenSSL errors (ERR_OSSL_EVP_UNSUPPORTED) |


๐Ÿ—๏ธ Architecture

sa5er-cli/
โ”œโ”€โ”€ bin/sa5er.js           # CLI entry point
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ index.js           # CLI router (Commander.js)
โ”‚   โ”œโ”€โ”€ commands/
โ”‚   โ”‚   โ”œโ”€โ”€ auth.js        # API key management
โ”‚   โ”‚   โ””โ”€โ”€ run.js         # Command execution + 3-tier system
โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”‚   โ”œโ”€โ”€ errorMatcher.js # Layer 1: Regex pattern matching
โ”‚   โ”‚   โ”œโ”€โ”€ cache.js        # Layer 2: SHA-256 hashed cache
โ”‚   โ”‚   โ””โ”€โ”€ gemini.js       # Layer 3: AI (Groq + Gemini)
โ”‚   โ”œโ”€โ”€ utils/
โ”‚   โ”‚   โ”œโ”€โ”€ config.js      # Config management (~/.sa5er/)
โ”‚   โ”‚   โ”œโ”€โ”€ display.js     # Terminal UI + colored boxes
โ”‚   โ”‚   โ””โ”€โ”€ bidi.js        # Arabic text rendering (RTL + shaping)
โ”‚   โ””โ”€โ”€ data/
โ”‚       โ””โ”€โ”€ errors.json    # 40+ pre-loaded error patterns
โ””โ”€โ”€ package.json

๐ŸŒ Arabic Text Rendering

Sa5er properly renders Arabic text in terminals that don't natively support RTL:

  • Letter Shaping โ€” Uses arabic-reshaper to connect Arabic letters (Presentation Forms)
  • Bidi Reordering โ€” Uses bidi-js (Unicode Bidirectional Algorithm) to display RTL text correctly in LTR terminals
  • Mixed Text โ€” English words (like package.json) stay LTR within Arabic sentences

๐Ÿค Contributing

Want to add more error patterns? Edit src/data/errors.json:

{
  "pattern": "your regex pattern here",
  "response": {
    "sarcasm": "ุชุนู„ูŠู‚ ุณุงุฎุฑ ุจุงู„ุนุฑุจูŠ ุงู„ู…ุตุฑูŠ ๐Ÿ˜‚",
    "fix": "1. ุงู„ุฎุทูˆุฉ ุงู„ุฃูˆู„ู‰\n2. ุงู„ุฎุทูˆุฉ ุงู„ุชุงู†ูŠุฉ"
  }
}

Pull requests are welcome! ๐ŸŽ‰


๐Ÿ“„ License

MIT ยฉ Sa5er CLI


Made with โ˜• and Egyptian humor

ูŠู„ุง ูŠุง ู‡ู†ุฏุณุฉุŒ ุงู„ูƒูˆุฏ ู…ุด ู‡ูŠูƒุชุจ ู†ูุณู‡! ๐Ÿ‡ช๐Ÿ‡ฌ