Skip to content
/ roll-cli Public

CLI-based dice roller with all of the features you could want.

License

Notifications You must be signed in to change notification settings

Vlek/roll-cli

Repository files navigation

Roll-cli

PyPI Status Python Version License

Read the documentation at https://roll-cli.readthedocs.io/ Tests Codecov

pre-commit Black

Asciinema usage example

Features

Dice roller CLI Script

Makes it easy to roll dice via command line and is able handle the basic math functions, including parens!

Feature-packed, including:

  • Basic math functions
  • Dice rolling with variable sides and number of dice
  • Correct order of operations (with some liberty taken for where to put dice notation)
  • Verbose printing to see what each individual dice roll was
  • Ability to roll the minimum or maximum for each roll
  • Keep notation, specify the number of dice whose value you would like to keep, discarding the rest

Requirements

  • Python >=3.7
  • While not required, Pipx helps manage package dependencies and ensure that they do not conflict.

Installation

You can install Roll via pipx from PyPI:

$ pipx install roll-cli

Usage

After installation, the roll command is then made globally available.

$ roll
8

$ roll 4d6
14

$ roll 10d6K3 -v
Rolled: 10d6: [2, 5, 5, 4, 2, 4, 3, 5, 3, 6]
Keeping highest: 3: [5, 5, 6]
16

Please see the Command-line Reference for further details.

Contributing

This is just a fun learning project for me, so I am trying to do all the work myself. If you believe that there are features that I should incorporate, please do not hesitate to create a feature request.

To learn more, see the Contributor Guide.

License

Distributed under the terms of the GPL 3.0 license, Roll is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

Vlek

All coding is done by @vlek.

This project uses @cjolowicz's Hypermodern Python Cookiecutter template.