Skip to content
owengetinfo-designPublic

About

give yourself a break while model working

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chatris

Terminal Tetris where blocks are made of your AI chat keywords.

终端俄罗斯方块,方块上的文字来自你的 AI 聊天记录。

┌────────────────────┐  ╔════════════════════╗
│  te  rm  in  al    │  ║  CHATRIS           ║
│      渲染  引擎    │  ║ Score:      1200   ║
│  co  de  · · · ·   │  ║ Lines:         4   ║
│      · · · · · ·   │  ║ Level:         2   ║
│  · · · · · · · ·   │  ╚════════════════════╝
└────────────────────┘  ⚡ RUSH ▓▓▓░░░░░░░░░░░

Quick Start

# No install needed — just Node.js >= 18
node bin/tetrisminal.mjs

# Or with npm
npm start

Supported AI Tools

Chatris auto-detects your chat history from whichever tool is active:

Tool Format Status
Claude Code JSONL ~/.claude/projects/ Supported
Gemini CLI JSONL ~/.gemini/tmp/ Supported
Codex CLI JSONL ~/.codex/history/ Supported
Cursor SQLite state.vscdb Supported (needs system sqlite3)

Keywords are extracted from your chat using TF scoring — words you say get 2x weight.

If no chat history is found, it falls back to DEVLOG.md or a built-in word list.

Controls

Key Action
← → Move
↑ Rotate
↓ Soft drop
Space Hard drop
p Pause
t Cycle theme
r Restart
q / ESC Quit

Themes

Press t to cycle. 4 built-in themes:

  • classic — warm orange/green
  • palenight — soft pink/lavender
  • redcode — red/gold/crimson
  • glitch — cyan/magenta cyberpunk
node bin/tetrisminal.mjs --theme=glitch

Options

Game

Flag Default Description
--theme=NAME classic Starting theme
--speed=MS 500 Base drop interval in ms. Lower = faster
--level=N 1 Starting level (each level speeds up by 40ms)
--words=N 80 Word pool size (top N keywords)

Rush Mode

When the AI model finishes responding and you're idle, blocks start falling faster — nudging you back to work.

Flag Default Description
--grace=SEC 0 Grace period at game start. No rush for first N seconds
--rush-delay=SEC 5 How long to wait after model finishes before rush starts
--rush-speed=MS 1000 Rush escalation interval (faster = more aggressive)
--rush-max=N 12 Maximum rush level
--rush-floor=MS 25 Fastest possible tick during max rush
--no-rush — Disable rush mode entirely

Examples

# Chill mode — 60s grace, no rush pressure
node bin/tetrisminal.mjs --grace=60 --no-rush

# Competitive — fast start, aggressive rush
node bin/tetrisminal.mjs --speed=300 --level=3 --rush-delay=3

# Custom rush — slow escalation, generous delay
node bin/tetrisminal.mjs --rush-delay=10 --rush-speed=2000 --rush-max=6

# Just play, cyberpunk style
node bin/tetrisminal.mjs --theme=glitch --no-rush

Rush Detection

Rush triggers when the AI model finishes its response and you stop coding:

User sends message → JSONL last entry = user → model thinking → no rush
Model responds     → JSONL last entry = assistant (text) → file stops growing
5 seconds pass     → confirmed idle → rush starts → blocks accelerate
User types again   → JSONL grows → rush resets
  • Detects the active conversation by monitoring which JSONL file is growing
  • Checks message content (not just timestamps) to know if the model is done
  • Works across Claude Code, Gemini CLI, and Codex CLI
  • Cursor uses SQLite queries for the same detection
  • Stale/old sessions never trigger rush

Architecture

Single file (bin/tetrisminal.mjs), zero dependencies, pure Node.js ESM.

Adapter System          Game Engine           Rendering
┌─────────────┐        ┌──────────────┐      ┌──────────────┐
│ Claude Code │──┐     │ 7 Tetrominos │      │ ANSI escape  │
│ Gemini CLI  │──┤     │ 10×20 board  │      │ 256-color    │
│ Codex CLI   │──┼──→  │ TF keywords  │──→   │ 4 themes     │
│ Cursor      │──┤     │ Rush system  │      │ Side panel   │
│ DEVLOG.md   │──┘     │ Score/Level  │      │ Rush bar     │
└─────────────┘        └──────────────┘      └──────────────┘

License

MIT

About

give yourself a break while model working

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages