Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/ Random Public

A random command line tool to do random stuff 🎲

License

Notifications You must be signed in to change notification settings

eneko/Random

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

14 Commits

Repository files navigation

Random

A random command line tool to do random stuff

Usage

Pick Command

Pick one from multiple options passed in as parameters or via standard input (stdin).

From parameters:

$ random pick 🍊 🍎 🍍 πŸ‡
🍍

From stdin:

$ echo 🍊 🍎 🍍 πŸ‡ | random pick
🍎

Combined parameters and stdin:

$ echo 🍊 🍎 | random pick 🍍 πŸ‡
πŸ‡

When stdin contains multiple lines, a random line is selected:

$ ls | random pick
Package.swift
$ ls -la | random pick
-rw-r--r-- 1 enekoalonso staff 1069 Sep 14 22:27 LICENSE

If a single word is passed in, a random character is selected:

$ random pick eneko
e

Shuffle Command

Shuffle options passed in as parameters or via standard input in random order (stdin).

$ random shuffle 🍊 🍎 🍍 πŸ‡
🍍
🍎
🍊
πŸ‡

Dice Command

Throw one or multiple dice.

$ random dice
2

Multiple throws:

$ random dice -n 6
1
6
6
1
6
3

Installation

Note: Requires Swift 4.2, works on Mac and Linux

With Homebrew

$ brew install eneko/tap/random

From Source

$ git clone https://github.com/eneko/Random.git
$ cd Random
$ make

Download Binary

$ curl -Ls https://github.com/eneko/Random/releases/download/latest/random.macos.zip -o /tmp/random.macos.zip
$ unzip -j -d /usr/local/bin /tmp/random.macos.zip 

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /