
tBlackjack
Published on March 11, 2025
CLIGamesInkNPMOpen SourceReactTypescriptWeekend Hack
Terminal blackjack you can launch in seconds with a polished Ink UI and friendly table chatter.
π What is tBlackjack?
tBlackjack started as a weekend experiment to see how far Ink and ink-playing-cards could push terminal UX, and it evolved into a blackjack table that feels at home in your shell. The game handles the full dealing loop, dealer AI, and table talk so players can fire it up with npx and jump straight into a round.

β¨ Key Features
Core Gameplay
- π΄ Standard blackjack flow with soft-17 handling and ace scoring backed by
evaluateHand. - β‘οΈ Responsive Ink interface that adjusts cleanly across terminals thanks to modular components in
src/components. - β οΈ Rich card rendering powered by
ink-playing-cards, the card toolkit that inspired the project.
Table Feedback & Personality
- π¬ Friendly status copy in
DealerMessagesexplains what the dealer just didβbust, blackjack, or soft stand. - π£οΈ
GameStatsadds subtle βthinkingβ indicators while the dealer plays so youβre never wondering why the action paused. - π¬ Shuffle warnings fire automatically when the deck drops below 25% remaining (
DECK_RESHUFFLE_THRESHOLDinGame.tsx).

Session Tracking
- π
GameStatisticsDisplaykeeps running totals for wins, busts, blackjacks, and best hand value. - π Toggle the HUD with
TABto surface stats only when you want them. - π Reset logic uses the shared
DeckProviderso every new game starts fresh without manual shuffles.
Developer Ergonomics
- π§© Components such as
App,Game, andWelcomeare split out for quick experimentation with new screens or controls. - π§ͺ Snapshot coverage in
src/test/app.test.tsxguards the Ink layout. - π Published as a CLI via
src/cli.tsxso you can ship updates withnpm.

π― Perfect For
- Terminal tinkerers who want a casino-grade side quest during a build.
- Ink developers exploring complex, stateful UIs without leaving the shell.
- Teams demoing
ink-playing-cardsin a real game loop. - Streamers looking for an easy crowd-pleaser between pull requests.
βοΈ Quick Start
Bash
npx tblackjack
# or install globally
npm install -g tblackjack
tblackjackπ Impact & Proof
- π§ͺ Automated snapshots plus deterministic hand evaluation keep scoring predictable, even when the deck shoes get thin.
- π§° Runs anywhere Node 18+ is available; exercised locally across macOS Terminal, iTerm2, and Hyper during development.
- π Doubles as a living showcase for
ink-playing-cards, so any improvement to the library lands here too.
π Links
- Project repo: https://github.com/gfargo/tblackjack
- npm package: https://www.npmjs.com/package/tblackjack
- Ink playing cards dependency: https://github.com/gfargo/ink-playing-cards
- Demo GIF: https://raw.githubusercontent.com/gfargo/tblackjack/main/assets/demo.gif
Ready to take a seat? Fire up npx tblackjack, watch the dealer flip that first card, and let me know what feels missing.
Like what you saw?
There's more where that came from.
