Skip to content

RANDSUM CLI — Command-Line Dice Roller

The RANDSUM CLI is a command-line dice roller powered by @randsum/roller. Pass any RANDSUM notation and get instant results in your terminal.

Install globally with Bun or npm:

Terminal window
# Bun
bun add -g @randsum/cli
# npm
npm install -g @randsum/cli
# Run without installing
npx @randsum/cli 4d6L

Requires Node >= 18 or Bun.

randsum [notation...] [flags]

Pass one or more notation arguments. Multiple notations are combined into a single roll result.

Terminal window
randsum 4d6L # Roll 4d6, drop lowest
randsum 2d20L +5 # Roll with advantage + modifier
randsum 1d20 -v # Verbose output
randsum 3d6 --json # JSON output
randsum 4d6L -r 6 # Roll 6 times
FlagDescription
-v, --verboseShow detailed roll breakdown (raw dice, kept dice, total)
--jsonOutput result as JSON
-r N, --repeat NRoll N times and print each result
-s N, --seed NUse a seeded random number generator for reproducible results
-h, --helpShow help text
-V, --versionShow installed version

Shows the total, followed by the final dice values in brackets, followed by any modifier descriptions.

14 [3, 5, 6] drop lowest 1

Multi-line breakdown showing each roll group with raw dice, kept dice (when modifiers apply), and total.

Roll: 4d6, drop lowest 1
Raw: [2, 3, 5, 6]
Kept: [3, 5, 6]
Total: 14

Structured JSON output. Useful for piping into other tools.

{
"total": 14,
"rolls": [
{
"description": ["4d6", "drop lowest 1"],
"raw": [2, 3, 5, 6],
"kept": [3, 5, 6],
"total": 14
}
]
}
Terminal window
# D&D ability score generation — roll 6 sets of 4d6 drop lowest
randsum 4d6L -r 6
# Advantage roll — two d20s, keep highest, plus 5
randsum 2d20H +5
# Seeded roll for reproducible results
randsum 2d6 -s 42
# Combine multiple notation groups
randsum 2d6+3 1d8
# JSON output for scripting
randsum 4d6L --json | jq '.total'