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.
Installation
Section titled “Installation”Install globally with Bun or npm:
# Bunbun add -g @randsum/cli
# npmnpm install -g @randsum/cli
# Run without installingnpx @randsum/cli 4d6LRequires Node >= 18 or Bun.
randsum [notation...] [flags]Pass one or more notation arguments. Multiple notations are combined into a single roll result.
randsum 4d6L # Roll 4d6, drop lowestrandsum 2d20L +5 # Roll with advantage + modifierrandsum 1d20 -v # Verbose outputrandsum 3d6 --json # JSON outputrandsum 4d6L -r 6 # Roll 6 times| Flag | Description |
|---|---|
-v, --verbose | Show detailed roll breakdown (raw dice, kept dice, total) |
--json | Output result as JSON |
-r N, --repeat N | Roll N times and print each result |
-s N, --seed N | Use a seeded random number generator for reproducible results |
-h, --help | Show help text |
-V, --version | Show installed version |
Output Formats
Section titled “Output Formats”Compact (default)
Section titled “Compact (default)”Shows the total, followed by the final dice values in brackets, followed by any modifier descriptions.
14 [3, 5, 6] drop lowest 1Verbose (-v)
Section titled “Verbose (-v)”Multi-line breakdown showing each roll group with raw dice, kept dice (when modifiers apply), and total.
Roll: 4d6, drop lowest 1Raw: [2, 3, 5, 6]Kept: [3, 5, 6]Total: 14JSON (--json)
Section titled “JSON (--json)”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 } ]}Examples
Section titled “Examples”# D&D ability score generation — roll 6 sets of 4d6 drop lowestrandsum 4d6L -r 6
# Advantage roll — two d20s, keep highest, plus 5randsum 2d20H +5
# Seeded roll for reproducible resultsrandsum 2d6 -s 42
# Combine multiple notation groupsrandsum 2d6+3 1d8
# JSON output for scriptingrandsum 4d6L --json | jq '.total'