Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cover

rand — Random Data Generator CLI

Generate passwords, UUIDs, integers, floats, strings, lorem ipsum, hex dumps, MAC addresses, colors, tokens, and more — all from the command line.

rand is a swiss-army knife for every developer who needs random data. Instead of remembering a dozen different tools (uuidgen, openssl rand, pwgen, mkshuf, etc.), just use one.

rand password 24          # Generate a 24-char password
rand uuid --version 4     # Generate a UUID v4
rand int 1 100 --count 5  # Five random integers
rand lorem --paragraphs 3 # Three paragraphs of filler text
rand mac --format cisco   # Random MAC in Cisco format

Why?

  • One tool, one syntax — no more Googling "how to generate random hex in terminal"
  • All outputs are usable — JSON mode for scripting, plain for interactive use
  • Zero runtime dependencies — uses only Python standard library
  • Cryptographically secure — secrets module for passwords and tokens
  • Fast and lightweight — sub-second startup, no bloat

Who is it for?

  • Developers who need test data, fixtures, or placeholder content
  • DevOps / SREs who generate tokens, passwords, or MAC addresses for configs
  • Designers who need random colors or hex values
  • Writers who need lorem ipsum for layouts
  • Anyone who uses a terminal

Installation

Via pip

pip install randomizer-cli

Via pipx (isolated, recommended)

pipx install randomizer-cli

Manual install

git clone https://github.com/AFS-Agentics/randomizer-cli.git
cd randomizer-cli
pip install -e .

Verify installation

rand --version
# rand 0.1.0

rand --help
# Shows full usage

Usage

rand password

Generate cryptographically secure passwords.

rand password                      # 20 chars (default)
rand password 32                   # 32 chars
rand password 16 --no-symbols      # Letters + numbers only
rand password 24 --no-symbols --no-numbers  # Letters only
rand password 16 --count 5         # 5 passwords at once

rand uuid

Generate UUIDs (versions 1, 3, 4, 5).

rand uuid                      # UUID v4 (default)
rand uuid --version 1          # UUID v1 (time-based)
rand uuid --version 4          # UUID v4 (random)
rand uuid --uppercase          # F47AC10B-58CC-4372-A567-0E02B2C3D479
rand uuid --count 3            # Three UUIDs

rand int

Generate random integers in a range.

rand int                       # Integer between 0–100
rand int 1 6                   # Like a dice roll
rand int -50 50 --count 10     # Ten integers
rand int 1 100 --count 5 --unique  # Five unique integers

rand float

Generate random floating-point numbers.

rand float                     # Float between 0.0–1.0
rand float 0 100 --count 3     # Three floats
rand float 0 1 --decimals 4    # Rounded to 4 decimal places

rand string

Generate random strings from various character sets.

rand string                    # 16 alphanumeric chars
rand string --length 32        # 32 chars
rand string --charset hex      # Hex only (0-9, a-f)
rand string --charset base64   # Base64 charset
rand string --charset "ABC123" # Custom charset
rand string --count 5          # Five strings

Built-in charsets: alphanumeric, alpha, numeric, hex, base64, printable, ascii

rand lorem

Generate lorem ipsum placeholder text.

rand lorem                        # One paragraph
rand lorem --paragraphs 3         # Three paragraphs
rand lorem --sentences 5          # Five sentences
rand lorem --words 20             # Exactly 20 words

rand hex

Generate random hex strings from random bytes.

rand hex                          # 32 hex chars (16 bytes)
rand hex --bytes 8                # 16 hex chars (8 bytes)
rand hex --separator ':'          # 0a:1b:2c:3d format
rand hex --uppercase              # 0A1B2C3D format
rand hex --count 3                # Three hex strings

rand choice

Pick random items from a list.

rand choice cat dog bird fish              # Single random pick
rand choice apple banana cherry --count 2  # Two picks
rand choice A B C D --count 3 --unique     # Three unique picks

rand shuffle

Shuffle a list of items.

rand shuffle foo bar baz qux    # Random order
rand shuffle 1 2 3 4 5 6        # Shuffle numbers

rand mac

Generate a random MAC address.

rand mac                                # Linux format: aa:bb:cc:dd:ee:ff
rand mac --format cisco                 # Cisco: aaaa.bbbb.cccc
rand mac --format windows               # Windows: AA-BB-CC-DD-EE-FF
rand mac --format freebsd               # FreeBSD: aa:bb:cc:dd:ee:ff
rand mac --count 3                      # Three MACs

rand color

Generate random colors.

rand color                      # Hex: #A3F0B2
rand color --format rgb         # RGB: rgb(163, 240, 178)
rand color --format hsl         # HSL: hsl(130, 72%, 79%)
rand color --count 5            # Five colors

rand token

Generate cryptographically secure tokens.

rand token                      # 64 hex chars (32 bytes)
rand token 16                   # 32 hex chars (16 bytes)
rand token 32 --url             # URL-safe base64 (no padding)
rand token --count 3            # Three tokens

JSON Output

Pass --json (before any subcommand) to output results as JSON.

rand --json password 16 --count 3
# [
#   "aB3$kL9...",
#   "xY7#mP2...",
#   "qR1@nF5..."
# ]

rand --json color --format rgb --count 4
# Outputs JSON array

API Reference

Commands

Command Description Aliases
password Generate random password —
uuid Generate UUID —
int Generate random integer(s) —
float Generate random float(s) —
string Generate random string(s) —
lorem Generate lorem ipsum text —
hex Generate random hex string —
choice Pick random item(s) from a list —
shuffle Shuffle items —
mac Generate random MAC address —
color Generate random color —
token Generate cryptographically safe token —

Global Options

Option Description
-h, --help Show help and exit
--version Show version and exit
--json Output results as JSON array

Shared Subcommand Options

Option Applies To Description
--count N password, uuid, int, float, string, hex, choice, mac, color, token Number of items to generate
--unique int, choice Each value must be unique

Dependencies and System Requirements

  • Python 3.10+ (no third-party packages required)
  • Works on macOS, Linux, Windows (anywhere Python runs)
  • Uses only the Python standard library (argparse, secrets, random, uuid, json, base64, string)

Project Structure

randomizer-cli/
├── LICENSE              # MIT License
├── README.md            # This file
├── setup.py             # Package setup (legacy)
├── pyproject.toml       # PEP 621 project metadata
└── rand_cli/
    ├── __init__.py      # Package init + version
    ├── __main__.py      # `python -m rand_cli` entry
    ├── cli.py           # CLI argument parsing and dispatch
    └── generators.py    # All random data generators

License

MIT © 2026 AFS Agentics. See LICENSE for details.


Built by AFS Agentics — Continuous Build Pipeline

About

Generate random data from the command line — passwords, UUIDs, integers, strings, lorem ipsum, colors, MAC addresses, and more.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages