Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CodeBySohaib DevTools (cbs-devtools)

npm version license Node.js Version

An all-in-one, cross-platform developer utility CLI toolkit designed for speed, security, and productivity. Built with Node.js, TypeScript, Commander.js, and @clack/prompts.


🌟 Features

  • 🌐 Network Tools: Public IP lookup with geolocation, local network interfaces, DNS record resolution, cross-platform ping, TCP port reachability tester, HTTP header inspector, WHOIS lookup, URL parser, and traceroute diagnostic.
  • πŸ›  Developer Utilities: JSON formatter & minifier (with stdin pipe support), Base64 encoder/decoder, text & file hashing (MD5, SHA1, SHA256, SHA512), UUID v4 & v7 generators, timestamp converters, URL & HTML entity tools, interactive regex tester, 100% local-only JWT decoder, and JSON to TypeScript interface generator.
  • ⚑ Generators: Cryptographically secure password generator, random developer username generator, URL slug generator, Lorem Ipsum text generator, fake developer data generator, random color & CSS gradient generator, terminal QR code generator, and secret token generator.
  • πŸ“ File Utilities: File & directory metadata inspector, Zip archive compression & extraction, pattern-based batch file renamer with --dry-run, automatic directory organizer by file type, recursive file finder, and hash-based duplicate file detector.
  • πŸ–Ό Image Utilities: Image metadata inspector, image resizer, format converter (PNG, JPG, BMP), quality compressor, and multi-resolution favicon set generator (16x16 to 128x128).
  • πŸ’» System Utilities: System dashboard, CPU specs & load average, RAM memory meter with visual progress bar, disk partition usage, top resource process list, environment variable inspector with sensitive key masking, system & process uptime, and runtime version summary.
  • 🌍 Web Utilities: Web page metadata & OpenGraph tag extractor, robots.txt fetcher, sitemap.xml parser, HTML snapshot generator, HTTP status & latency tester, redirect chain tracer, and remote favicon finder.
  • 🎨 Interactive Mode: Launch cbs without subcommands to enter a terminal UI powered by @clack/prompts with arrow-key navigation and step-by-step input prompts.
  • βš™ Centralized Configuration: Store preferences in user profile config directory using cbs config.
  • πŸ”’ Security First: Cryptographically secure random generators (crypto.randomBytes), 100% local JWT decoding, sensitive env key masking, and dry-run safety for destructive operations.

πŸš€ Quick Start & Installation

Global Installation

npm install -g cbs-devtools

Once installed, run:

cbs

Using npx (Without Installation)

npx cbs-devtools

πŸ–₯ Interactive Terminal Interface

Run cbs without arguments to launch the interactive UI:

cbs
β”Œ  CodeBySohaib DevTools - Interactive Mode
β”‚
β—‡  Select a category:
β”‚  ● 🌐 Network Tools
β”‚  β—‹ πŸ›  Developer Tools
β”‚  β—‹ ⚑ Generators
β”‚  β—‹ πŸ“ File Tools
β”‚  β—‹ πŸ–Ό Image Tools
β”‚  β—‹ πŸ’» System Tools
β”‚  β—‹ 🌍 Web Tools
β”‚  β—‹ βš™ Settings
β”‚  β—‹ ❌ Exit

πŸ“‘ Command Reference & Examples

Network Tools

cbs ip                          # Fetch public IP, country, ISP info
cbs local-ip                    # List local network interfaces and IP addresses
cbs dns google.com             # Perform DNS lookup (A, AAAA, MX, TXT, NS)
cbs ping google.com             # Test host ping latency
cbs port google.com 443         # Check if TCP port 443 is reachable
cbs headers https://example.com # Fetch HTTP response headers
cbs whois example.com           # Perform WHOIS lookup
cbs url-info https://example.com/path?key=val # Parse URL components
cbs network                     # Detailed network interface specifications
cbs trace google.com            # Run traceroute diagnostic

Developer Utilities

