Gamble in your terminal! https://crates.io/crates/casino
  • Rust 99.7%
  • Shell 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Rosa Richter 4487d2a129
All checks were successful
ci/woodpecker/push/test Pipeline was successful
feat: Make stats tables prettier
2026-08-17 17:42:16 -06:00
.claude build: route toolchain commands through mise 2026-08-12 08:24:10 -06:00
.woodpecker refactor(ci): use mise for all ci 2026-02-28 16:12:29 -07:00
bin refactor: extract cargo-release as a tool stub 2025-10-23 21:57:15 -06:00
docs refactor: ask for a wager once for the whole house 2026-08-14 08:26:30 -06:00
LICENSES Relicense under AGPL 2024-07-02 14:49:11 -06:00
src feat: Make stats tables prettier 2026-08-17 17:42:16 -06:00
.editorconfig Do roulette! 2024-04-14 07:24:46 -06:00
.gitignore Make my own Advent of Code, with blackjack 2023-12-01 23:15:54 -07:00
.pre-commit-config.yaml Remove markdownlint pre-commit 2025-08-05 10:28:10 -06:00
Cargo.lock feat: set the currency in play from the command line 2026-08-16 14:14:41 -06:00
Cargo.toml feat: set the currency in play from the command line 2026-08-16 14:14:41 -06:00
CHANGELOG.md feat: Make stats tables prettier 2026-08-17 17:42:16 -06:00
CLAUDE.md docs: configure agent skills for Forgejo issue tracking 2026-08-12 06:52:45 -06:00
CODE_OF_CONDUCT.md Add trailing newline to CoC 2025-08-05 10:22:21 -06:00
CONTEXT.md feat!: hold a bankroll in the currency in play alone 2026-08-16 15:03:44 -06:00
LICENSE.md Fix wrong license in README 2024-07-08 14:57:52 -06:00
mise.toml build: run doctests as part of the test task 2026-08-12 07:31:38 -06:00
README.md feat: set the currency in play from the command line 2026-08-16 14:14:41 -06:00
release.toml Add cargo-release 2025-05-26 13:10:29 -06:00
renovate.json Update renovate.json 2026-05-27 15:56:14 +00:00

casino

status-badge Crates.io Version Crates.io

An entire casino built into your terminal.

Bet with fake money and play baccarat, blackjack, slots, roulette, and craps from the comfort of your shell.

Install

Install using cargo:

cargo install casino

Usage

Run casino for a selection of games, or casino <game> to start a specific game. You can run casino --help for a list of games and other options.

$ casino blackjack
Your money: $1000.00
> How much will you bet? 100
Betting $100.00
* The dealer issues your cards.
Dealer's hand: 🂠 🃂
Your hand: 🃔 🂺  (14)
> What will you do? Stand
* Hole card revealed!
Dealer's hand: 🂻 🃂  (12)
* The dealer issues themself another card.
Dealer's hand: 🂻 🃂 🃕  (17)
* The hand is finished!
HOUSE WINS! You lose $100.00. You now have $900.00

You start with $1000.00, and if you ever hit $0.00, you are gifted another $1000.00. This balance is persisted to your XDG data directory, along with the state of the deck of cards you're playing with. You can modify this file if you want to break my heart and cheat at this innocent little terminal game.

Check your wallet balance with casino balance:

$ casino balance
$1000.00

You can view your lifetime stats with casino stats:

$ casino stats
Most money in the bank.........$1109.00
Times hit bankruptcy..................0

Blackjack
  Hands won.............................1
  Hands lost............................0
  Hands tied............................0
  Total money won.................$100.00
  Total money lost..................$0.00
  Biggest win.....................$100.00
  Biggest loss......................$0.00

Roulette
  Spins won.............................1
  Spins lost............................0
  Total money won.................$100.00
  Total money lost..................$0.00
  Biggest win.....................$100.00
  Biggest loss......................$0.00

Slots
  Total pulls...........................5
  Total money spent................$71.00
  Total money won..................$40.00
  Biggest jackpot..................$40.00

Run casino --help for full usage instructions and documentation.

Files

This program creates a few files, and respects the XDG Base Directory specification so as not to clutter up your home folder.

  • ~/.config/casino/config.toml - general app and game configuration
  • ~/.local/share/casino/state.toml - your current wallet balance and the state of the deck
  • ~/.local/share/casino/stats.toml - where statistics are collected for casino stats

Any setting can also be given as an environment variable, which wins over the file for that run: CASINO_CURRENCY=GBP, or CASINO_BLACKJACK__SHOE_COUNT=2 for a setting under a game.

The currency can be changed without opening the file:

casino config set currency GBP
casino config set currency
casino config set currency -i

Name a code and it is taken as written, in whatever case you type it. Name none, or pass -i, and you pick from the list the cage changes money at.

Your bankroll goes through the cage as the setting changes, so what you hold is always money your table takes. The rest of the file is left as you wrote it, comments and all.

See the wiki for configuration docs.

Maintainer

This project is maintained by Rosa Richter. You can get in touch with her on Matrix.

Contributing

Questions and pull requests are more than welcome. I follow believe bad documentation is a bug, so if anything is unclear, please file an issue!

Note that this project is released with a Code of Conduct. By participating in this project you agree to abide by its terms.

License

© 2025 Rosa Richter

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.