toss

A fast dice rolling CLI written in Zig

Zig v0.5.1 MIT
View on GitHub

A lightweight, high-performance command-line dice roller for tabletop RPG enthusiasts. Supports complex dice notation including keep/drop, exploding, rerolling, and arithmetic — all in a tiny ~30KB binary with no runtime dependencies.

Preview

Features

Comprehensive dice notation — keep/drop, exploding, rerolling, percentile, Fudge/Fate

Reproducible rolls via --seed flag for deterministic results

Arithmetic expressions — combine dice and modifiers (2d6+5)

Colorized output with row cycling, respects NO_COLOR

Labeled, aligned output for readability

Cross-platform — Linux, macOS, and Windows

Scriptable — results to stdout, diagnostics to stderr

Tiny binary (~30KB) with zero runtime dependencies

Install

Homebrew

$ brew install shhac/tap/toss

GitHub Release (macOS)

$ curl -L https://github.com/shhac/toss/releases/latest/download/toss-0.5.1-aarch64-macos.tar.gz | tar xz

Build from Source

$ git clone https://github.com/shhac/toss.git && cd toss && zig build -Doptimize=ReleaseSmall

Usage

D&D ability scores: roll 4d6, keep highest 3
$ toss 4d6k3
Advantage roll
$ toss 2d20kh1
Exploding dice (Savage Worlds)
$ toss '1d6!'
Great Weapon Fighting reroll
$ toss '2d6ro<=2'
Complex combined expression
$ toss '4d6!r1k3+5'
Reproducible roll
$ toss --seed 42 2d6