
tMemory
Published on February 16, 2025
CLIGamesInkNodeNPMOpen SourceTypescriptWeekend Hack
Flip pairs, beat the clock, and compare your best runs across terminal and web.
π What is tMemory?
tMemory started as a command-line love letter to the classic Memory card game. It blends React, Ink, and a Supabase-backed API so every flip, combo, and photo-finish can land on a shared leaderboard. The experience now spans a polished CLI, a Next.js-powered leaderboard site at https://tmemory.griffen.codes/, and an API that keeps both in sync.

β¨ Key Features
- Core Gameplay β Single-player, head-to-head, and AI showdowns with grid sizes from 2Γ2 up to custom 12Γ12 layouts.
- Competitive Edge β Global leaderboards track your best times with optional filters by game mode, rows, and columns so you can βSee how you stack up against players from all over the world. Filter by game type and board size to find your competition.β
- Dual Experiences β Jump in instantly via
npx tmemoryor check the web experience for a quick visual leaderboard at https://tmemory.griffen.codes/. - Smart Opponent β Face an AI rival that remembers the board and forces you to optimize every flip.
- Custom Boards β Design bespoke layouts directly in the CLI to craft practice drills or community challenges.


π― Perfect For
- Speedrunners hunting tighter reaction windows and quicker clears.
- Terminal fans who want a polished, animated CLI game built with Ink.
- Friendly competition circles that need a shared leaderboard without spinning up infrastructure.
- Developers exploring how React can power both terminal interfaces and serverless scoreboards.
β‘ Quick Start
Bash
# Play instantly
npx tmemory
# Or install for repeated play
npm install -g tmemory
tmemory
π Impact & Proof
- Live leaderboard at https://tmemory.griffen.codes/ pulls scores from the shared Supabase database and stays in sync with every CLI submission.
- Next.js API endpoints at https://tmemory.griffen.codes/api/scores/submit and https://tmemory.griffen.codes/api/scores/leaderboard accept verified runs and serve the top boards on demand.
π§± Technology Stack
- CLI: React + Ink UI, ink-playing-cards, TypeScript.
- Backend: Next.js App Router handlers with Zod validation, Supabase/PostgreSQL storage, profanity filtering.
- Distribution: Published as
tmemoryon npm with a compiled CLI entry point indist/cli.js.
π Links
- GitHub Repository β https://github.com/gfargo/tmemory
- npm Package β https://www.npmjs.com/package/tmemory
- Leaderboard & Web Showcase β https://tmemory.griffen.codes/
- API Source β https://github.com/gfargo/tMemory-www/tree/main/src/app/api/scores
- Ink Playing Cards Component β https://github.com/gfargo/ink-playing-cards
Give the CLI a spin, climb the leaderboard, and let me know where you placeβIβm always ready for a rematch.
Like what you saw?
There's more where that came from.
