From c65e6fe0a0429a2a8ba9cd2a9f8826daef5e1b96 Mon Sep 17 00:00:00 2001 From: leopechnicki Date: Tue, 30 Jun 2026 14:01:13 +0200 Subject: [PATCH] improve: add author field, shell completion docs, richer README examples Co-authored-by: Crew Leo Agile dev team --- README.md | 154 ++++++++++++++++++++++++++++++++++++++++++++++----- package.json | 3 +- 2 files changed, 142 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index ad6d609..9abce66 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,9 @@ [![npm downloads](https://img.shields.io/npm/dw/quickdev-cli.svg?style=flat-square&color=10b981)](https://www.npmjs.com/package/quickdev-cli) [![license](https://img.shields.io/npm/l/quickdev-cli.svg?style=flat-square&color=6366f1)](https://github.com/leopechnicki/quickdev-cli/blob/main/LICENSE) [![zero dependencies](https://img.shields.io/badge/dependencies-0-22c55e?style=flat-square)](https://www.npmjs.com/package/quickdev-cli) +[![Node.js](https://img.shields.io/badge/Node.js-%3E%3D18-43853d?style=flat-square&logo=node.js)](https://nodejs.org) -[npm](https://npmjs.com/package/quickdev-cli) · [GitHub](https://github.com/leopechnicki/quickdev-cli) +[npm](https://npmjs.com/package/quickdev-cli) · [GitHub](https://github.com/leopechnicki/quickdev-cli) @@ -21,25 +22,150 @@ npm install -g quickdev-cli ``` -## Usage +After install, the `qdev` command is available globally. + +## Commands + +```bash +qdev uuid [count] # Generate UUIDs (default: 1, max: 100) +qdev pass [length] # Generate cryptographically secure password (default: 20) +qdev hash # MD5, SHA1, SHA256 hashes +qdev b64e # Base64 encode +qdev b64d # Base64 decode +qdev lorem [count] # Lorem ipsum paragraphs (default: 3, max: 20) +qdev ts # Current Unix, millis, ISO, and local timestamps +qdev ip # Local network IP addresses +qdev random # Cryptographically secure random number +qdev slug # URL-safe slug +qdev jwt # Decode JWT (no verification) +qdev help # Show command reference +``` + +## Examples + +```bash +# Generate 5 UUIDs and copy to clipboard (macOS) +qdev uuid 5 | pbcopy + +# 32-character password +qdev pass 32 +# Output: kR9#mP2!vL8@nX5$qT7&wY4^zU1*cA6 + +# Generate all hashes for a string +qdev hash "hello world" +# MD5: 5eb63bbbe01eeed093cb22bb8f5acdc3 +# SHA1: 2aae6c69ec0c4bab85f08b47c4d4e06fd2c9db03 +# SHA256: b94d27b9934d3e08a52e52d7da7dabfac484efe04c94e88a8d... + +# Base64 encode a JWT secret +qdev b64e "my-super-secret" +# bXktc3VwZXItc2VjcmV0 + +# Decode a JWT (useful for debugging auth issues) +qdev jwt eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NSJ9.abc +# Header: { "alg": "HS256", "typ": "JWT" } +# Payload: { "sub": "12345" } + +# Get current timestamps for logging +qdev ts +# Unix: 1751234567 +# Millis: 1751234567890 +# ISO: 2026-06-30T10:22:47.890Z +# Local: 6/30/2026, 12:22:47 PM + +# Random integer (uses crypto.randomBytes — not Math.random) +qdev random 1 1000 +# 742 + +# Pipe lorem ipsum into a file +qdev lorem 5 > draft.txt +``` + +## Shell Completion + +### Bash + +Add the following to your `~/.bashrc` or `~/.bash_profile`: + +```bash +# quickdev-cli (qdev) bash completion +_qdev_completions() { + local commands="uuid pass hash b64e b64d lorem ts ip random slug jwt help" + if [ "${#COMP_WORDS[@]}" == "2" ]; then + COMPREPLY=($(compgen -W "${commands}" -- "${COMP_WORDS[1]}")) + fi +} +complete -F _qdev_completions qdev +``` + +Then reload your shell: ```bash -qdev uuid 5 # Generate 5 UUIDs -qdev pass 32 # Generate 32-char password -qdev hash "hello" # MD5, SHA1, SHA256 hashes -qdev b64e "text" # Base64 encode -qdev b64d "dGV4dA==" # Base64 decode -qdev lorem 3 # 3 paragraphs of lorem ipsum -qdev ts # Current timestamps -qdev ip # Local IP addresses -qdev random 1 100 # Random number -qdev slug "My Post!" # URL slug: my-post -qdev jwt # Decode JWT (no verification) +source ~/.bashrc +``` + +### Zsh + +Add the following to your `~/.zshrc`: + +```zsh +# quickdev-cli (qdev) zsh completion +_qdev() { + local commands=( + 'uuid:Generate UUIDs' + 'pass:Generate secure password' + 'hash:Generate MD5/SHA hashes' + 'b64e:Base64 encode' + 'b64d:Base64 decode' + 'lorem:Generate lorem ipsum' + 'ts:Current timestamps' + 'ip:Local IP addresses' + 'random:Random number in range' + 'slug:Convert text to URL slug' + 'jwt:Decode JWT token' + 'help:Show help' + ) + _describe 'qdev commands' commands +} +compdef _qdev qdev +``` + +Then reload: + +```zsh +source ~/.zshrc +``` + +### Fish + +Add the following to `~/.config/fish/completions/qdev.fish`: + +```fish +set -l commands uuid pass hash b64e b64d lorem ts ip random slug jwt help +complete -c qdev -f -a "$commands" +complete -c qdev -n "__fish_seen_subcommand_from uuid" -a "(seq 1 10)" -d "count" ``` ## Why? -Because opening a browser tab for "uuid generator" or "base64 decode" is slower than typing `qdev uuid`. +Because opening a browser tab for "uuid generator" or "base64 decode" is slower than typing `qdev uuid`. Zero npm dependencies means nothing to audit or update. + +## Comparison + +| Task | Old way | With qdev | +|------|---------|-----------| +| UUID | browser tab | `qdev uuid` | +| Password | lastpass generator | `qdev pass 32` | +| Base64 | CyberChef | `qdev b64e "text"` | +| JWT decode | jwt.io (sends token) | `qdev jwt ` (local) | +| Hash | online tool | `qdev hash "input"` | +| Timestamps | JS console | `qdev ts` | + +Note: `qdev jwt` decodes locally — your token never leaves your machine. + +## Requirements + +- Node.js >= 18.0.0 ## License diff --git a/package.json b/package.json index ca5e2df..1508105 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,12 @@ { "name": "quickdev-cli", "version": "1.0.3", - "description": "A collection of handy CLI developer utilities — password gen, UUID, hash, base64, lorem ipsum, and more", + "description": "A collection of handy CLI developer utilities — password gen, UUID, hash, base64, lorem ipsum, and more", "main": "src/index.js", "bin": { "qdev": "src/index.js" }, + "author": "Leo Pechnicki", "keywords": [ "cli", "developer-tools",