A colorful 3D Rubik's Cube terminal UI with manual and auto modes.
โโโโโโโ โโโ โโโโโโโโโโ โโโ โโโโโโ
โโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโ
โโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโ
โโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโ
โโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโ โโโ โโโโโโโ โโโโโโโ โโโโโโโ โโโ
๐คฉ Rubui is a high-performance, fully 3D interactive Rubik's Cube simulator that runs entirely in your terminal. No GUI, no browserโjust pure terminal wizardry.
๐ก The Spark
Amid my desk clutterโPCs, USB drives, random stuffโone thing caught my eye: a Rubikโs Cube. I thought, โWhy not bring this puzzle to my terminal?โ That tiny idea grew into Rubui, born from curiosity, fun, and love for coding.
๐ Why Rubui? Because your terminal deserves more than logs and scriptsโit deserves playable 3D magic.
- ๐ฎ Manual Mode โ Solve the cube with keyboard controls
- ๐ Auto Mode โ Watch the cube scramble like a colorful screensaver
- ๐ง 3D Isometric Rendering โ Three visible faces with depth and shading
- ๐จ Rich ANSI Colors โ Vibrant face colours with theme support
- โจ๏ธ Real Cube Notation โ R, U, F, L, D, B + primes + doubles
- ๐ Undo / Redo โ Full move history
- ๐ค Auto Solve โ Kociemba twoโphase solver integration
- โก Smooth Animation โ Frame-based move transitions
- ๐ Command Prompt โ Type move sequences in-app
- โ๏ธ Config System โ TOML config with CLI overrides
- ๐ญ Themes โ Dark, light, and monochrome
- ๐ Live Status Bar โ Mode, moves, timer, FPS, theme
# Clone the repository
git clone https://github.com/programmersd21/rubui.git
cd rubui
# Install in development mode
pip install -e .
# Run it!
rubui- Python 3.10+
- A terminal with ANSI color support (Windows Terminal, iTerm2, any modern Linux terminal)
# Start in manual mode (default)
rubui
# Start in auto/screensaver mode
rubui -m auto
# Start scrambled
rubui --scramble
# Auto-solve the current cube (uses kociemba)
rubui --solve
# Deterministic scramble for testing
rubui --scramble --seed 42
# Control auto mode speed
rubui -m auto --speed 0.1
# Use a different theme
rubui --theme light
# Disable colours
rubui --no-color
# Generate default config
rubui init| Key | Action |
|---|---|
R L U D F B |
Face turns (clockwise) |
r l u d f b |
Wide turns (Rw/Lw/Uw/Dw/Fw/Bw) |
' then move |
Prime turn (X') |
2 then move |
Double turn (X2) |
x y z |
Whole cube rotations |
| Arrow keys | Rotate cube view |
s |
Scramble |
v |
Solve (kociemba) |
Ctrl+Z |
Undo |
Ctrl+Y |
Redo |
m |
Switch manual/auto mode |
: or / |
Open command prompt |
? |
Show help |
q |
Quit |
Press : or / to enter the command prompt. Type standard cube notation:
R U R' U'
F2 D L' U2
Press Enter to execute, Escape to cancel.
rubui supports TOML configuration files with the following priority:
- CLI arguments (highest)
- Local
rubui.toml(current directory) - Global
~/.config/rubui/rubui.toml - Built-in defaults (lowest)
Generate a default config:
rubui initExample rubui.toml:
[app]
mode = "manual"
theme = "dark"
scramble_on_start = false
solve_on_start = false
color = true
[auto]
fps = 60
speed = 0.05
[scramble]
length = 25
seed = 0rubui/
โโโ main.py # CLI entry point (Typer)
โโโ cube_engine.py # Core 3ร3 cube state
โโโ moves.py # Move execution + undo/redo
โโโ parser.py # Notation parser
โโโ renderer.py # 3D isometric renderer
โโโ config.py # TOML config system
โโโ input_handler.py # Keyboard input
โโโ manual_mode.py # Interactive manual mode
โโโ auto_mode.py # Screensaver auto mode
โโโ solver.py # Kociemba solver integration
โโโ utils.py # Terminal utilities + themes
See docs/architecture.md for detailed module documentation.
pip install -e ".[dev]"
python -m pytest tests/ -vMIT โ see LICENSE.
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Write tests for new features
- Submit a pull request
Made with โค๏ธ for cube enthusiasts who live in the terminal.