cat data.json | cbs json        # Pretty-print JSON from stdin
cbs json data.json              # Format JSON file
cbs json-minify data.json       # Minify JSON file
cbs base64 encode "Hello World" # Base64 encode
cbs base64 decode "SGVsbG8="    # Base64 decode
cbs hash "secret" sha256        # Compute SHA256 string hash
cbs file-hash file.txt sha256   # Compute file hash
cbs uuid --version v4           # Generate UUID v4
cbs uuid --version v7           # Generate time-ordered UUID v7
cbs timestamp 1600000000        # Convert Unix timestamp to ISO / UTC
cbs url-encode "a & b"          # URL encode string
cbs html-encode "<h1>"          # Encode HTML entities
cbs regex "(\w+)" "hello world" # Test regular expression
cbs jwt <your-token>            # Decode JWT token locally (offline)
cbs json2ts data.json           # Generate TypeScript interfaces

Generators

cbs password --length 24 --symbols --numbers # Generate secure password
cbs username                    # Generate random developer username
cbs slug "CodeBySohaib DevTools 1.0" # Create URL slug
cbs lorem --units words --count 10   # Generate Lorem Ipsum text
cbs fake --count 3              # Generate fake developer profile data
cbs color                       # Generate random HEX, RGB, HSL color
cbs gradient                    # Generate CSS linear gradient
cbs qr "https://example.com"    # Display ASCII QR code in terminal
cbs secret --bytes 32 --encoding hex # Generate random API secret

File Utilities

cbs file-info ./file.txt        # Detailed file metadata
cbs compress ./my-folder        # Zip directory
cbs extract archive.zip         # Extract zip file
cbs rename ./folder "\.jpeg$" ".jpg" --dry-run # Batch rename preview
cbs organize ./downloads --dry-run # Preview sorting folder by file type
cbs find ./src --ext ts         # Find files matching criteria
cbs duplicate-check ./photos    # Detect duplicate files by hash

Image Utilities

cbs image-info photo.jpg        # Dimensions, aspect ratio, MIME type
cbs image-resize photo.jpg -w 800 # Resize image width
cbs image-convert logo.png jpg  # Convert image format
cbs image-compress photo.jpg -q 70 # Compress image quality
cbs favicon logo.png -o ./favicons # Generate 16x16, 32x32, 48x48 icon set

System Utilities

cbs system                      # System overview dashboard
cbs cpu                         # CPU specifications & load average
cbs memory                      # RAM usage & progress bar
cbs disk                        # Disk partitions and free space
cbs processes --limit 10        # Top resource-consuming processes
cbs env                         # Environment variables (masks sensitive keys)
cbs env --show-values           # Show unmasked values
cbs uptime                      # System & process uptime
cbs os                          # Detailed operating system distribution
cbs node                        # Node.js runtime information
cbs versions                    # CLI, Node, OS version summary

Web Utilities

cbs metadata https://example.com # Fetch page title, meta description, OG tags
cbs robots example.com          # Fetch robots.txt
cbs sitemap example.com         # Parse sitemap.xml
cbs screenshot https://example.com # Capture web HTML snapshot & preview
cbs status https://example.com   # Check HTTP status code and latency
cbs redirect http://google.com  # Trace HTTP redirect chain
cbs web-favicon example.com     # Find remote website favicon URL

Configuration & Global Flags

cbs config view                 # Display current configuration
cbs config set theme vibrant    # Update config setting
cbs config reset                # Reset configuration to defaults

Global Flags:

  • --json: Output result in structured machine-readable JSON.
  • --quiet: Minimize banners and decorative output.
  • --debug: Display full stack traces on unexpected errors.

πŸ›  Local Development & Testing

1. Clone & Install Dependencies

git clone https://github.com/codebysohaib/cbs-devtools.git
cd cbs-devtools
npm install

2. Run Commands via Development Script

npm run dev -- ip
npm run dev -- password --length 20

3. Run Automated Tests

npm test

4. Build Production Bundle

npm run build

πŸ“¦ Publishing to npm

npm run check:type
npm run test
npm run build
npm publish --access public

🀝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.


πŸ“„ License

Distributed under the MIT License. Created by CodeBySohaib.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages