CLI Usage¶
randword is a command-line interface (CLI) tool for generating random words, names, sequences, places, and more. It wraps the randword Python package into a convenient CLI utility.
Basic Usage¶
By default, running randword with word arguments will generate a random word:
$ randword word
concession
You can also pass arguments to refine the result:
$ randword word -i adj
accentual
$ randword word -min 8 -s un -x e
untouchable
Subcommands¶
The CLI supports multiple subcommands:
randword <command> [options]
Available commands:
word: Generate random word(s)name: Generate random name(s)surname: Generate random surname(s)fullname: Generate random full name(s)sequence: Generate alphanumeric sequence(s)letter: Generate random letter(s)digit: Generate random digit(s)country: Generate random country/countriescity: Generate random city/citiesmagic_8ball: Ask a Magic 8-Ball style questionflip_coin: Flip a coin
Command Details¶
word
randword word [count] [options]
Options:
-i,--include_pos: Include parts of speech (e.g. adj, verb)-e,--exclude_pos: Exclude parts of speech-min,--min_word_len: Minimum word length-max,--max_word_len: Maximum word length-l,--word_len: Exact word length-s,--starts_with: Start with given prefix-x,--ends_with: End with given suffix-p,--pattern: Match given substring pattern
Example:
randword word 3 -i adj verb -s re -min 5
name
randword name [count] [-g m|f]
surname
randword surname [count]
fullname
randword fullname [count] [-g m|f]
sequence
randword sequence [count] [length]
letter
randword letter [count]
digit
randword digit [count]
country
randword country [count]
city
randword city [count]
magic_8ball
randword magic_8ball
You will be prompted to type a yes/no question.
flip_coin
randword flip_coin
Returns True for heads or False for tails.
Help¶
For help with any subcommand:
randword <command> -h
Example:
randword word -h