toss

A fast dice rolling CLI written in Zig

Language
Zig
Version
0.5.1
License
MIT
Category
CLI Tool

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

01

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

02

Reproducible rolls via --seed flag for deterministic results

03

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

04

Colorized output with row cycling, respects NO_COLOR

05

Labeled, aligned output for readability

06

Cross-platform — Linux, macOS, and Windows

07

Scriptable — results to stdout, diagnostics to stderr

08

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